Skip to content

fix: Add http path prefix as metrics labels#111

Merged
nssherpa merged 1 commit intomainfrom
nsherpa/metrics
Feb 12, 2026
Merged

fix: Add http path prefix as metrics labels#111
nssherpa merged 1 commit intomainfrom
nsherpa/metrics

Conversation

@nssherpa
Copy link
Copy Markdown
Contributor

@nssherpa nssherpa commented Feb 12, 2026

Testing

Currently we don't have enough visibility into what is being called. This adds a cachew.http.path.prefix label.
Screenshot 2026-02-12 at 10 11 45 AM

 curl -s http://localhost:9102/metrics | grep 'cachew_path_prefix=' | sed 's/.*cachew_path_prefix="\([^"]*\).*/\1/' | sort -u
_readiness
git
github.com
hermit
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="1000"} 1
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="2500"} 1
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="5000"} 1
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="7500"} 1
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="10000"} 1
http_server_duration_milliseconds_bucket{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0",le="+Inf"} 1
http_server_duration_milliseconds_sum{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0"} 15.430042
http_server_duration_milliseconds_count{cachew_path_prefix="hermit",http_method="GET",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="8080",net_protocol_name="http",net_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_version="0.58.0"} 1
# HELP http_server_request_size_bytes_total Measures the size of HTTP request messages.
# TYPE http_server_request_size_bytes_total counter

@nssherpa nssherpa force-pushed the nsherpa/metrics branch 2 times, most recently from dee3309 to 53f7244 Compare February 12, 2026 21:32
@nssherpa nssherpa changed the title fix: Add http_route to metrics fix: Add http path prefix as metrics labels Feb 12, 2026
@nssherpa nssherpa marked this pull request as ready for review February 12, 2026 21:38
@nssherpa nssherpa requested a review from a team as a code owner February 12, 2026 21:38
@nssherpa nssherpa requested review from alecthomas and removed request for a team February 12, 2026 21:38
@nssherpa nssherpa merged commit bf76b19 into main Feb 12, 2026
5 checks passed
@nssherpa nssherpa deleted the nsherpa/metrics branch February 12, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants