Skip to content

Commit

Permalink
Metric zero (#834)
Browse files Browse the repository at this point in the history
* emit 0 metrics on events_error_total registration

* actions zerod
  • Loading branch information
bwagner5 authored Jun 5, 2023
1 parent 09b29d1 commit 0493b2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/observability/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ func registerMetricsWith(provider *metric.MeterProvider) (Metrics, error) {
if err != nil {
return Metrics{}, fmt.Errorf("failed to create Prometheus counter %q: %w", name, err)
}
actionsCounter.Add(context.Background(), 0)

name = "events.error"
errorEventsCounter, err := meter.Int64Counter(name, instrument.WithDescription("Number of errors in events processing"))
if err != nil {
return Metrics{}, fmt.Errorf("failed to create Prometheus counter %q: %w", name, err)
}

errorEventsCounter.Add(context.Background(), 0)
return Metrics{
meter: meter,
errorEventsCounter: errorEventsCounter,
Expand Down

0 comments on commit 0493b2e

Please sign in to comment.