From cf66a5c2dd340e4467af36857970926cdd45a3db Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 12 Apr 2023 20:28:59 -0700 Subject: [PATCH] Change http.(server|client).duration unit to seconds --- semantic_conventions/metrics/http.yaml | 4 ++-- .../metrics/semantic_conventions/http-metrics.md | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/semantic_conventions/metrics/http.yaml b/semantic_conventions/metrics/http.yaml index ed1fc781844..7f52514c628 100644 --- a/semantic_conventions/metrics/http.yaml +++ b/semantic_conventions/metrics/http.yaml @@ -4,7 +4,7 @@ groups: metric_name: http.server.duration brief: "Measures the duration of inbound HTTP requests." instrument: histogram - unit: "ms" + unit: "s" extends: attributes.http.server attributes: # todo (lmolkova) build tools don't populate grandparent attributes @@ -84,7 +84,7 @@ groups: metric_name: http.client.duration brief: "Measures the duration of outbound HTTP requests." instrument: histogram - unit: "ms" + unit: "s" extends: attributes.http.client attributes: - ref: http.method diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index e18bb475bae..968b0575494 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -32,10 +32,14 @@ operations. By adding HTTP attributes to metric events it allows for finely tune This metric is required. +This metric SHOULD be specified with +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advice) +of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `http.server.duration` | Histogram | `ms` | Measures the duration of inbound HTTP requests. | +| `http.server.duration` | Histogram | `s` | Measures the duration of inbound HTTP requests. | @@ -213,10 +217,14 @@ SHOULD NOT be set if only IP address is available and capturing name would requi This metric is required. +This metric SHOULD be specified with +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advice) +of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `http.client.duration` | Histogram | `ms` | Measures the duration of outbound HTTP requests. | +| `http.client.duration` | Histogram | `s` | Measures the duration of outbound HTTP requests. |