Skip to content

Commit c0b850f

Browse files
authored
Make context available in log record processor onEmit (#2927)
1 parent 374c34c commit c0b850f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

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

2424
### Logs
2525

26+
- Add `Context` as argument to `LogRecordProcessor#onEmit`.
27+
([#2927](https://github.com/open-telemetry/opentelemetry-specification/pull/2927))
28+
2629
### Resource
2730

2831
### Semantic Conventions

specification/logs/api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ fields:
179179

180180
- [Timestamp](./data-model.md#field-timestamp)
181181
- [Observed Timestamp](./data-model.md#field-observedtimestamp)
182-
- [Trace Context](./data-model.md#trace-context-fields)
182+
- [Context](../context/README.md)
183+
including [TraceContext](./data-model.md#trace-context-fields)
183184
- [Severity Number](./data-model.md#field-severitynumber)
184185
- [Severity Text](./data-model.md#field-severitytext)
185186
- [Body](./data-model.md#field-body)

specification/logs/sdk.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ therefore it SHOULD NOT block or throw exceptions.
179179

180180
* `logRecord` - a [ReadWriteLogRecord](#readwritelogrecord) for the
181181
emitted `LogRecord`.
182+
* `context` - the `Context` that the SDK determined (the explicitly
183+
passed `Context`, the current `Context`, or an empty `Context` if
184+
the [Logger](./api.md#get-a-logger) was obtained
185+
with `include_trace_context=false`)
182186

183187
**Returns:** `Void`
184188

0 commit comments

Comments
 (0)