From 1cbc90a00ac2d73817e5eb1407e8d7442c5eedaf 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 --- CHANGELOG.md | 3 +++ semantic_conventions/metrics/http.yaml | 4 ++-- .../metrics/semantic_conventions/http-metrics.md | 12 ++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b9e7bad2a4..9b8f7d59b5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ release. ### Semantic Conventions +- Change http.server.duration and http.client.duration units to seconds + ([#3390](https://github.com/open-telemetry/opentelemetry-specification/pull/3390)) + ### Compatibility ### OpenTelemetry Protocol 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. |