Skip to content

Commit

Permalink
spec: Rename mercure_subscribers metrics to mercure_subscribers_gauge
Browse files Browse the repository at this point in the history
This change allow Datadog agent to fetch all metrics starting with mercure_subscribers
- mercure_subscribers_gauge (previously mercure_subscribers)
- mercure_subscribers_total

See #720 issue for more information
  • Loading branch information
ndousson committed Dec 28, 2022
1 parent 3b02223 commit 92a2c97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metrics.go
Expand Up @@ -48,7 +48,7 @@ func NewPrometheusMetrics(registry prometheus.Registerer) *PrometheusMetrics {
),
subscribers: prometheus.NewGauge(
prometheus.GaugeOpts{
Name: "mercure_subscribers",
Name: "mercure_subscribers_connected",
Help: "The current number of running subscribers",
},
),
Expand Down
2 changes: 1 addition & 1 deletion server_test.go
Expand Up @@ -382,7 +382,7 @@ func TestMetricsCollect(t *testing.T) {
body = url.Values{"topic": {"http://example.com/foo/1"}, "data": {"second hello"}, "id": {"second"}}
server.publish(body)

server.assertMetric("mercure_subscribers 3")
server.assertMetric("mercure_subscribers_connected 3")
server.assertMetric("mercure_subscribers_total 4")
server.assertMetric("mercure_updates_total 2")
}
Expand Down

0 comments on commit 92a2c97

Please sign in to comment.