From 4ea89632dd7fc1b7a6aab785893e4f625b926560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20=C3=87=C4=B1dam?= Date: Wed, 14 Jun 2023 13:08:41 +0300 Subject: [PATCH] obfuscate urls in metrics --- services/components/metrics/lifecycle.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/components/metrics/lifecycle.go b/services/components/metrics/lifecycle.go index 984b9076..946f2b45 100644 --- a/services/components/metrics/lifecycle.go +++ b/services/components/metrics/lifecycle.go @@ -6,6 +6,7 @@ import ( "github.com/forta-network/forta-core-go/domain" "github.com/forta-network/forta-core-go/protocol" + "github.com/forta-network/forta-core-go/utils" "github.com/forta-network/forta-node/clients" "github.com/forta-network/forta-node/config" ) @@ -175,6 +176,7 @@ func fromBotSubscriptions(action string, subscriptions []domain.CombinerBotSubsc } func fromBotConfigs(metricName string, details string, botConfigs []config.AgentConfig) (metrics []*protocol.AgentMetric) { + details = utils.ObfuscateURLs(details) for _, botConfig := range botConfigs { metric := &protocol.AgentMetric{ AgentId: botConfig.ID, @@ -192,6 +194,7 @@ func fromBotConfigs(metricName string, details string, botConfigs []config.Agent } func fromBotIDs(metricName string, details string, botIDs []string) (metrics []*protocol.AgentMetric) { + details = utils.ObfuscateURLs(details) for _, botID := range botIDs { metrics = append(metrics, &protocol.AgentMetric{ AgentId: botID,