Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions packages/service-library/src/servicelib/prometheus_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class PrometheusMetrics:
request_count: Counter
in_flight_requests: Gauge
response_latency_with_labels: Histogram
response_latency_detailed_buckets: Histogram


def _get_exemplar() -> dict[str, str] | None:
Expand Down Expand Up @@ -87,14 +86,7 @@ def get_prometheus_metrics() -> PrometheusMetrics:
documentation="Time processing a request with detailed labels",
labelnames=["method", "endpoint", "simcore_user_agent"],
registry=registry,
buckets=(0.1, 0.5, 1),
)

response_latency_detailed_buckets = Histogram(
name="http_request_latency_seconds_detailed_buckets",
documentation="Time processing a request with detailed buckets but no labels",
registry=registry,
buckets=(0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10),
buckets=(0.1, 1, 5, 10),
)

return PrometheusMetrics(
Expand All @@ -105,7 +97,6 @@ def get_prometheus_metrics() -> PrometheusMetrics:
request_count=request_count,
in_flight_requests=in_flight_requests,
response_latency_with_labels=response_latency_with_labels,
response_latency_detailed_buckets=response_latency_detailed_buckets,
)


Expand Down Expand Up @@ -150,6 +141,3 @@ def record_response_metrics(
metrics.response_latency_with_labels.labels(method, endpoint, user_agent).observe(
amount=response_latency_seconds, exemplar=exemplar
)
metrics.response_latency_detailed_buckets.observe(
amount=response_latency_seconds, exemplar=exemplar
)
Loading