From 5a793b0628f06a2390002c0990c95ae667e00fdd Mon Sep 17 00:00:00 2001 From: castaneai Date: Wed, 13 Mar 2024 22:43:03 +0900 Subject: [PATCH] change metrics namespace --- docs/metrics.md | 2 +- metrics.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/metrics.md b/docs/metrics.md index 253e796..060ae55 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -6,7 +6,7 @@ minimatch Backend exposes metrics in OpenTelemetry format to help monitor perfor | Metrics Name | Type | Description | |:--------------------------------------------|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `minimatch.backend.tickets.count` | UpDownCounter | Total number of tickets. **Do not sum** this counter, as a single backend counts all tickets. | +| `minimatch.store.tickets.count` | UpDownCounter | Total number of tickets. **Do not sum** this counter, as a single backend counts all tickets. | | `minimatch.backend.tickets_fetched` | Counter | Number of times Ticket has been fetched by backends. | | `minimatch.backend.tickets_assigned` | Counter | Number of times match has been assigned to a Ticket by backends. If this value is extremely less than `minimatch.backend.tickets_fetched`, the matchmaking logic may be undesirable. | | `minimatch.backend.fetch_tickets_latency` | Histogram | Latency of the time the Ticket has been fetched by backends. If this value is slow, you may have a Redis performance problem or a lock conflict with assign tickets or other backends. | diff --git a/metrics.go b/metrics.go index 2df9603..34a8371 100644 --- a/metrics.go +++ b/metrics.go @@ -79,7 +79,7 @@ func newBackendMetrics(provider metric.MeterProvider) (*backendMetrics, error) { assignerLatency: assignerLatency, assignToRedisLatency: assignToRedisLatency, } - ticketCount, err := meter.Int64ObservableUpDownCounter("minimatch.backend.tickets.count", + ticketCount, err := meter.Int64ObservableUpDownCounter("minimatch.store.tickets.count", metric.WithDescription("Total number of tickets. Do not sum this counter, as a single backend counts all tickets."), metric.WithInt64Callback(func(ctx context.Context, o metric.Int64Observer) error { o.Observe(metrics.ticketCountActive.Load(), metric.WithAttributes(attributeActiveTicket))