You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the remaining, Development-status conditions of the Logs Enabled spec in the SDK: severity-based filtering (minimum_severity) and trace-based filtering (trace_based).
Background
PR #5380 adds Logger.enabled() and implements the stable conditions of the spec's Enabled section:
there are no registered LogRecordProcessors
LoggerConfig.enabled is false (handled in Logger.enabled())
all registered LogRecordProcessors implement Enabled and each returns false
The spec lists two further conditions under which Enabled MUST return false, both currently marked [Development]:
the provided severity is specified (not 0) and is less than the configured minimum_severity
trace_based is true and the current context is associated with an unsampled trace
Both conditions are still Development status in the spec and subject to change.
_LoggerConfig currently only has is_enabled; these conditions require adding minimum_severity and trace_based fields to the config model first. The tracer analog _TracerConfig also only has is_enabled, so the config model should grow consistently across signals (related: Public API for setting logger/tracer configuration programmatically #5524).
Proposed scope
Add minimum_severity and trace_based fields to _LoggerConfig.
Have Logger.enabled() return false when the provided severity is below minimum_severity, and when trace_based is set and the current context is an unsampled trace.
Track the spec closely, since these conditions are Development status.
What
Implement the remaining, Development-status conditions of the Logs
Enabledspec in the SDK: severity-based filtering (minimum_severity) and trace-based filtering (trace_based).Background
PR #5380 adds
Logger.enabled()and implements the stable conditions of the spec'sEnabledsection:LogRecordProcessorsLoggerConfig.enabledisfalse(handled inLogger.enabled())LogRecordProcessorsimplementEnabledand each returnsfalseThe spec lists two further conditions under which
EnabledMUST returnfalse, both currently marked [Development]:0) and is less than the configuredminimum_severitytrace_basedistrueand the current context is associated with an unsampled traceThese were intentionally deferred out of #5380 (see #5380 (comment) and the issue discussion at #5360 (comment)).
Why deferred
_LoggerConfigcurrently only hasis_enabled; these conditions require addingminimum_severityandtrace_basedfields to the config model first. The tracer analog_TracerConfigalso only hasis_enabled, so the config model should grow consistently across signals (related: Public API for setting logger/tracer configuration programmatically #5524).Proposed scope
minimum_severityandtrace_basedfields to_LoggerConfig.Logger.enabled()returnfalsewhen the provided severity is belowminimum_severity, and whentrace_basedis set and the current context is an unsampled trace.cc @aabmass @herin049