Skip to content

Commit bb42c33

Browse files
authored
Change http.server.duration and http.client.duration units to seconds (open-telemetry#3390)
1 parent 3250d03 commit bb42c33

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

semantic_conventions/metrics/http.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ groups:
44
metric_name: http.server.duration
55
brief: "Measures the duration of inbound HTTP requests."
66
instrument: histogram
7-
unit: "ms"
7+
unit: "s"
88
extends: attributes.http.server
99
attributes:
1010
# todo (lmolkova) build tools don't populate grandparent attributes
@@ -84,7 +84,7 @@ groups:
8484
metric_name: http.client.duration
8585
brief: "Measures the duration of outbound HTTP requests."
8686
instrument: histogram
87-
unit: "ms"
87+
unit: "s"
8888
extends: attributes.http.client
8989
attributes:
9090
- ref: http.method

specification/metrics/semantic_conventions/http-metrics.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ operations. By adding HTTP attributes to metric events it allows for finely tune
3232

3333
This metric is required.
3434

35+
This metric SHOULD be specified with
36+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advice)
37+
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 ]`.
38+
3539
<!-- semconv metric.http.server.duration(metric_table) -->
3640
| Name | Instrument Type | Unit (UCUM) | Description |
3741
| -------- | --------------- | ----------- | -------------- |
38-
| `http.server.duration` | Histogram | `ms` | Measures the duration of inbound HTTP requests. |
42+
| `http.server.duration` | Histogram | `s` | Measures the duration of inbound HTTP requests. |
3943
<!-- endsemconv -->
4044

4145
<!-- semconv metric.http.server.duration(full) -->
@@ -213,10 +217,14 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
213217

214218
This metric is required.
215219

220+
This metric SHOULD be specified with
221+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advice)
222+
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 ]`.
223+
216224
<!-- semconv metric.http.client.duration(metric_table) -->
217225
| Name | Instrument Type | Unit (UCUM) | Description |
218226
| -------- | --------------- | ----------- | -------------- |
219-
| `http.client.duration` | Histogram | `ms` | Measures the duration of outbound HTTP requests. |
227+
| `http.client.duration` | Histogram | `s` | Measures the duration of outbound HTTP requests. |
220228
<!-- endsemconv -->
221229

222230
<!-- semconv metric.http.client.duration(full) -->

0 commit comments

Comments
 (0)