Skip to content

Commit 6b4a496

Browse files
authored
Merge branch 'main' into fix-batchlogprocessor-gc
2 parents 1efd2ee + 34b3ac6 commit 6b4a496

24 files changed

Lines changed: 504 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
([#4498](https://github.com/open-telemetry/opentelemetry-python/pull/4498))
2020
- Patch logging.basicConfig so OTel logs don't cause console logs to disappear
2121
([#4436](https://github.com/open-telemetry/opentelemetry-python/pull/4436))
22+
- Bump semantic conventions to 1.32.0
23+
([#4530](https://github.com/open-telemetry/opentelemetry-python/pull/4530))
2224
- Fix ExplicitBucketHistogramAggregation to handle multiple explicit bucket boundaries advisories
2325
([#4521](https://github.com/open-telemetry/opentelemetry-python/pull/4521))
2426
- opentelemetry-sdk: Fix serialization of objects in log handler

exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ def _get_temporality(
117117
_logger.warning(
118118
"Unrecognized OTEL_EXPORTER_METRICS_TEMPORALITY_PREFERENCE"
119119
" value found: "
120-
f"{otel_exporter_otlp_metrics_temporality_preference}, "
121-
"using CUMULATIVE"
120+
"%s, "
121+
"using CUMULATIVE",
122+
otel_exporter_otlp_metrics_temporality_preference,
122123
)
123124
instrument_class_temporality = {
124125
Counter: AggregationTemporality.CUMULATIVE,

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def _read_file(file_path: str) -> Optional[bytes]:
125125
return file.read()
126126
except FileNotFoundError as e:
127127
logger.exception(
128-
f"Failed to read file: {e.filename}. Please check if the file exists and is accessible."
128+
"Failed to read file: %s. Please check if the file exists and is accessible.",
129+
e.filename,
129130
)
130131
return None
131132

opentelemetry-sdk/src/opentelemetry/sdk/error_handler/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ def __exit__(self, exc_type, exc_value, traceback):
130130
# pylint: disable=broad-exception-caught
131131
except Exception as error_handling_error:
132132
logger.exception(
133-
"%s error while handling error"
134-
" %s by error handler %s",
133+
"%s error while handling error %s by error handler %s",
135134
error_handling_error.__class__.__name__,
136135
exc_value.__class__.__name__,
137136
error_handler_class.__name__,
Lines changed: 37 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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`
Lines changed: 30 additions & 0 deletions
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

Lines changed: 15 additions & 1 deletion
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

Lines changed: 16 additions & 1 deletion
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

Lines changed: 10 additions & 0 deletions
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`.

0 commit comments

Comments
 (0)