Skip to content

Commit be6d97a

Browse files
feat: update metrics for stable HTTP semconv and adjust service health dashboard queries
1 parent d91b2c0 commit be6d97a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

compose.demo.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ services:
2121
# Ship Python log records via OTLP with trace context attached.
2222
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
2323
OTEL_METRIC_EXPORT_INTERVAL: "10000"
24+
# Emit the *stable* HTTP semconv (http.server.request.duration in seconds,
25+
# http.route) rather than the legacy names. Stable metric names are frozen,
26+
# so the Service Health dashboard's app-SDK panel survives library bumps.
27+
OTEL_SEMCONV_STABILITY_OPT_IN: http
2428
logging:
2529
driver: json-file
2630
options:

dashboards/service-health.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@
116116
"datasource": { "type": "prometheus", "uid": "prometheus" },
117117
"targets": [
118118
{
119-
"expr": "histogram_quantile(0.95, sum by (le, http_target) (rate(http_server_duration_milliseconds_bucket{job=\"$service\"}[$__rate_interval])))",
120-
"legendFormat": "{{http_target}}",
119+
"expr": "histogram_quantile(0.95, sum by (le, http_route) (rate(http_server_request_duration_seconds_bucket{job=\"$service\"}[$__rate_interval])))",
120+
"legendFormat": "{{http_route}}",
121121
"refId": "A"
122122
}
123123
],
124124
"fieldConfig": {
125125
"defaults": {
126-
"unit": "ms",
126+
"unit": "s",
127127
"custom": { "lineWidth": 2, "fillOpacity": 10 }
128128
},
129129
"overrides": []

0 commit comments

Comments
 (0)