Skip to content

Commit dc8fcfb

Browse files
fix: clarify description of LoggerConfig.trace_based (#4930)
Minor clarification. The reader of the current description may think that if `trace_based = true` then log records not associated with a trace should not be recorded (which is not true). The proposed change is more precise and follows other parts of the specification that use normative language such as https://github.com/open-telemetry/opentelemetry-specification/blob/e4ad687a9e89abf9d59ee394ee10977d041b71ba/specification/logs/sdk.md?plain=1#L213-L217 https://github.com/open-telemetry/opentelemetry-specification/blob/e4ad687a9e89abf9d59ee394ee10977d041b71ba/specification/logs/sdk.md?plain=1#L249-L252 https://github.com/open-telemetry/opentelemetry-specification/blob/e4ad687a9e89abf9d59ee394ee10977d041b71ba/specification/logs/sdk.md?plain=1#L264-L266 Moreover, define the behavior when `trace_based = false` using normative language. --------- Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
1 parent bafa9e2 commit dc8fcfb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

specification/logs/sdk.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,13 @@ It consists of the following parameters:
206206
affected by this parameter and therefore bypass minimum severity filtering.
207207

208208
* `trace_based`: A boolean indication of whether the logger should
209-
only process log records associated with sampled traces.
209+
drop log records associated with an unsampled trace.
210210

211211
If not explicitly set, the `trace_based` parameter MUST default to `false`.
212212

213+
If `trace_based` is `false`, log records MUST NOT be affected because of this
214+
parameter.
215+
213216
If `trace_based` is `true`, log records associated with unsampled traces MUST
214217
be dropped by the `Logger`. A log record is considered associated with an unsampled trace
215218
if it has a valid `SpanId` and its `TraceFlags` indicate that the trace is unsampled.

0 commit comments

Comments
 (0)