Skip to content

Commit 00e6733

Browse files
🎨 remove histogram with many buckets (#7706)
1 parent 1fa455a commit 00e6733

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

packages/service-library/src/servicelib/prometheus_metrics.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class PrometheusMetrics:
4040
request_count: Counter
4141
in_flight_requests: Gauge
4242
response_latency_with_labels: Histogram
43-
response_latency_detailed_buckets: Histogram
4443

4544

4645
def _get_exemplar() -> dict[str, str] | None:
@@ -87,14 +86,7 @@ def get_prometheus_metrics() -> PrometheusMetrics:
8786
documentation="Time processing a request with detailed labels",
8887
labelnames=["method", "endpoint", "simcore_user_agent"],
8988
registry=registry,
90-
buckets=(0.1, 0.5, 1),
91-
)
92-
93-
response_latency_detailed_buckets = Histogram(
94-
name="http_request_latency_seconds_detailed_buckets",
95-
documentation="Time processing a request with detailed buckets but no labels",
96-
registry=registry,
97-
buckets=(0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10),
89+
buckets=(0.1, 1, 5, 10),
9890
)
9991

10092
return PrometheusMetrics(
@@ -105,7 +97,6 @@ def get_prometheus_metrics() -> PrometheusMetrics:
10597
request_count=request_count,
10698
in_flight_requests=in_flight_requests,
10799
response_latency_with_labels=response_latency_with_labels,
108-
response_latency_detailed_buckets=response_latency_detailed_buckets,
109100
)
110101

111102

@@ -150,6 +141,3 @@ def record_response_metrics(
150141
metrics.response_latency_with_labels.labels(method, endpoint, user_agent).observe(
151142
amount=response_latency_seconds, exemplar=exemplar
152143
)
153-
metrics.response_latency_detailed_buckets.observe(
154-
amount=response_latency_seconds, exemplar=exemplar
155-
)

0 commit comments

Comments
 (0)