Skip to content

Commit d922b76

Browse files
authored
New semconvgen template and update to semconv 1.25.0 (#3586)
1 parent 52abb61 commit d922b76

File tree

81 files changed

+6423
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6423
-414
lines changed

CHANGELOG.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
([#3785](https://github.com/open-telemetry/opentelemetry-python/pull/3785))
2222
- Add capture the fully qualified type name for raised exceptions in spans
2323
([#3837](https://github.com/open-telemetry/opentelemetry-python/pull/3837))
24-
- Prometheus exporter sort label keys to prevent duplicate metrics when user input changes order
24+
- Prometheus exporter sort label keys to prevent duplicate metrics when user input changes order
2525
([#3698](https://github.com/open-telemetry/opentelemetry-python/pull/3698))
26+
- Update semantic conventions to version 1.25.0.
27+
Refactor semantic-convention structure:
28+
- `SpanAttributes`, `ResourceAttributes`, and `MetricInstruments` are deprecated.
29+
- Attribute and metric definitions are now grouped by the namespace.
30+
- Stable attributes and metrics are moved to `opentelemetry.semconv.attributes`
31+
and `opentelemetry.semconv.metrics` modules.
32+
- Stable and experimental attributes and metrics are defined under
33+
`opentelemetry.semconv._incubating` import path.
34+
([#3586](https://github.com/open-telemetry/opentelemetry-python/pull/3586))
2635

2736
## Version 1.24.0/0.45b0 (2024-03-28)
2837

@@ -67,7 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6776
([#3564](https://github.com/open-telemetry/opentelemetry-python/pull/3564))
6877
- Fix explicit bucket histogram aggregation
6978
([#3429](https://github.com/open-telemetry/opentelemetry-python/pull/3429))
70-
- Add `code.lineno`, `code.function` and `code.filepath` to all logs
79+
- Add `code.lineno`, `code.function` and `code.filepath` to all logs
7180
([#3675](https://github.com/open-telemetry/opentelemetry-python/pull/3675))
7281
- Add Synchronous Gauge instrument
7382
([#3462](https://github.com/open-telemetry/opentelemetry-python/pull/3462))
@@ -92,7 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92101
([#3572](https://github.com/open-telemetry/opentelemetry-python/pull/3572))
93102
- Remove Jaeger exporters
94103
([#3554](https://github.com/open-telemetry/opentelemetry-python/pull/3554))
95-
- Log stacktrace on `UNKNOWN` status OTLP export error
104+
- Log stacktrace on `UNKNOWN` status OTLP export error
96105
([#3536](https://github.com/open-telemetry/opentelemetry-python/pull/3536))
97106
- Fix OTLPExporterMixin shutdown timeout period
98107
([#3524](https://github.com/open-telemetry/opentelemetry-python/pull/3524))
@@ -117,7 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
117126
([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251))
118127
- Add missing schema_url in global api for logging and metrics
119128
([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251))
120-
- Prometheus exporter support for auto instrumentation
129+
- Prometheus exporter support for auto instrumentation
121130
([#3413](https://github.com/open-telemetry/opentelemetry-python/pull/3413))
122131
- Implement Process Resource detector
123132
([#3472](https://github.com/open-telemetry/opentelemetry-python/pull/3472))
@@ -1500,7 +1509,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15001509
([#3564](https://github.com/open-telemetry/opentelemetry-python/pull/3564))
15011510
- Fix explicit bucket histogram aggregation
15021511
([#3429](https://github.com/open-telemetry/opentelemetry-python/pull/3429))
1503-
- Add `code.lineno`, `code.function` and `code.filepath` to all logs
1512+
- Add `code.lineno`, `code.function` and `code.filepath` to all logs
15041513
([#3645](https://github.com/open-telemetry/opentelemetry-python/pull/3645))
15051514
- Add Synchronous Gauge instrument
15061515
([#3462](https://github.com/open-telemetry/opentelemetry-python/pull/3462))

opentelemetry-semantic-conventions/pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ classifiers = [
2424
"Programming Language :: Python :: 3.11",
2525
]
2626

27+
dependencies = [
28+
"opentelemetry-api == 1.25.0.dev",
29+
]
30+
2731
[project.urls]
2832
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-semantic-conventions"
2933

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from enum import Enum
17+
18+
AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"
19+
"""
20+
The JSON-serialized value of each item in the `AttributeDefinitions` request field.
21+
"""
22+
23+
AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"
24+
"""
25+
The value of the `AttributesToGet` request parameter.
26+
"""
27+
28+
AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"
29+
"""
30+
The value of the `ConsistentRead` request parameter.
31+
"""
32+
33+
AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"
34+
"""
35+
The JSON-serialized value of each item in the `ConsumedCapacity` response field.
36+
"""
37+
38+
AWS_DYNAMODB_COUNT = "aws.dynamodb.count"
39+
"""
40+
The value of the `Count` response parameter.
41+
"""
42+
43+
AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"
44+
"""
45+
The value of the `ExclusiveStartTableName` request parameter.
46+
"""
47+
48+
AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = (
49+
"aws.dynamodb.global_secondary_index_updates"
50+
)
51+
"""
52+
The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field.
53+
"""
54+
55+
AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes"
56+
"""
57+
The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.
58+
"""
59+
60+
AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"
61+
"""
62+
The value of the `IndexName` request parameter.
63+
"""
64+
65+
AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics"
66+
"""
67+
The JSON-serialized value of the `ItemCollectionMetrics` response field.
68+
"""
69+
70+
AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"
71+
"""
72+
The value of the `Limit` request parameter.
73+
"""
74+
75+
AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes"
76+
"""
77+
The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.
78+
"""
79+
80+
AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"
81+
"""
82+
The value of the `ProjectionExpression` request parameter.
83+
"""
84+
85+
AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = (
86+
"aws.dynamodb.provisioned_read_capacity"
87+
)
88+
"""
89+
The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
90+
"""
91+
92+
AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = (
93+
"aws.dynamodb.provisioned_write_capacity"
94+
)
95+
"""
96+
The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.
97+
"""
98+
99+
AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"
100+
"""
101+
The value of the `ScanIndexForward` request parameter.
102+
"""
103+
104+
AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"
105+
"""
106+
The value of the `ScannedCount` response parameter.
107+
"""
108+
109+
AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"
110+
"""
111+
The value of the `Segment` request parameter.
112+
"""
113+
114+
AWS_DYNAMODB_SELECT = "aws.dynamodb.select"
115+
"""
116+
The value of the `Select` request parameter.
117+
"""
118+
119+
AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"
120+
"""
121+
The number of items in the `TableNames` response parameter.
122+
"""
123+
124+
AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"
125+
"""
126+
The keys in the `RequestItems` object field.
127+
"""
128+
129+
AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"
130+
"""
131+
The value of the `TotalSegments` request parameter.
132+
"""
133+
134+
AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"
135+
"""
136+
The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
137+
"""
138+
139+
AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"
140+
"""
141+
The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
142+
"""
143+
144+
AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"
145+
"""
146+
The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.
147+
"""
148+
149+
AWS_ECS_TASK_ARN = "aws.ecs.task.arn"
150+
"""
151+
The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
152+
"""
153+
154+
AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"
155+
"""
156+
The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task.
157+
"""
158+
159+
AWS_ECS_TASK_ID = "aws.ecs.task.id"
160+
"""
161+
The ID of a running ECS task. The ID MUST be extracted from `task.arn`.
162+
"""
163+
164+
AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"
165+
"""
166+
The revision for the task definition used to create the ECS task.
167+
"""
168+
169+
AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"
170+
"""
171+
The ARN of an EKS cluster.
172+
"""
173+
174+
AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"
175+
"""
176+
The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
177+
Note: This may be different from `cloud.resource_id` if an alias is involved.
178+
"""
179+
180+
AWS_LOG_GROUP_ARNS = "aws.log.group.arns"
181+
"""
182+
The Amazon Resource Name(s) (ARN) of the AWS log group(s).
183+
Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
184+
"""
185+
186+
AWS_LOG_GROUP_NAMES = "aws.log.group.names"
187+
"""
188+
The name(s) of the AWS log group(s) an application is writing to.
189+
Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.
190+
"""
191+
192+
AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"
193+
"""
194+
The ARN(s) of the AWS log stream(s).
195+
Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.
196+
"""
197+
198+
AWS_LOG_STREAM_NAMES = "aws.log.stream.names"
199+
"""
200+
The name(s) of the AWS log stream(s) an application is writing to.
201+
"""
202+
203+
AWS_REQUEST_ID = "aws.request_id"
204+
"""
205+
The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
206+
"""
207+
208+
AWS_S3_BUCKET = "aws.s3.bucket"
209+
"""
210+
The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.
211+
Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter.
212+
This applies to almost all S3 operations except `list-buckets`.
213+
"""
214+
215+
AWS_S3_COPY_SOURCE = "aws.s3.copy_source"
216+
"""
217+
The source object (in the form `bucket`/`key`) for the copy operation.
218+
Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter
219+
of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
220+
This applies in particular to the following operations:
221+
222+
- [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
223+
- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html).
224+
"""
225+
226+
AWS_S3_DELETE = "aws.s3.delete"
227+
"""
228+
The delete request container that specifies the objects to be deleted.
229+
Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation.
230+
The `delete` attribute corresponds to the `--delete` parameter of the
231+
[delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
232+
"""
233+
234+
AWS_S3_KEY = "aws.s3.key"
235+
"""
236+
The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.
237+
Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter.
238+
This applies in particular to the following operations:
239+
240+
- [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
241+
- [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
242+
- [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
243+
- [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
244+
- [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
245+
- [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
246+
- [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
247+
- [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
248+
- [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
249+
- [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
250+
- [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
251+
- [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
252+
- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html).
253+
"""
254+
255+
AWS_S3_PART_NUMBER = "aws.s3.part_number"
256+
"""
257+
The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.
258+
Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
259+
and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations.
260+
The `part_number` attribute corresponds to the `--part-number` parameter of the
261+
[upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
262+
"""
263+
264+
AWS_S3_UPLOAD_ID = "aws.s3.upload_id"
265+
"""
266+
Upload ID that identifies the multipart upload.
267+
Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter
268+
of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations.
269+
This applies in particular to the following operations:
270+
271+
- [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
272+
- [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
273+
- [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
274+
- [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
275+
- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html).
276+
"""
277+
278+
279+
class AwsEcsLaunchtypeValues(Enum):
280+
EC2 = "ec2"
281+
"""ec2."""
282+
FARGATE = "fargate"
283+
"""fargate."""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
BROWSER_BRANDS = "browser.brands"
17+
"""
18+
Array of brand name and version separated by a space.
19+
Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
20+
"""
21+
22+
BROWSER_LANGUAGE = "browser.language"
23+
"""
24+
Preferred language of the user using the browser.
25+
Note: This value is intended to be taken from the Navigator API `navigator.language`.
26+
"""
27+
28+
BROWSER_MOBILE = "browser.mobile"
29+
"""
30+
A boolean that is true if the browser is running on a mobile device.
31+
Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset.
32+
"""
33+
34+
BROWSER_PLATFORM = "browser.platform"
35+
"""
36+
The platform on which the browser is running.
37+
Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent.
38+
The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
39+
"""

0 commit comments

Comments
 (0)