From 82a2c081fc4bea76d709466fff2aa86238382fcf Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Mon, 7 Nov 2022 16:49:51 -0600 Subject: [PATCH 1/2] Make context available in log record processor --- specification/logs/api.md | 2 +- specification/logs/sdk.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/logs/api.md b/specification/logs/api.md index a3cde5989ba..5044d4f079f 100644 --- a/specification/logs/api.md +++ b/specification/logs/api.md @@ -179,7 +179,7 @@ fields: - [Timestamp](./data-model.md#field-timestamp) - [Observed Timestamp](./data-model.md#field-observedtimestamp) -- [Trace Context](./data-model.md#trace-context-fields) +- `Context` including [TraceContext](./data-model.md#trace-context-fields) - [Severity Number](./data-model.md#field-severitynumber) - [Severity Text](./data-model.md#field-severitytext) - [Body](./data-model.md#field-body) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 38caf5bd976..a537aa8093f 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -179,6 +179,10 @@ therefore it SHOULD NOT block or throw exceptions. * `logRecord` - a [ReadWriteLogRecord](#readwritelogrecord) for the emitted `LogRecord`. +* `context` - the `Context` that the SDK determined (the explicitly + passed `Context`, the current `Context`, or an empty `Context` if + the [Logger](./api.md#get-a-logger) was obtained + with `include_trace_context=false`) **Returns:** `Void` From 32abb2a7486cbb04df0774fd8da8725c0503a7d5 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Tue, 8 Nov 2022 13:42:11 -0600 Subject: [PATCH 2/2] Add changelog, linke to Context readme --- CHANGELOG.md | 3 +++ specification/logs/api.md | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0fb6d1555d..18032233e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ release. ### Logs +- Add `Context` as argument to `LogRecordProcessor#onEmit`. + ([#2927](https://github.com/open-telemetry/opentelemetry-specification/pull/2927)) + ### Resource ### Semantic Conventions diff --git a/specification/logs/api.md b/specification/logs/api.md index 5044d4f079f..9367067b219 100644 --- a/specification/logs/api.md +++ b/specification/logs/api.md @@ -179,7 +179,8 @@ fields: - [Timestamp](./data-model.md#field-timestamp) - [Observed Timestamp](./data-model.md#field-observedtimestamp) -- `Context` including [TraceContext](./data-model.md#trace-context-fields) +- [Context](../context/README.md) + including [TraceContext](./data-model.md#trace-context-fields) - [Severity Number](./data-model.md#field-severitynumber) - [Severity Text](./data-model.md#field-severitytext) - [Body](./data-model.md#field-body)