From c3c5854bab07c108d390e04decf1209f3e1a37d2 Mon Sep 17 00:00:00 2001 From: Ferdynand Naczynski Date: Tue, 13 Sep 2022 14:36:52 +0200 Subject: [PATCH] fix: make metric name consistent with rest of ory ecosystem (#1010) --- contrib/grafana/Oathkeeper-Dashboard.json | 8 ++++---- metrics/prometheus.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/grafana/Oathkeeper-Dashboard.json b/contrib/grafana/Oathkeeper-Dashboard.json index c19f8a80ce..5e5a82f128 100644 --- a/contrib/grafana/Oathkeeper-Dashboard.json +++ b/contrib/grafana/Oathkeeper-Dashboard.json @@ -345,25 +345,25 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.90, avg(rate(ory_oathkeeper_request_duration_seconds_bucket[5m])) by (le, instance))", + "expr": "histogram_quantile(0.90, avg(rate(ory_oathkeeper_requests_duration_seconds_bucket[5m])) by (le, instance))", "interval": "", "legendFormat": "{{ instance }} - p90", "refId": "A" }, { - "expr": "histogram_quantile(0.95, avg(rate(ory_oathkeeper_request_duration_seconds_bucket[5m])) by (le, instance))", + "expr": "histogram_quantile(0.95, avg(rate(ory_oathkeeper_requests_duration_seconds_bucket[5m])) by (le, instance))", "interval": "", "legendFormat": "{{ instance }} - p95", "refId": "B" }, { - "expr": "histogram_quantile(0.99, avg(rate(ory_oathkeeper_request_duration_seconds_bucket[5m])) by (le, instance))", + "expr": "histogram_quantile(0.99, avg(rate(ory_oathkeeper_requests_duration_seconds_bucket[5m])) by (le, instance))", "interval": "", "legendFormat": "{{ instance }} - p99", "refId": "C" }, { - "expr": "histogram_quantile(1, avg(rate(ory_oathkeeper_request_duration_seconds_bucket[5m])) by (le, instance))", + "expr": "histogram_quantile(1, avg(rate(ory_oathkeeper_requests_duration_seconds_bucket[5m])) by (le, instance))", "interval": "", "legendFormat": "{{ instance }} - p100", "refId": "D" diff --git a/metrics/prometheus.go b/metrics/prometheus.go index 7556a51df7..f992a83f14 100644 --- a/metrics/prometheus.go +++ b/metrics/prometheus.go @@ -24,7 +24,7 @@ var ( // HistogramRequestDuration provides the duration of requests HistogramRequestDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "ory_oathkeeper_request_duration_seconds", + Name: "ory_oathkeeper_requests_duration_seconds", Help: "Time spent serving requests.", Buckets: prometheus.DefBuckets, }, @@ -58,7 +58,7 @@ func NewConfigurablePrometheusRepository(d driver.Driver, logger *logrusx.Logger ) HistogramRequestDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: d.Configuration().PrometheusMetricsNamePrefix() + "request_duration_seconds", + Name: d.Configuration().PrometheusMetricsNamePrefix() + "requests_duration_seconds", Help: "Time spent serving requests.", Buckets: prometheus.DefBuckets, },