Skip to content

Commit fc2e1a9

Browse files
traskpellared
andauthored
Stabilize optional Exception parameter to Logger Emit (#4886)
Fixes #4858 Implementations / Prototypes: - Java: [`ExtendedLogRecordBuilder.setException(Throwable)`](https://github.com/open-telemetry/opentelemetry-java/blob/main/api/incubator/src/main/java/io/opentelemetry/api/incubator/logs/ExtendedLogRecordBuilder.java#L137) - Builder method called before `emit()` - Merged and available to users - .NET: [`LogRecordAttributeList.RecordException(Exception)`](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Api/Logs/LogRecordAttributeList.cs#L191-L198) - Attribute list method called before `EmitLog()` - JavaScript: [opentelemetry-js#6385](open-telemetry/opentelemetry-js#6385) - Field on LogRecord passed to `emit()` - Python: [opentelemetry-python#4908](open-telemetry/opentelemetry-python#4908) - Parameter on LogRecord passed to `emit()` (only the Python prototype doesn't yet meet the definition of [qualifying prototype](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change) yet) Co-authored-by: Robert Pająk <pellared@hotmail.com>
1 parent 550ddcc commit fc2e1a9

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ release.
1515

1616
### Logs
1717

18+
- Stabilize optional `Exception` parameter to Logger Emit.
19+
([#4858](https://github.com/open-telemetry/opentelemetry-specification/pull/4858))
20+
1821
### Baggage
1922

2023
### Profiles

specification/logs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The API MUST accept the following parameters:
126126
- [Attributes](./data-model.md#field-attributes) (optional)
127127
- [Event Name](./data-model.md#field-eventname) (optional)
128128

129-
**Status**: [Development](../document-status.md) - The API MAY accept the following parameter:
129+
The API MAY accept the following parameter:
130130

131131
- Exception (optional): An exception (or error) associated with the log record.
132132

specification/logs/sdk.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ However, the changes MUST be eventually visible.
225225
If [Observed Timestamp](./data-model.md#field-observedtimestamp) is unspecified,
226226
the implementation SHOULD set it equal to the current time.
227227

228-
**Status**: [Development](../document-status.md) - If an
229-
[Exception](api.md#emit-a-logrecord) is provided, the SDK MUST by default set attributes
228+
If an [Exception](api.md#emit-a-logrecord) is provided, the SDK MUST by default set attributes
230229
from the exception on the `LogRecord` with the conventions outlined in the
231230
[exception semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md).
232231
User-provided attributes MUST take precedence and MUST NOT be overwritten by

0 commit comments

Comments
 (0)