Skip to content

Commit 0bb3cdd

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

7 files changed

Lines changed: 180 additions & 255 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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ file_format: definition/2
22

33
attribute_groups:
44
- id: attributes.http.common
5-
visibility: public
6-
stability: development
7-
brief: "Describes HTTP attributes."
5+
visibility: internal
86
attributes:
97
- ref: http.request.method
108
requirement_level: required
@@ -40,9 +38,7 @@ attribute_groups:
4038
examples: ['1.0', '1.1', '2', '3']
4139

4240
- id: attributes.http.client
43-
visibility: public
44-
stability: development
45-
brief: 'HTTP Client attributes'
41+
visibility: internal
4642
attributes:
4743
- ref_group: attributes.http.common
4844
- ref: server.address
@@ -72,9 +68,7 @@ attribute_groups:
7268
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.
7369
7470
- id: attributes.http.server
75-
visibility: public
76-
stability: development
77-
brief: 'HTTP Server attributes'
71+
visibility: internal
7872
attributes:
7973
- ref_group: attributes.http.common
8074
- ref: http.route

model/http/deprecated/registry-deprecated.yaml

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,81 +3,73 @@ file_format: definition/2
33
attributes:
44
- key: http.method
55
type: string
6+
brief: 'Deprecated, use `http.request.method` instead.'
67
stability: development
78
deprecated:
89
reason: renamed
910
renamed_to: http.request.method
10-
note: 'Replaced by `http.request.method`.'
11-
brief: 'Deprecated, use `http.request.method` instead.'
11+
note: "Replaced by http.request.method."
1212
examples: ["GET", "POST", "HEAD"]
13-
1413
- key: http.status_code
1514
type: int
15+
brief: 'Deprecated, use `http.response.status_code` instead.'
1616
stability: development
1717
deprecated:
1818
reason: renamed
1919
renamed_to: http.response.status_code
20-
note: 'Replaced by `http.response.status_code`.'
21-
brief: 'Deprecated, use `http.response.status_code` instead.'
20+
note: "Replaced by http.response.status_code."
2221
examples: [200]
23-
2422
- key: http.scheme
2523
type: string
24+
brief: 'Deprecated, use `url.scheme` instead.'
2625
stability: development
2726
deprecated:
2827
reason: renamed
2928
renamed_to: url.scheme
30-
note: 'Replaced by `url.scheme`.'
31-
brief: 'Deprecated, use `url.scheme` instead.'
29+
note: "Replaced by url.scheme."
3230
examples: ['http', 'https']
33-
3431
- key: http.url
3532
type: string
33+
brief: 'Deprecated, use `url.full` instead.'
3634
stability: development
3735
deprecated:
3836
reason: renamed
3937
renamed_to: url.full
40-
note: 'Replaced by `url.full`.'
41-
brief: 'Deprecated, use `url.full` instead.'
38+
note: "Replaced by url.full."
4239
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv']
43-
4440
- key: http.target
4541
type: string
42+
brief: 'Deprecated, use `url.path` and `url.query` instead.'
4643
stability: development
4744
deprecated:
4845
reason: obsoleted
4946
note: Split to `url.path` and `url.query`.
50-
brief: 'Deprecated, use `url.path` and `url.query` instead.'
5147
examples: ['/search?q=OpenTelemetry#SemConv']
52-
5348
- key: http.request_content_length
5449
type: int
50+
brief: 'Deprecated, use `http.request.header.content-length` instead.'
5551
stability: development
5652
deprecated:
5753
reason: uncategorized
5854
note: Replaced by `http.request.header.content-length`.
59-
brief: 'Deprecated, use `http.request.header.content-length` instead.'
6055
examples: 3495
61-
6256
- key: http.response_content_length
6357
type: int
58+
brief: 'Deprecated, use `http.response.header.content-length` instead.'
6459
stability: development
6560
deprecated:
6661
reason: uncategorized
6762
note: Replaced by `http.response.header.content-length`.
68-
brief: 'Deprecated, use `http.response.header.content-length` instead.'
6963
examples: 3495
70-
7164
- key: http.client_ip
7265
type: string
7366
stability: development
7467
deprecated:
7568
reason: renamed
7669
renamed_to: client.address
77-
note: 'Replaced by `client.address`.'
70+
note: "Replaced by client.address."
7871
brief: "Deprecated, use `client.address` instead."
7972
examples: '83.164.160.102'
80-
8173
- key: http.host
8274
type: string
8375
stability: development
@@ -87,42 +79,34 @@ attributes:
8779
Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage.
8880
brief: "Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage."
8981
examples: ['www.example.org']
90-
9182
- key: http.request_content_length_uncompressed
92-
type: int
9383
stability: development
9484
deprecated:
9585
reason: renamed
9686
renamed_to: http.request.body.size
97-
note: 'Replaced by `http.request.body.size`.'
87+
note: "Replaced by http.request.body.size."
88+
type: int
9889
brief: "Deprecated, use `http.request.body.size` instead."
9990
examples: 5493
100-
10191
- key: http.response_content_length_uncompressed
102-
type: int
10392
stability: development
10493
deprecated:
10594
reason: renamed
10695
renamed_to: http.response.body.size
107-
note: 'Replaced by `http.response.body.size`.'
96+
note: "Replaced by http.response.body.size."
97+
type: int
10898
brief: "Deprecated, use `http.response.body.size` instead."
10999
examples: 5493
110-
111100
- key: http.server_name
112101
type: string
113102
stability: development
114103
deprecated:
115104
reason: renamed
116105
renamed_to: server.address
117-
note: 'Replaced by `server.address`.'
106+
note: "Replaced by server.address."
118107
brief: "Deprecated, use `server.address` instead."
119108
examples: ['example.com']
120-
121109
- key: http.flavor
122-
stability: development
123-
deprecated:
124-
reason: uncategorized
125-
note: "Split into `network.protocol.name` and `network.protocol.version`"
126110
type:
127111
members:
128112
- id: http_1_0
@@ -150,15 +134,17 @@ attributes:
150134
brief: 'QUIC protocol.'
151135
stability: development
152136
brief: 'Deprecated, use `network.protocol.name` and `network.protocol.version` instead.'
153-
137+
deprecated:
138+
reason: uncategorized
139+
note: "Split into `network.protocol.name` and `network.protocol.version`"
140+
stability: development
154141
- key: http.user_agent
155142
type: string
156-
stability: development
143+
brief: 'Deprecated, use `user_agent.original` instead.'
144+
examples: ['CERN-LineMode/2.15 libwww/2.17b3',
145+
'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']
157146
deprecated:
158147
reason: renamed
159148
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'
149+
note: "Replaced by user_agent.original."
150+
stability: development

model/http/events.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
file_format: definition/2
2-
events:
3-
- name: http.client.request.exception
2+
3+
groups:
4+
- id: event.http.client.request.exception
5+
name: http.client.request.exception
46
stability: development
7+
type: event
58
brief: >
69
This event represents an exception that occurred during an HTTP client request,
710
such as network failures, timeouts, or other errors that prevent the request
811
from completing successfully.
912
note: >
1013
This event SHOULD be recorded when an exception occurs during HTTP client operations.
14+
1115
Instrumentations SHOULD set the severity to WARN (severity number 13) when recording this event.
16+
1217
Some HTTP client frameworks generate artificial exceptions for non-successful HTTP status codes
1318
(e.g., 404 Not Found). When possible, instrumentations SHOULD NOT record these artificial
1419
exceptions, or SHOULD set the severity to DEBUG (severity number 5).
20+
1521
Instrumentations MAY provide a configuration option to populate exception events
1622
with the attributes captured on the corresponding HTTP client span.
1723
attributes:
@@ -22,15 +28,20 @@ events:
2228
requirement_level:
2329
conditionally_required: Required if `exception.type` is not set, recommended otherwise.
2430
- ref: exception.stacktrace
25-
- name: http.server.request.exception
31+
32+
- id: event.http.server.request.exception
33+
name: http.server.request.exception
2634
stability: development
35+
type: event
2736
brief: >
2837
This event represents an exception that occurred during HTTP server request processing,
2938
such as application errors, internal failures, or other exceptions that prevent
3039
the server from successfully handling the request.
3140
note: >
3241
This event SHOULD be recorded when an exception occurs during HTTP server request processing.
42+
3343
Instrumentations SHOULD set the severity to ERROR (severity number 17) when recording this event.
44+
3445
Instrumentations MAY provide a configuration option to populate exception events
3546
with the attributes captured on the corresponding HTTP server span.
3647
attributes:

0 commit comments

Comments
 (0)