Skip to content

Commit

Permalink
Merge pull request #768 from forta-network/caner/obfuscate-metric-det…
Browse files Browse the repository at this point in the history
…ails

Obfuscate URLs in metrics
  • Loading branch information
canercidam authored Jun 14, 2023
2 parents f91c381 + 4ea8963 commit b33c6b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/components/metrics/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b33c6b0

Please sign in to comment.