Clarify LogRecordProcessor OnEmit context parameter#3387
Clarify LogRecordProcessor OnEmit context parameter#3387martinkuba wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
| passed `Context`, the current `Context`, or an empty `Context` if | ||
| the [Logger](./bridge-api.md#get-a-logger) was obtained | ||
| with `include_trace_context=false`) | ||
| passed `Context` or the current `Context`) |
There was a problem hiding this comment.
Question: does OnEmit need to know the value of include_trace_context?
There was a problem hiding this comment.
Related question: should a log's trace context fields be populated if include_trace_context=false and context is explicitly passed? I think yes. However, for languages that rely on explicit context because no implicit context is available, there's no point to having the include_trace_context parameter since it doesn't change any behavior.
We might actually consider removing include_trace_context, since setting it to true seems to only be syntactic sugar for explicitly setting an empty context.
There was a problem hiding this comment.
I agree, we should consider it, it is a source of confusion. Created a separate issue here: #3394
|
Superseded by #3397. |
The
contextparameter passed in to LogRecordProcessor.OnEmit() should not be affected by theinclude_trace_contextconfiguration, since the Context may contain other information than just the trace context.