Skip to content

Commit c542d87

Browse files
fix(http): fully migrate to v2 schema and address reviewer feedback
1 parent 84f4b2b commit c542d87

7 files changed

Lines changed: 473 additions & 574 deletions

File tree

.chloggen/migrate-http-v2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: enhancement
2+
component: http
3+
note: Migrate HTTP semantic conventions to Weaver v2 schema
4+
issues: [3809]

model/http/common.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
file_format: definition/2
2-
32
attribute_groups:
43
- id: attributes.http.common
5-
visibility: public
6-
stability: development
74
brief: "Describes HTTP attributes."
85
attributes:
96
- ref: http.request.method
@@ -40,11 +37,9 @@ attribute_groups:
4037
examples: ['1.0', '1.1', '2', '3']
4138

4239
- id: attributes.http.client
43-
visibility: public
44-
stability: development
4540
brief: 'HTTP Client attributes'
41+
extends: attributes.http.common
4642
attributes:
47-
- ref_group: attributes.http.common
4843
- ref: server.address
4944
requirement_level: required
5045
note: |
@@ -72,11 +67,9 @@ attribute_groups:
7267
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.
7368
7469
- id: attributes.http.server
75-
visibility: public
76-
stability: development
7770
brief: 'HTTP Server attributes'
71+
extends: attributes.http.common
7872
attributes:
79-
- ref_group: attributes.http.common
8073
- ref: http.route
8174
requirement_level:
8275
conditionally_required: If and only if it's available
Lines changed: 143 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,144 @@
11
file_format: definition/2
2-
3-
attributes:
4-
- key: http.method
5-
type: string
6-
stability: development
7-
deprecated:
8-
reason: renamed
9-
renamed_to: http.request.method
10-
note: 'Replaced by `http.request.method`.'
11-
brief: 'Deprecated, use `http.request.method` instead.'
12-
examples: ["GET", "POST", "HEAD"]
13-
14-
- key: http.status_code
15-
type: int
16-
stability: development
17-
deprecated:
18-
reason: renamed
19-
renamed_to: http.response.status_code
20-
note: 'Replaced by `http.response.status_code`.'
21-
brief: 'Deprecated, use `http.response.status_code` instead.'
22-
examples: [200]
23-
24-
- key: http.scheme
25-
type: string
26-
stability: development
27-
deprecated:
28-
reason: renamed
29-
renamed_to: url.scheme
30-
note: 'Replaced by `url.scheme`.'
31-
brief: 'Deprecated, use `url.scheme` instead.'
32-
examples: ['http', 'https']
33-
34-
- key: http.url
35-
type: string
36-
stability: development
37-
deprecated:
38-
reason: renamed
39-
renamed_to: url.full
40-
note: 'Replaced by `url.full`.'
41-
brief: 'Deprecated, use `url.full` instead.'
42-
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv']
43-
44-
- key: http.target
45-
type: string
46-
stability: development
47-
deprecated:
48-
reason: obsoleted
49-
note: Split to `url.path` and `url.query`.
50-
brief: 'Deprecated, use `url.path` and `url.query` instead.'
51-
examples: ['/search?q=OpenTelemetry#SemConv']
52-
53-
- key: http.request_content_length
54-
type: int
55-
stability: development
56-
deprecated:
57-
reason: uncategorized
58-
note: Replaced by `http.request.header.content-length`.
59-
brief: 'Deprecated, use `http.request.header.content-length` instead.'
60-
examples: 3495
61-
62-
- key: http.response_content_length
63-
type: int
64-
stability: development
65-
deprecated:
66-
reason: uncategorized
67-
note: Replaced by `http.response.header.content-length`.
68-
brief: 'Deprecated, use `http.response.header.content-length` instead.'
69-
examples: 3495
70-
71-
- key: http.client_ip
72-
type: string
73-
stability: development
74-
deprecated:
75-
reason: renamed
76-
renamed_to: client.address
77-
note: 'Replaced by `client.address`.'
78-
brief: "Deprecated, use `client.address` instead."
79-
examples: '83.164.160.102'
80-
81-
- key: http.host
82-
type: string
83-
stability: development
84-
deprecated:
85-
reason: uncategorized
86-
note: >
87-
Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage.
88-
brief: "Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage."
89-
examples: ['www.example.org']
90-
91-
- key: http.request_content_length_uncompressed
92-
type: int
93-
stability: development
94-
deprecated:
95-
reason: renamed
96-
renamed_to: http.request.body.size
97-
note: 'Replaced by `http.request.body.size`.'
98-
brief: "Deprecated, use `http.request.body.size` instead."
99-
examples: 5493
100-
101-
- key: http.response_content_length_uncompressed
102-
type: int
103-
stability: development
104-
deprecated:
105-
reason: renamed
106-
renamed_to: http.response.body.size
107-
note: 'Replaced by `http.response.body.size`.'
108-
brief: "Deprecated, use `http.response.body.size` instead."
109-
examples: 5493
110-
111-
- key: http.server_name
112-
type: string
113-
stability: development
114-
deprecated:
115-
reason: renamed
116-
renamed_to: server.address
117-
note: 'Replaced by `server.address`.'
118-
brief: "Deprecated, use `server.address` instead."
119-
examples: ['example.com']
120-
121-
- key: http.flavor
122-
stability: development
123-
deprecated:
124-
reason: uncategorized
125-
note: "Split into `network.protocol.name` and `network.protocol.version`"
126-
type:
127-
members:
128-
- id: http_1_0
129-
value: '1.0'
130-
brief: 'HTTP/1.0'
131-
stability: development
132-
- id: http_1_1
133-
value: '1.1'
134-
brief: 'HTTP/1.1'
135-
stability: development
136-
- id: http_2_0
137-
value: '2.0'
138-
brief: 'HTTP/2'
139-
stability: development
140-
- id: http_3_0
141-
value: '3.0'
142-
brief: 'HTTP/3'
143-
stability: development
144-
- id: spdy
145-
value: 'SPDY'
146-
brief: 'SPDY protocol.'
147-
stability: development
148-
- id: quic
149-
value: 'QUIC'
150-
brief: 'QUIC protocol.'
151-
stability: development
152-
brief: 'Deprecated, use `network.protocol.name` and `network.protocol.version` instead.'
153-
154-
- key: http.user_agent
155-
type: string
156-
stability: development
157-
deprecated:
158-
reason: renamed
159-
renamed_to: user_agent.original
160-
note: 'Replaced by `user_agent.original`.'
161-
brief: 'Deprecated, use `user_agent.original` instead.'
162-
examples:
163-
- 'CERN-LineMode/2.15 libwww/2.17b3'
164-
- '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'
2+
attribute_groups:
3+
- id: registry.http.deprecated
4+
display_name: Deprecated HTTP Attributes
5+
brief: "Describes deprecated HTTP attributes."
6+
attributes:
7+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: 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+
- key: http.flavor
105+
type:
106+
members:
107+
- key: http_1_0
108+
value: '1.0'
109+
brief: 'HTTP/1.0'
110+
stability: development
111+
- key: http_1_1
112+
value: '1.1'
113+
brief: 'HTTP/1.1'
114+
stability: development
115+
- key: http_2_0
116+
value: '2.0'
117+
brief: 'HTTP/2'
118+
stability: development
119+
- key: http_3_0
120+
value: '3.0'
121+
brief: 'HTTP/3'
122+
stability: development
123+
- key: spdy
124+
value: 'SPDY'
125+
brief: 'SPDY protocol.'
126+
stability: development
127+
- key: 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+
- key: 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

model/http/events.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
file_format: definition/2
22
events:
3-
- name: http.client.request.exception
3+
- id: event.http.client.request.exception
4+
name: http.client.request.exception
45
stability: development
56
brief: >
67
This event represents an exception that occurred during an HTTP client request,
78
such as network failures, timeouts, or other errors that prevent the request
89
from completing successfully.
910
note: >
1011
This event SHOULD be recorded when an exception occurs during HTTP client operations.
12+
1113
Instrumentations SHOULD set the severity to WARN (severity number 13) when recording this event.
14+
1215
Some HTTP client frameworks generate artificial exceptions for non-successful HTTP status codes
1316
(e.g., 404 Not Found). When possible, instrumentations SHOULD NOT record these artificial
1417
exceptions, or SHOULD set the severity to DEBUG (severity number 5).
18+
1519
Instrumentations MAY provide a configuration option to populate exception events
1620
with the attributes captured on the corresponding HTTP client span.
1721
attributes:
@@ -22,15 +26,19 @@ events:
2226
requirement_level:
2327
conditionally_required: Required if `exception.type` is not set, recommended otherwise.
2428
- ref: exception.stacktrace
25-
- name: http.server.request.exception
29+
30+
- id: event.http.server.request.exception
31+
name: http.server.request.exception
2632
stability: development
2733
brief: >
2834
This event represents an exception that occurred during HTTP server request processing,
2935
such as application errors, internal failures, or other exceptions that prevent
3036
the server from successfully handling the request.
3137
note: >
3238
This event SHOULD be recorded when an exception occurs during HTTP server request processing.
39+
3340
Instrumentations SHOULD set the severity to ERROR (severity number 17) when recording this event.
41+
3442
Instrumentations MAY provide a configuration option to populate exception events
3543
with the attributes captured on the corresponding HTTP server span.
3644
attributes:

0 commit comments

Comments
 (0)