Skip to content

Commit

Permalink
Change http.(server|client).duration unit to seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Apr 13, 2023
1 parent 25f513d commit 1cbc90a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions semantic_conventions/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions specification/metrics/semantic_conventions/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]`.

<!-- semconv metric.http.server.duration(metric_table) -->
| 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. |
<!-- endsemconv -->

<!-- semconv metric.http.server.duration(full) -->
Expand Down Expand Up @@ -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 ]`.

<!-- semconv metric.http.client.duration(metric_table) -->
| 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. |
<!-- endsemconv -->

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

0 comments on commit 1cbc90a

Please sign in to comment.