Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog post: HTTP semantic conventions declared stable #3472

Merged
merged 45 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
21b9194
HTTP semconv stability
trask Nov 2, 2023
fd78f77
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 2, 2023
e5eb050
Apply suggestions from code review
trask Nov 2, 2023
0b4e4d8
No level-1 headings
trask Nov 2, 2023
257ecc9
link
trask Nov 2, 2023
4ebe9bf
words
trask Nov 3, 2023
a11fd66
levels
trask Nov 3, 2023
29fe8fc
simpler
trask Nov 3, 2023
e3162eb
Format + refcache
chalin Nov 3, 2023
1bc4322
Fix dict
chalin Nov 3, 2023
b18d6d1
@chalin's suggestions ❤️
trask Nov 3, 2023
d432d30
Fix formatting
chalin Nov 3, 2023
8e8ce21
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
17807f4
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
feb7d00
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
5dde1eb
Migration plan
trask Nov 3, 2023
4b21e2e
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
d2c47f6
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
df95c5b
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
9a9d2aa
redo migration plan section
trask Nov 3, 2023
e12452b
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
bf75b8e
word
trask Nov 3, 2023
9ae7882
Explain client.* and server.* advantage
trask Nov 3, 2023
b0947bf
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
15ff9ca
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
88a36c3
Apply suggestions from code review
trask Nov 3, 2023
380c866
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
54aad43
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
e3ab8e9
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
9d7f326
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
f5214c2
Apply suggestions from code review
trask Nov 3, 2023
26f8ad5
arrows
trask Nov 3, 2023
5f00488
Apply suggestions from code review
trask Nov 3, 2023
95119a5
clarify
trask Nov 3, 2023
b44e136
caps
trask Nov 3, 2023
94af295
On ...
trask Nov 3, 2023
0dc9dee
npm run fix:format
trask Nov 3, 2023
874f9d9
Merge branch 'main' into http-semconv-stability
trask Nov 3, 2023
dee2158
fix
trask Nov 3, 2023
94564f5
Update content/en/blog/2023/http-conventions-declared-stable.md
trask Nov 3, 2023
4e985bf
Merge branch 'main' into http-semconv-stability
trask Nov 3, 2023
a387f16
Merge branch 'main' into http-semconv-stability
mhausenblas Nov 4, 2023
01746f9
Merge branch 'main' into http-semconv-stability
cartermp Nov 4, 2023
00627e7
Update http-conventions-declared-stable.md
cartermp Nov 4, 2023
b5bcd19
Merge branch 'main' into http-semconv-stability
cartermp Nov 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 271 additions & 0 deletions content/en/blog/2023/http-conventions-declared-stable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
---
title: HTTP semantic conventions declared stable
linkTitle: HTTP semconv are stable
date: 2023-11-03
cartermp marked this conversation as resolved.
Show resolved Hide resolved
author: '[Trask Stalnaker](https://github.com/trask) (Microsoft)'
cSpell:ignore: Liudmila Molkova
trask marked this conversation as resolved.
Show resolved Hide resolved
---

Early this year we embarked on a three month project to stabilize HTTP semantic
trask marked this conversation as resolved.
Show resolved Hide resolved
conventions. We are proud to announce (nine months later), that the HTTP
trask marked this conversation as resolved.
Show resolved Hide resolved
semantic conventions are now the first OpenTelemetry semantic convention to be
trask marked this conversation as resolved.
Show resolved Hide resolved
declared stable! The stable version is a significant evolution over the previous
unstable version:
trask marked this conversation as resolved.
Show resolved Hide resolved

mhausenblas marked this conversation as resolved.
Show resolved Hide resolved
- Improvements brought over from the
[alignment with Elastic Common Schema](/blog/2023/ecs-otel-semconv-convergence/)
trask marked this conversation as resolved.
Show resolved Hide resolved
- The `url.*` namespace, which can be reused in the future by non-HTTP
semantic conventions
- The `client.*` and `server.*` namespaces, which are easier to reason about
and work better on logs (where there is no span kind)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does that mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've expanded this bullet, lmk if it helps

- More consistency around using the `http.request.*` and `http.response.*`
namespaces
- Further alignment with Prometheus by adopting seconds as the standard unit for
metrics
trask marked this conversation as resolved.
Show resolved Hide resolved
- Attributes which are less generally useful are no longer captured by default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a reader, not sure I understand what you mean with "to implement a transition plan". What do I have to do, if anything? Are there scripts that help me automate things? Maybe I don't need to do anything since OpenTelemetry is taking care of it, etc.

I suggest being more explicit about expectations and shared responsibility model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, I redid the transition plan section to try to make it clearer, ptal

in order to reduce the cost of capturing, processing, and storing telemetry
trask marked this conversation as resolved.
Show resolved Hide resolved
- Default values are now used carefully so that there's no ambiguity whether an
attribute's absence represents the default value or not
trask marked this conversation as resolved.
Show resolved Hide resolved
- Metric cardinality problems have been addressed
trask marked this conversation as resolved.
Show resolved Hide resolved

## Transition plan
trask marked this conversation as resolved.
Show resolved Hide resolved

Because of the number of changes, and because of the number of users impacted by
these changes, we are requiring instrumentations to implement a transition plan
to help users manage the process of upgrading to the stable HTTP semantic
conventions. We plan to use a similar transition plan when stabilizing other
semantic conventions.
trask marked this conversation as resolved.
Show resolved Hide resolved

A warning like this appears at the top of stable HTTP semantic convention pages:
trask marked this conversation as resolved.
Show resolved Hide resolved

> **Warning** When adopting the stable HTTP semantic conventions, existing HTTP
> instrumentations
>
> - SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN` in
> their existing major version, which accepts:
> - `http` - emit the new, stable HTTP and networking conventions, and stop
> emitting the old HTTP and networking conventions that the instrumentation
> emitted previously.
> - `http/dup` - emit both the old and the stable HTTP and networking
> conventions, allowing for a seamless transition.
> - The default behavior (in the absence of one of these values) is to
> continue emitting whatever version of the old HTTP and networking
> conventions the instrumentation was emitting previously.
> - SHOULD maintain (security patching at a minimum) the existing major version
> for at least six months after it starts emitting both sets of conventions.
> - SHOULD drop the environment variable in the next major version and emit only
> the stable HTTP and networking conventions.

## Summary of changes to the HTTP semantic conventions since version `v1.20.0`.
trask marked this conversation as resolved.
Show resolved Hide resolved

### Common attributes across HTTP client and HTTP server spans:
trask marked this conversation as resolved.
Show resolved Hide resolved

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/semantic_conventions/http.md#common-attributes)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.0/docs/http/http-spans.md#common-attributes)

- `http.method` -> `http.request.method`
- Now captures only 9 common HTTP methods by default (configurable) plus
`_OTHER`
- `http.status_code` -> `http.response.status_code`
- `http.request.header.<key>`
- Dash (`"-"`) to underscore (`"_"`) normalization in `<key>` has been removed
- HTTP Server spans: now must be provided to sampler
- `http.response.header.<key>`
- Dash (`"-"`) to underscore (`"_"`) normalization in `<key>` has been removed
- `http.request_content_length` -> `http.request.body.size`
- Recommended -> Opt-In
- _Not marked stable yet_
- `http.response_content_length` -> `http.response.body.size`
- Recommended -> Opt-In
- _Not marked stable yet_
- `user_agent.original`
- HTTP Client spans: Recommended -> Opt-In
- HTTP Server spans: now must be provided to sampler
- (see below if updating from version `v1.18.0` or earlier)
- `net.protocol.name` -> `network.protocol.name`
- Recommended -> Conditionally required if not `http` and
`network.protocol.version` is set
- `net.protocol.version` -> `network.protocol.version`
- Examples fixed: `2.0` -> `2` and `3.0` -> `3`
- (see below if updating from version `v1.19.0` or earlier)
- `net.sock.family` -> Removed
- `net.sock.peer.addr` -> `network.peer.address`
- HTTP server spans: if `http.client_ip` was unknown (i.e. no
[`X-Forwarded-For`][X-Forwarded-For], [`Forwarded#for`][Forwarded#for]
headers), then _also_ `net.sock.peer.addr` -> `client.address` (and note
`client.address` must be provided to sampler)
- `net.sock.peer.port` -> `network.peer.port`
- Now captured even if same as `server.port`
- `net.sock.peer.name` -> Removed
- New: `http.request.method_original` (only captured when `http.request.method`
is `_OTHER`)
- New: `error.type`
chalin marked this conversation as resolved.
Show resolved Hide resolved
trask marked this conversation as resolved.
Show resolved Hide resolved

### HTTP client span attributes:
trask marked this conversation as resolved.
Show resolved Hide resolved

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/semantic_conventions/http.md#http-client)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.0/docs/http/http-spans.md#http-client)

- `http.url` -> `url.full`
- `http.resend_count` -> `http.request.resend_count`
- `net.peer.name` -> `server.address`
- `net.peer.port` -> `server.port`
- Now captured even when same as default port for scheme
trask marked this conversation as resolved.
Show resolved Hide resolved

### HTTP server span attributes:
trask marked this conversation as resolved.
Show resolved Hide resolved

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/semantic_conventions/http.md#http-server)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.0/docs/http/http-spans.md#http-server)

- `http.route` (No change)
- `http.target` -> split into `url.path` and `url.query`
- `http.scheme` -> `url.scheme`
- Now factors in [`X-Forwarded-Proto`][X-Forwarded-Proto],
[`Forwarded#proto`][Forwarded#proto] headers
- `http.client_ip` -> `client.address`
- If `http.client_ip` was unknown (i.e. no
[`X-Forwarded-For`][X-Forwarded-For], [`Forwarded#for`][Forwarded#for]
headers), then `net.sock.peer.addr` -> `client.address`
- Now must be provided to sampler
- `net.host.name` -> `server.address`
- Now based only on [`Host`][Host header], [:authority][HTTP/2 authority],
[`X-Forwarded-Host`][X-Forwarded-Host], [`Forwarded#host`][Forwarded#host]
headers)
- `net.host.port` -> `server.port`
- Now based only on [`Host`][Host header], [:authority][HTTP/2 authority],
[`X-Forwarded-Host`][X-Forwarded-Host], [`Forwarded#host`][Forwarded#host]
headers)
trask marked this conversation as resolved.
Show resolved Hide resolved

### HTTP client and server span names:
trask marked this conversation as resolved.
Show resolved Hide resolved

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/semantic_conventions/http.md#name)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.0/docs/http/http-spans.md#name)

The `{http.method}` portion of span names is replace by `HTTP` when
`{http.method}` is `_OTHER`.

Note: see below if updating from version `v1.17.0` or earlier.
trask marked this conversation as resolved.
Show resolved Hide resolved

### HTTP client duration metric

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/metrics/semantic_conventions/http-metrics.md#metric-httpclientduration)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.22.0/docs/http/http-metrics.md#metric-httpclientrequestduration)

- Name: `http.client.duration` -> `http.client.request.duration`
- Unit: `ms` -> `s`
- Description: `Measures the duration of inbound HTTP requests.` ->
`Duration of HTTP server requests.`
- Histogram buckets: boundaries updated to reflect change from milliseconds to
seconds, and zero bucket boundary removed
- Attribute changes:
- `http.method` -> `http.request.method`
- Now captures only 9 common HTTP methods by default plus `_OTHER`
- `http.status_code` -> `http.response.status_code`
- `net.peer.name` -> `server.address`
- `net.peer.port` -> `server.port`
- Now captured even when same as default port for scheme
- `net.sock.peer.addr` -> Removed
- `net.protocol.name` -> `network.protocol.name`
- Recommended -> Conditionally required if not `http` and
`network.protocol.version` is set
- `net.protocol.version` -> `network.protocol.version`
- Examples fixed: `2.0` -> `2` and `3.0` -> `3`
- Note: see below if updating from version `v1.19.0` or earlier
- New: `error.type`
trask marked this conversation as resolved.
Show resolved Hide resolved

### HTTP server duration metric

[`v1.20.0`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/metrics/semantic_conventions/http-metrics.md#metric-httpserverduration)
->
[`v1.23.0` (stable)](https://github.com/open-telemetry/semantic-conventions/blob/v1.22.0/docs/http/http-metrics.md#metric-httpserverrequestduration)

- Name `http.server.duration` -> `http.server.request.duration`
- Unit: `ms` -> `s`
- Description: `Measures the duration of inbound HTTP requests.` ->
`Duration of HTTP server requests.`
- Histogram buckets: boundaries updated to reflect change from milliseconds to
seconds, and zero bucket boundary removed
- Attribute changes:
- `http.route` (No change)
- `http.method` -> `http.request.method`
- Now captures only 9 common HTTP methods by default plus `_OTHER`
- `http.status_code` -> `http.response.status_code`
- `http.scheme` -> `url.scheme`
- Now factors in [`X-Forwarded-Proto`][X-Forwarded-Proto],
[`Forwarded#proto`][Forwarded#proto] headers
- `net.protocol.name` -> `network.protocol.name`
- Recommended -> Conditionally required if not `http` and
`network.protocol.version` is set
- `net.protocol.version` -> `network.protocol.version`
- Examples fixed: `2.0` -> `2` and `3.0` -> `3`
- Note: see below if updating from version `v1.19.0` or earlier
- `net.host.name` -> `server.address`
- Recommended -> Opt-In (due to high-cardinality vulnerability since based
on HTTP headers)
- Now based only on [`Host`][Host header], [:authority][HTTP/2 authority],
[`X-Forwarded-Host`][X-Forwarded-Host], [`Forwarded#host`][Forwarded#host]
headers)
- `net.host.port` -> `server.port`
- Recommended -> Opt-In (due to high-cardinality vulnerability since based
on HTTP headers)
- Now based only on [`Host`][Host header], [:authority][HTTP/2 authority],
[`X-Forwarded-Host`][X-Forwarded-Host], [`Forwarded#host`][Forwarded#host]
headers)
- New: `error.type`
trask marked this conversation as resolved.
Show resolved Hide resolved

## If you are coming from an earlier semantic convention version:
trask marked this conversation as resolved.
Show resolved Hide resolved

### If updating from version `v1.19.0` or earlier:
trask marked this conversation as resolved.
Show resolved Hide resolved

- `http.flavor` -> `network.protocol.version`
- Examples fixed: `2.0` -> `2` and `3.0` -> `3`
trask marked this conversation as resolved.
Show resolved Hide resolved

### If updating from version `v1.18.0` or earlier:
trask marked this conversation as resolved.
Show resolved Hide resolved

- `http.user_agent` -> `user_agent.original`
trask marked this conversation as resolved.
Show resolved Hide resolved

### If updating from version `v1.17.0` or earlier:
trask marked this conversation as resolved.
Show resolved Hide resolved

#### HTTP server span name:
trask marked this conversation as resolved.
Show resolved Hide resolved

- when `http.route` is available
- `{http.route}` -> `{summary} {http.route}`
- when `http.route` is not available
- `HTTP {http.method}` -> `{summary}`

where `{summary}` is `{http.method}`, unless `{http.method}` is `_OTHER`, in
trask marked this conversation as resolved.
Show resolved Hide resolved
which case `{summary}` is `HTTP`.

#### HTTP client span name:
trask marked this conversation as resolved.
Show resolved Hide resolved

- `HTTP {http.method}` -> `{summary}`
trask marked this conversation as resolved.
Show resolved Hide resolved

where `{summary}` is `{http.method}`, unless `{http.method}` is `_OTHER`, in
trask marked this conversation as resolved.
Show resolved Hide resolved
which case `{summary}` is `HTTP`.

[Host header]: https://tools.ietf.org/html/rfc7230#section-5.4
[HTTP/2 authority]: https://tools.ietf.org/html/rfc9113#section-8.3.1
[Forwarded#for]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#for
[Forwarded#proto]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#proto
[Forwarded#host]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#host
[X-Forwarded-For]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-For
[X-Forwarded-Proto]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto
[X-Forwarded-Host]:
https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Host

## Thanks
trask marked this conversation as resolved.
Show resolved Hide resolved

This was a huge community effort that spanned many many people. Thank you to
everyone who contributed! And special thanks to
[Liudmila Molkova](https://github.com/lmolkova) for her HTTP domain expertise
and for helping to drive this effort every step of the way.
trask marked this conversation as resolved.
Show resolved Hide resolved
32 changes: 32 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,30 @@
"StatusCode": 206,
"LastSeen": "2023-06-29T18:51:23.515285-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#for": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:16.900109-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#host": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:48.340922-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#proto": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:27.385988-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-For": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:11.582225-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Host": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:43.193675-04:00"
},
"https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto": {
"StatusCode": 206,
"LastSeen": "2023-11-03T03:04:22.148405-04:00"
},
"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS": {
"StatusCode": 206,
"LastSeen": "2023-06-29T15:53:59.660121-04:00"
Expand Down Expand Up @@ -2263,6 +2287,10 @@
"StatusCode": 200,
"LastSeen": "2023-06-30T08:32:10.766549-04:00"
},
"https://github.com/lmolkova": {
"StatusCode": 200,
"LastSeen": "2023-11-03T03:04:54.119611-04:00"
},
"https://github.com/mahboubii/grpcmetrics": {
"StatusCode": 200,
"LastSeen": "2023-06-30T09:15:29.922451-04:00"
Expand Down Expand Up @@ -5331,6 +5359,10 @@
"StatusCode": 200,
"LastSeen": "2023-06-29T18:42:20.913106-04:00"
},
"https://tools.ietf.org/html/rfc9113#section-8.3.1": {
"StatusCode": 200,
"LastSeen": "2023-11-03T03:04:37.939785-04:00"
},
"https://tracetest.io/": {
"StatusCode": 206,
"LastSeen": "2023-08-14T12:06:16.100357-03:00"
Expand Down