Skip to content

Commit 56d2f2f

Browse files
committed
Bump semantic conventions to 1.32.0
1 parent 23d7d8b commit 56d2f2f

15 files changed

+479
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
from typing import Final
16+
17+
APP_INSTALLATION_ID: Final = "app.installation.id"
18+
"""
19+
A unique identifier representing the installation of an application on a specific device.
20+
Note: Its value SHOULD persist across launches of the same application installation, including through application upgrades.
21+
It SHOULD change if the application is uninstalled or if all applications of the vendor are uninstalled.
22+
Additionally, users might be able to reset this value (e.g. by clearing application data).
23+
If an app is installed multiple times on the same device (e.g. in different accounts on Android), each `app.installation.id` SHOULD have a different value.
24+
If multiple OpenTelemetry SDKs are used within the same application, they SHOULD use the same value for `app.installation.id`.
25+
Hardware IDs (e.g. serial number, IMEI, MAC address) MUST NOT be used as the `app.installation.id`.
26+
27+
For iOS, this value SHOULD be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/identifierforvendor).
28+
29+
For Android, examples of `app.installation.id` implementations include:
30+
31+
- [Firebase Installation ID](https://firebase.google.com/docs/projects/manage-installations).
32+
- A globally unique UUID which is persisted across sessions in your application.
33+
- [App set ID](https://developer.android.com/identity/app-set-id).
34+
- [`Settings.getString(Settings.Secure.ANDROID_ID)`](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID).
35+
36+
More information about Android identifier best practices can be found [here](https://developer.android.com/training/articles/user-data-ids).
37+
"""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* Java method: `com.example.MyHttpService.serveRequest`
5252
* Java anonymous class method: `com.mycompany.Main$1.myMethod`
5353
* Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`
54-
* PHP function: `GuzzleHttp\\Client::transfer
54+
* PHP function: `GuzzleHttp\\Client::transfer`
5555
* Go function: `github.com/my/repo/pkg.foo.func5`
5656
* Elixir: `OpenTelemetry.Ctx.new`
5757
* Erlang: `opentelemetry_ctx:new`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
from enum import Enum
16+
from typing import Final
17+
18+
CPYTHON_GC_GENERATION: Final = "cpython.gc.generation"
19+
"""
20+
Value of the garbage collector collection generation.
21+
"""
22+
23+
24+
class CpythonGcGenerationValues(Enum):
25+
GENERATION_0 = 0
26+
"""Generation 0."""
27+
GENERATION_1 = 1
28+
"""Generation 1."""
29+
GENERATION_2 = 2
30+
"""Generation 2."""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@
212212
The operation name SHOULD NOT be extracted from `db.query.text`,
213213
when the database system supports cross-table queries in non-batch operations.
214214
215+
If spaces can occur in the operation name, multiple consecutive spaces
216+
SHOULD be normalized to a single space.
217+
215218
For batch operations, if the individual operations are known to have the same operation name
216219
then that operation name SHOULD be used prepended by `BATCH `,
217220
otherwise `db.operation.name` SHOULD be `BATCH` or some other database
@@ -223,6 +226,7 @@
223226
A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
224227
Note: If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
225228
If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD match up with the parameterized placeholders present in `db.query.text`.
229+
`db.operation.parameter.<key>` SHOULD NOT be captured on batch operations.
226230
"""
227231

228232
DB_QUERY_PARAMETER_TEMPLATE: Final = "db.query.parameter"
@@ -264,14 +268,24 @@
264268

265269
DB_SQL_TABLE: Final = "db.sql.table"
266270
"""
267-
Deprecated: Replaced by `db.collection.name`.
271+
Deprecated: Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`.
268272
"""
269273

270274
DB_STATEMENT: Final = "db.statement"
271275
"""
272276
Deprecated: Replaced by `db.query.text`.
273277
"""
274278

279+
DB_STORED_PROCEDURE_NAME: Final = "db.stored_procedure.name"
280+
"""
281+
The name of a stored procedure within the database.
282+
Note: It is RECOMMENDED to capture the value as provided by the application
283+
without attempting to do any case normalization.
284+
285+
For batch operations, if the individual operations are known to have the same
286+
stored procedure name then that stored procedure name SHOULD be used.
287+
"""
288+
275289
DB_SYSTEM: Final = "db.system"
276290
"""
277291
Deprecated: Replaced by `db.system.name`.

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,22 @@
1717
DEVICE_ID: Final = "device.id"
1818
"""
1919
A unique identifier representing the device.
20-
Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.
20+
Note: Its value SHOULD be identical for all apps on a device and it SHOULD NOT change if an app is uninstalled and re-installed.
21+
However, it might be resettable by the user for all apps on a device.
22+
Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be used as values.
23+
24+
More information about Android identifier best practices can be found [here](https://developer.android.com/training/articles/user-data-ids).
25+
26+
> [!WARNING]
27+
>
28+
> This attribute may contain sensitive (PII) information. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply,
29+
> ensure you do your own due diligence.
30+
>
31+
> Due to these reasons, this identifier is not recommended for consumer applications and will likely result in rejection from both Google Play and App Store.
32+
> However, it may be appropriate for specific enterprise scenarios, such as kiosk devices or enterprise-managed devices, with appropriate compliance clearance.
33+
> Any instrumentation providing this identifier MUST implement it as an opt-in feature.
34+
>
35+
> See [`app.installation.id`](/docs/attributes-registry/app.md#app-installation-id) for a more privacy-preserving alternative.
2136
"""
2237

2338
DEVICE_MANUFACTURER: Final = "device.manufacturer"

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717

1818
from deprecated import deprecated
1919

20+
ERROR_MESSAGE: Final = "error.message"
21+
"""
22+
A message providing more detail about an error in human-readable form.
23+
Note: `error.message` should provide additional context and detail about an error.
24+
It is NOT RECOMMENDED to duplicate the value of `error.type` in `error.message`.
25+
It is also NOT RECOMMENDED to duplicate the value of `exception.message` in `error.message`.
26+
27+
`error.message` is NOT RECOMMENDED for metrics or spans due to its unbounded cardinality and overlap with span status.
28+
"""
29+
2030
ERROR_TYPE: Final = "error.type"
2131
"""
2232
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`.

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py

+40-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from enum import Enum
1616
from typing import Final
1717

18+
from deprecated import deprecated
19+
1820
FEATURE_FLAG_CONTEXT_ID: Final = "feature_flag.context.id"
1921
"""
2022
The unique identifier for the flag evaluation context. For example, the targeting key.
@@ -29,7 +31,7 @@
2931

3032
FEATURE_FLAG_EVALUATION_REASON: Final = "feature_flag.evaluation.reason"
3133
"""
32-
The reason code which shows how a feature flag value was determined.
34+
Deprecated: Replaced by `feature_flag.result.reason`.
3335
"""
3436

3537
FEATURE_FLAG_KEY: Final = "feature_flag.key"
@@ -42,12 +44,12 @@
4244
Identifies the feature flag provider.
4345
"""
4446

45-
FEATURE_FLAG_SET_ID: Final = "feature_flag.set.id"
47+
FEATURE_FLAG_RESULT_REASON: Final = "feature_flag.result.reason"
4648
"""
47-
The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) to which the feature flag belongs.
49+
The reason code which shows how a feature flag value was determined.
4850
"""
4951

50-
FEATURE_FLAG_VARIANT: Final = "feature_flag.variant"
52+
FEATURE_FLAG_RESULT_VARIANT: Final = "feature_flag.result.variant"
5153
"""
5254
A semantic identifier for an evaluated flag value.
5355
Note: A semantic identifier, commonly referred to as a variant, provides a means
@@ -56,12 +58,25 @@
5658
For example, the variant `red` maybe be used for the value `#c05543`.
5759
"""
5860

61+
FEATURE_FLAG_SET_ID: Final = "feature_flag.set.id"
62+
"""
63+
The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) to which the feature flag belongs.
64+
"""
65+
66+
FEATURE_FLAG_VARIANT: Final = "feature_flag.variant"
67+
"""
68+
Deprecated: Replaced by `feature_flag.result.variant`.
69+
"""
70+
5971
FEATURE_FLAG_VERSION: Final = "feature_flag.version"
6072
"""
6173
The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset.
6274
"""
6375

6476

77+
@deprecated(
78+
reason="The attribute feature_flag.evaluation.reason is deprecated - Replaced by `feature_flag.result.reason`"
79+
) # type: ignore
6580
class FeatureFlagEvaluationReasonValues(Enum):
6681
STATIC = "static"
6782
"""The resolved value is static (no dynamic evaluation)."""
@@ -81,3 +96,24 @@ class FeatureFlagEvaluationReasonValues(Enum):
8196
"""The resolved value is non-authoritative or possibly out of date."""
8297
ERROR = "error"
8398
"""The resolved value was the result of an error."""
99+
100+
101+
class FeatureFlagResultReasonValues(Enum):
102+
STATIC = "static"
103+
"""The resolved value is static (no dynamic evaluation)."""
104+
DEFAULT = "default"
105+
"""The resolved value fell back to a pre-configured value (no dynamic evaluation occurred or dynamic evaluation yielded no result)."""
106+
TARGETING_MATCH = "targeting_match"
107+
"""The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting."""
108+
SPLIT = "split"
109+
"""The resolved value was the result of pseudorandom assignment."""
110+
CACHED = "cached"
111+
"""The resolved value was retrieved from cache."""
112+
DISABLED = "disabled"
113+
"""The resolved value was the result of the flag being disabled in the management system."""
114+
UNKNOWN = "unknown"
115+
"""The reason for the resolved value could not be determined."""
116+
STALE = "stale"
117+
"""The resolved value is non-authoritative or possibly out of date."""
118+
ERROR = "error"
119+
"""The resolved value was the result of an error."""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py

+102
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,66 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from enum import Enum
1516
from typing import Final
1617

18+
GCP_APPHUB_APPLICATION_CONTAINER: Final = "gcp.apphub.application.container"
19+
"""
20+
The container within GCP where the AppHub application is defined.
21+
"""
22+
23+
GCP_APPHUB_APPLICATION_ID: Final = "gcp.apphub.application.id"
24+
"""
25+
The name of the application as configured in AppHub.
26+
"""
27+
28+
GCP_APPHUB_APPLICATION_LOCATION: Final = "gcp.apphub.application.location"
29+
"""
30+
The GCP zone or region where the application is defined.
31+
"""
32+
33+
GCP_APPHUB_SERVICE_CRITICALITY_TYPE: Final = (
34+
"gcp.apphub.service.criticality_type"
35+
)
36+
"""
37+
Criticality of a service indicates its importance to the business.
38+
Note: [See AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type).
39+
"""
40+
41+
GCP_APPHUB_SERVICE_ENVIRONMENT_TYPE: Final = (
42+
"gcp.apphub.service.environment_type"
43+
)
44+
"""
45+
Environment of a service is the stage of a software lifecycle.
46+
Note: [See AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1).
47+
"""
48+
49+
GCP_APPHUB_SERVICE_ID: Final = "gcp.apphub.service.id"
50+
"""
51+
The name of the service as configured in AppHub.
52+
"""
53+
54+
GCP_APPHUB_WORKLOAD_CRITICALITY_TYPE: Final = (
55+
"gcp.apphub.workload.criticality_type"
56+
)
57+
"""
58+
Criticality of a workload indicates its importance to the business.
59+
Note: [See AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type).
60+
"""
61+
62+
GCP_APPHUB_WORKLOAD_ENVIRONMENT_TYPE: Final = (
63+
"gcp.apphub.workload.environment_type"
64+
)
65+
"""
66+
Environment of a workload is the stage of a software lifecycle.
67+
Note: [See AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1).
68+
"""
69+
70+
GCP_APPHUB_WORKLOAD_ID: Final = "gcp.apphub.workload.id"
71+
"""
72+
The name of the workload as configured in AppHub.
73+
"""
74+
1775
GCP_CLIENT_SERVICE: Final = "gcp.client.service"
1876
"""
1977
Identifies the Google Cloud service for which the official client library is intended.
@@ -39,3 +97,47 @@
3997
"""
4098
The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
4199
"""
100+
101+
102+
class GcpApphubServiceCriticalityTypeValues(Enum):
103+
MISSION_CRITICAL = "MISSION_CRITICAL"
104+
"""Mission critical service."""
105+
HIGH = "HIGH"
106+
"""High impact."""
107+
MEDIUM = "MEDIUM"
108+
"""Medium impact."""
109+
LOW = "LOW"
110+
"""Low impact."""
111+
112+
113+
class GcpApphubServiceEnvironmentTypeValues(Enum):
114+
PRODUCTION = "PRODUCTION"
115+
"""Production environment."""
116+
STAGING = "STAGING"
117+
"""Staging environment."""
118+
TEST = "TEST"
119+
"""Test environment."""
120+
DEVELOPMENT = "DEVELOPMENT"
121+
"""Development environment."""
122+
123+
124+
class GcpApphubWorkloadCriticalityTypeValues(Enum):
125+
MISSION_CRITICAL = "MISSION_CRITICAL"
126+
"""Mission critical service."""
127+
HIGH = "HIGH"
128+
"""High impact."""
129+
MEDIUM = "MEDIUM"
130+
"""Medium impact."""
131+
LOW = "LOW"
132+
"""Low impact."""
133+
134+
135+
class GcpApphubWorkloadEnvironmentTypeValues(Enum):
136+
PRODUCTION = "PRODUCTION"
137+
"""Production environment."""
138+
STAGING = "STAGING"
139+
"""Staging environment."""
140+
TEST = "TEST"
141+
"""Test environment."""
142+
DEVELOPMENT = "DEVELOPMENT"
143+
"""Development environment."""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py

+10
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,22 @@ class OtelComponentTypeValues(Enum):
8383
"""The builtin SDK Batching Span Processor."""
8484
SIMPLE_SPAN_PROCESSOR = "simple_span_processor"
8585
"""The builtin SDK Simple Span Processor."""
86+
BATCHING_LOG_PROCESSOR = "batching_log_processor"
87+
"""The builtin SDK Batching LogRecord Processor."""
88+
SIMPLE_LOG_PROCESSOR = "simple_log_processor"
89+
"""The builtin SDK Simple LogRecord Processor."""
8690
OTLP_GRPC_SPAN_EXPORTER = "otlp_grpc_span_exporter"
8791
"""OTLP span exporter over gRPC with protobuf serialization."""
8892
OTLP_HTTP_SPAN_EXPORTER = "otlp_http_span_exporter"
8993
"""OTLP span exporter over HTTP with protobuf serialization."""
9094
OTLP_HTTP_JSON_SPAN_EXPORTER = "otlp_http_json_span_exporter"
9195
"""OTLP span exporter over HTTP with JSON serialization."""
96+
OTLP_GRPC_LOG_EXPORTER = "otlp_grpc_log_exporter"
97+
"""OTLP LogRecord exporter over gRPC with protobuf serialization."""
98+
OTLP_HTTP_LOG_EXPORTER = "otlp_http_log_exporter"
99+
"""OTLP LogRecord exporter over HTTP with protobuf serialization."""
100+
OTLP_HTTP_JSON_LOG_EXPORTER = "otlp_http_json_log_exporter"
101+
"""OTLP LogRecord exporter over HTTP with JSON serialization."""
92102

93103

94104
class OtelSpanSamplingResultValues(Enum):

0 commit comments

Comments
 (0)