Skip to content

Commit

Permalink
Change metrics Subsystem name to avoid conflicts with older metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
helder-junior committed Aug 13, 2024
1 parent 298d03a commit e7c237f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ func (c *Client) newGRPCClient(
"serverAddress": c.serverAddress,
"async": async,
})
c.logger.Infoln("Registering events gateway metrics...")
err := metrics.RegisterMetrics(configPrefix, c.config)
c.logger.Infoln("Events gateway metrics registered.")
if err != nil {
return nil, err
}
Expand Down
5 changes: 0 additions & 5 deletions client/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ func (s *gRPCClientSync) metricsReporterInterceptor(
event.Topic,
"0",
).Inc()
metrics.HelderRequestsSuccessCounter.WithLabelValues(
method,
event.Topic,
"0",
).Inc()
return nil
}

Expand Down
12 changes: 1 addition & 11 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

const metricsNamespace = "eventsgateway"
const metricsSubsystem = "client"
const metricsSubsystem = "client_v4"

var (

Expand All @@ -55,15 +55,6 @@ var (
},
[]string{"route", "topic", "retry"},
)
// HelderRequestsSuccessCounter is the count of successfull calls to the server
HelderRequestsSuccessCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: metricsNamespace,
Subsystem: metricsSubsystem,
Name: "helder_requests_success_counter",
Help: "the count of successfull client requests to the server",
},
[]string{"route", "topic", "retry"},
)

// ClientRequestsFailureCounter is the count of failed calls to the server
ClientRequestsFailureCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Expand Down Expand Up @@ -97,7 +88,6 @@ func RegisterMetrics(configPrefix string, config *viper.Viper) error {
ClientRequestsSuccessCounter,
ClientRequestsFailureCounter,
AsyncClientRequestsDroppedCounter,
HelderRequestsSuccessCounter,
}

for _, collector := range collectors {
Expand Down

0 comments on commit e7c237f

Please sign in to comment.