From 3fcb74bf7dc59f1bab268750919b34110f9dd5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Tue, 28 Jan 2025 18:41:19 +0100 Subject: [PATCH] Logs API to have functionality for reusing Standard Attributes (#4373) Fixes https://github.com/open-telemetry/opentelemetry-specification/issues/4201 Reference implementations: - https://github.com/open-telemetry/opentelemetry-go/pull/6180 - https://github.com/open-telemetry/opentelemetry-java/pull/6983 Related Slack thread: https://cloud-native.slack.com/archives/C062HUREGUV/p1736545245331779 --------- Co-authored-by: Trask Stalnaker Co-authored-by: Liudmila Molkova --- CHANGELOG.md | 2 ++ spec-compliance-matrix.md | 1 + specification/logs/api.md | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5118cadb53d..c2ce886f367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ release. - Define how SDK implements `Logger.Enabled`. ([#4381](https://github.com/open-telemetry/opentelemetry-specification/pull/4381)) +- Logs API should have functionality for reusing Standard Attributes. + ([#4373](https://github.com/open-telemetry/opentelemetry-specification/pull/4373)) ### Baggage diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 49f9f7b269e..1ac25e67668 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -193,6 +193,7 @@ Disclaimer: this list of features is still a work in progress, please refer to t | LoggerProvider.Shutdown | | | + | | + | | | + | | + | - | | | LoggerProvider.ForceFlush | | | + | | + | | | + | | + | - | | | Logger.Emit(LogRecord) | | | + | | + | | | + | | + | - | | +| Reuse Standard Attributes | X | + | | | | | | | | | | | | LogRecord.Set EventName | | | | | | | | | | | | | | Logger.Enabled | X | + | | | | | | | + | + | | | | SimpleLogRecordProcessor | | | + | | + | | | + | | + | | | diff --git a/specification/logs/api.md b/specification/logs/api.md index 58ac295bf12..f7f7b0395c0 100644 --- a/specification/logs/api.md +++ b/specification/logs/api.md @@ -124,6 +124,14 @@ The API MUST accept the following parameters: - [Attributes](./data-model.md#field-attributes) (optional) - **Status**: [Development](../document-status.md) - [Event Name](./data-model.md#field-eventname) (optional) +**Status**: [Development](../document-status.md) + +The API SHOULD provide functionality for users to convert +[Standard Attributes](../common/README.md#standard-attribute) +so they can be used, or directly accept them, in the log signal. +This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) +across signals. + ### Enabled **Status**: [Development](../document-status.md)