From 4704d2657b400c7922e31eaa72c0c12363614317 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Tue, 5 Dec 2023 16:07:34 +1100 Subject: [PATCH] Label metrics by endpoint not path Metrics are not logs! Currently, OWS pods are exporting ~5k metrics each due to a misconfiguration, unreasonably requiring Prometheus to retain multiple separate time-series per HTTP path. High cardinality information (individual HTTP paths) belong in logs but not metrics. This change makes OWS consistent with datacube-explorer: https://github.com/opendatacube/datacube-explorer/commit/6051dd65dcbedef9bb007b50ed47461062b0b91d --- datacube_ows/startup_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacube_ows/startup_utils.py b/datacube_ows/startup_utils.py index 8e4944a0..a0d9a5a4 100644 --- a/datacube_ows/startup_utils.py +++ b/datacube_ows/startup_utils.py @@ -203,7 +203,7 @@ def initialise_prometheus(app, log=None): if os.environ.get("prometheus_multiproc_dir", False): from prometheus_flask_exporter.multiprocess import \ GunicornInternalPrometheusMetrics - metrics = GunicornInternalPrometheusMetrics(app) + metrics = GunicornInternalPrometheusMetrics(app, group_by="endpoint") if log: log.info("Prometheus metrics enabled") return metrics