Skip to content

Commit 29617ec

Browse files
feat(http): migrate HTTP conventions to Weaver schema v2 - Closes #3809
1 parent b51e2a6 commit 29617ec

6 files changed

Lines changed: 436 additions & 663 deletions

File tree

model/http/common.yaml

Lines changed: 20 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
groups:
1+
file_format: definition/2
2+
3+
attribute_groups:
24
- id: attributes.http.common
3-
type: attribute_group
4-
brief: "Describes HTTP attributes."
5+
visibility: public
6+
stability: development
7+
brief: 'Describes HTTP attributes.'
58
attributes:
69
- ref: http.request.method
710
requirement_level: required
@@ -14,85 +17,50 @@ groups:
1417
examples: ['timeout', 'java.net.UnknownHostException', 'server_certificate_invalid', '500']
1518
note: |
1619
If the request fails with an error before response status code was sent or received,
17-
`error.type` SHOULD be set to exception type (its fully-qualified class name, if applicable)
20+
error.type SHOULD be set to exception type (its fully-qualified class name, if applicable)
1821
or a component-specific low cardinality error identifier.
1922
2023
If response status code was sent or received and status indicates an error according to [HTTP span status definition](/docs/http/http-spans.md),
21-
`error.type` SHOULD be set to the status code number (represented as a string), an exception type (if thrown) or a component-specific error identifier.
24+
error.type SHOULD be set to the status code number (represented as a string), an exception type (if thrown) or a component-specific error identifier.
2225
23-
The `error.type` value SHOULD be predictable and SHOULD have low cardinality.
26+
The error.type value SHOULD be predictable and SHOULD have low cardinality.
2427
Instrumentations SHOULD document the list of errors they report.
2528
26-
The cardinality of `error.type` within one instrumentation library SHOULD be low, but
27-
telemetry consumers that aggregate data from multiple instrumentation libraries and applications
28-
should be prepared for `error.type` to have high cardinality at query time, when no
29-
additional filters are applied.
30-
31-
If the request has completed successfully, instrumentations SHOULD NOT set `error.type`.
29+
If the request has completed successfully, instrumentations SHOULD NOT set error.type.
3230
- ref: network.protocol.name
3331
examples: ['http', 'spdy']
3432
requirement_level:
35-
conditionally_required: If not `http` and `network.protocol.version` is set.
33+
conditionally_required: If not http and network.protocol.version is set.
3634
- ref: network.protocol.version
3735
examples: ['1.0', '1.1', '2', '3']
38-
3936
- id: attributes.http.client
40-
type: attribute_group
37+
visibility: public
38+
stability: development
4139
brief: 'HTTP Client attributes'
42-
extends: attributes.http.common
40+
ref_group: attributes.http.common
4341
attributes:
4442
- ref: server.address
4543
requirement_level: required
46-
note: |
47-
In HTTP/1.1, when the [request target](https://www.rfc-editor.org/rfc/rfc9112.html#name-request-target)
48-
is passed in its [absolute-form](https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2.2),
49-
the `server.address` SHOULD match the host component of the request target.
50-
51-
In all other cases, `server.address` SHOULD match the host component of the
52-
`Host` header in HTTP/1.1 or the `:authority` pseudo-header in HTTP/2 and HTTP/3.
5344
- ref: server.port
5445
requirement_level: required
55-
note: |
56-
In the case of HTTP/1.1, when the [request target](https://www.rfc-editor.org/rfc/rfc9112.html#name-request-target)
57-
is passed in its [absolute-form](https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2.2),
58-
the `server.port` SHOULD match the port component of the request target.
59-
60-
In all other cases, `server.port` SHOULD match the port component of the
61-
`Host` header in HTTP/1.1 or the `:authority` pseudo-header in HTTP/2 and HTTP/3.
6246
- ref: url.scheme
6347
requirement_level: opt_in
64-
examples: ["http", "https"]
48+
examples: ['http', 'https']
6549
- ref: url.template
6650
requirement_level: opt_in
67-
note: >
68-
The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
69-
7051
- id: attributes.http.server
71-
type: attribute_group
52+
visibility: public
53+
stability: development
7254
brief: 'HTTP Server attributes'
73-
extends: attributes.http.common
55+
ref_group: attributes.http.common
7456
attributes:
7557
- ref: http.route
7658
requirement_level:
7759
conditionally_required: If and only if it's available
7860
- ref: server.address
79-
brief: >
80-
Name of the local HTTP server that received the request.
81-
note: >
82-
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
8361
- ref: server.port
84-
brief: >
85-
Port of the local HTTP server that received the request.
86-
note: >
87-
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
8862
requirement_level:
89-
conditionally_required: If available and `server.address` is set.
63+
conditionally_required: If available and server.address is set.
9064
- ref: url.scheme
9165
requirement_level: required
92-
examples: ["http", "https"]
93-
note: >
94-
The scheme of the original client request, if known
95-
(e.g. from [Forwarded#proto](https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#proto),
96-
[X-Forwarded-Proto](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto),
97-
or a similar header).
98-
Otherwise, the scheme of the immediate peer request.
66+
examples: ['http', 'https']
Lines changed: 139 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,139 @@
1-
groups:
2-
- id: registry.http.deprecated
3-
type: attribute_group
4-
display_name: Deprecated HTTP Attributes
5-
brief: "Describes deprecated HTTP attributes."
6-
attributes:
7-
- id: http.method
8-
type: string
9-
brief: 'Deprecated, use `http.request.method` instead.'
10-
stability: development
11-
deprecated:
12-
reason: renamed
13-
renamed_to: http.request.method
14-
examples: ["GET", "POST", "HEAD"]
15-
- id: http.status_code
16-
type: int
17-
brief: 'Deprecated, use `http.response.status_code` instead.'
18-
stability: development
19-
deprecated:
20-
reason: renamed
21-
renamed_to: http.response.status_code
22-
examples: [200]
23-
- id: http.scheme
24-
type: string
25-
brief: 'Deprecated, use `url.scheme` instead.'
26-
stability: development
27-
deprecated:
28-
reason: renamed
29-
renamed_to: url.scheme
30-
examples: ['http', 'https']
31-
- id: http.url
32-
type: string
33-
brief: 'Deprecated, use `url.full` instead.'
34-
stability: development
35-
deprecated:
36-
reason: renamed
37-
renamed_to: url.full
38-
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv']
39-
- id: http.target
40-
type: string
41-
brief: 'Deprecated, use `url.path` and `url.query` instead.'
42-
stability: development
43-
deprecated:
44-
reason: obsoleted
45-
note: Split to `url.path` and `url.query`.
46-
examples: ['/search?q=OpenTelemetry#SemConv']
47-
- id: http.request_content_length
48-
type: int
49-
brief: 'Deprecated, use `http.request.header.content-length` instead.'
50-
stability: development
51-
deprecated:
52-
reason: uncategorized
53-
note: Replaced by `http.request.header.content-length`.
54-
examples: 3495
55-
- id: http.response_content_length
56-
type: int
57-
brief: 'Deprecated, use `http.response.header.content-length` instead.'
58-
stability: development
59-
deprecated:
60-
reason: uncategorized
61-
note: Replaced by `http.response.header.content-length`.
62-
examples: 3495
63-
- id: http.client_ip
64-
type: string
65-
stability: development
66-
deprecated:
67-
reason: renamed
68-
renamed_to: client.address
69-
brief: "Deprecated, use `client.address` instead."
70-
examples: '83.164.160.102'
71-
- id: http.host
72-
type: string
73-
stability: development
74-
deprecated:
75-
reason: uncategorized
76-
note: >
77-
Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage.
78-
brief: "Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage."
79-
examples: ['www.example.org']
80-
- id: http.request_content_length_uncompressed
81-
stability: development
82-
deprecated:
83-
reason: renamed
84-
renamed_to: http.request.body.size
85-
type: int
86-
brief: "Deprecated, use `http.request.body.size` instead."
87-
examples: 5493
88-
- id: http.response_content_length_uncompressed
89-
stability: development
90-
deprecated:
91-
reason: renamed
92-
renamed_to: http.response.body.size
93-
type: int
94-
brief: "Deprecated, use `http.response.body.size` instead."
95-
examples: 5493
96-
- id: http.server_name
97-
type: string
98-
stability: development
99-
deprecated:
100-
reason: renamed
101-
renamed_to: server.address
102-
brief: "Deprecated, use `server.address` instead."
103-
examples: ['example.com']
104-
- id: http.flavor
105-
type:
106-
members:
107-
- id: http_1_0
108-
value: '1.0'
109-
brief: 'HTTP/1.0'
110-
stability: development
111-
- id: http_1_1
112-
value: '1.1'
113-
brief: 'HTTP/1.1'
114-
stability: development
115-
- id: http_2_0
116-
value: '2.0'
117-
brief: 'HTTP/2'
118-
stability: development
119-
- id: http_3_0
120-
value: '3.0'
121-
brief: 'HTTP/3'
122-
stability: development
123-
- id: spdy
124-
value: 'SPDY'
125-
brief: 'SPDY protocol.'
126-
stability: development
127-
- id: quic
128-
value: 'QUIC'
129-
brief: 'QUIC protocol.'
130-
stability: development
131-
brief: 'Deprecated, use `network.protocol.name` and `network.protocol.version` instead.'
132-
deprecated:
133-
reason: uncategorized
134-
note: "Split into `network.protocol.name` and `network.protocol.version`"
135-
stability: development
136-
- id: http.user_agent
137-
type: string
138-
brief: 'Deprecated, use `user_agent.original` instead.'
139-
examples: ['CERN-LineMode/2.15 libwww/2.17b3',
140-
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1']
141-
deprecated:
142-
reason: renamed
143-
renamed_to: user_agent.original
144-
stability: development
1+
file_format: definition/2
2+
3+
attributes:
4+
- key: http.method
5+
type: string
6+
brief: 'Deprecated, use http.request.method instead.'
7+
stability: development
8+
deprecated:
9+
reason: renamed
10+
renamed_to: http.request.method
11+
examples: ['GET', 'POST', 'HEAD']
12+
- key: http.status_code
13+
type: int
14+
brief: 'Deprecated, use http.response.status_code instead.'
15+
stability: development
16+
deprecated:
17+
reason: renamed
18+
renamed_to: http.response.status_code
19+
examples: [200]
20+
- key: http.scheme
21+
type: string
22+
brief: 'Deprecated, use url.scheme instead.'
23+
stability: development
24+
deprecated:
25+
reason: renamed
26+
renamed_to: url.scheme
27+
examples: ['http', 'https']
28+
- key: http.url
29+
type: string
30+
brief: 'Deprecated, use url.full instead.'
31+
stability: development
32+
deprecated:
33+
reason: renamed
34+
renamed_to: url.full
35+
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv']
36+
- key: http.target
37+
type: string
38+
brief: 'Deprecated, use url.path and url.query instead.'
39+
stability: development
40+
deprecated:
41+
reason: obsoleted
42+
note: Split to url.path and url.query.
43+
examples: ['/search?q=OpenTelemetry#SemConv']
44+
- key: http.request_content_length
45+
type: int
46+
brief: 'Deprecated, use http.request.header.content-length instead.'
47+
stability: development
48+
deprecated:
49+
reason: uncategorized
50+
note: Replaced by http.request.header.content-length.
51+
examples: 3495
52+
- key: http.response_content_length
53+
type: int
54+
brief: 'Deprecated, use http.response.header.content-length instead.'
55+
stability: development
56+
deprecated:
57+
reason: uncategorized
58+
note: Replaced by http.response.header.content-length.
59+
examples: 3495
60+
- key: http.client_ip
61+
type: string
62+
stability: development
63+
deprecated:
64+
reason: renamed
65+
renamed_to: client.address
66+
brief: 'Deprecated, use client.address instead.'
67+
examples: '83.164.160.102'
68+
- key: http.host
69+
type: string
70+
stability: development
71+
deprecated:
72+
reason: uncategorized
73+
note: Replaced by one of server.address, client.address or http.request.header.host.
74+
brief: 'Deprecated, use one of server.address, client.address or http.request.header.host instead.'
75+
examples: ['www.example.org']
76+
- key: http.request_content_length_uncompressed
77+
stability: development
78+
deprecated:
79+
reason: renamed
80+
renamed_to: http.request.body.size
81+
type: int
82+
brief: 'Deprecated, use http.request.body.size instead.'
83+
examples: 5493
84+
- key: http.response_content_length_uncompressed
85+
stability: development
86+
deprecated:
87+
reason: renamed
88+
renamed_to: http.response.body.size
89+
type: int
90+
brief: 'Deprecated, use http.response.body.size instead.'
91+
examples: 5493
92+
- key: http.server_name
93+
type: string
94+
stability: development
95+
deprecated:
96+
reason: renamed
97+
renamed_to: server.address
98+
brief: 'Deprecated, use server.address instead.'
99+
examples: ['example.com']
100+
- key: http.flavor
101+
type:
102+
members:
103+
- id: http_1_0
104+
value: '1.0'
105+
brief: 'HTTP/1.0'
106+
stability: development
107+
- id: http_1_1
108+
value: '1.1'
109+
brief: 'HTTP/1.1'
110+
stability: development
111+
- id: http_2_0
112+
value: '2.0'
113+
brief: 'HTTP/2'
114+
stability: development
115+
- id: http_3_0
116+
value: '3.0'
117+
brief: 'HTTP/3'
118+
stability: development
119+
- id: spdy
120+
value: 'SPDY'
121+
brief: 'SPDY protocol.'
122+
stability: development
123+
- id: quic
124+
value: 'QUIC'
125+
brief: 'QUIC protocol.'
126+
stability: development
127+
brief: 'Deprecated, use network.protocol.name and network.protocol.version instead.'
128+
deprecated:
129+
reason: uncategorized
130+
note: Split into network.protocol.name and network.protocol.version
131+
stability: development
132+
- key: http.user_agent
133+
type: string
134+
brief: 'Deprecated, use user_agent.original instead.'
135+
examples: ['CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X)']
136+
deprecated:
137+
reason: renamed
138+
renamed_to: user_agent.original
139+
stability: development

0 commit comments

Comments
 (0)