Skip to content

Logging stability review: [major] No Enabled support across API, SDK, and processors #5360

Description

@lmolkova

Spec: Logs API § Enabled, Logs SDK § Enabled, Logs SDK § LogRecordProcessor.Enabled

  • API — Recommended (SHOULD): Logger should provide an Enabled(context, severity_number, event_name) -> bool so instrumentation can skip expensive LogRecord construction.
  • SDK — required behavior (stable): Logger.Enabled MUST return false when there are no registered LogRecordProcessors, or when all registered processors implement Enabled and each returns false; otherwise SHOULD return true.
  • Processor — Optional (MAY): LogRecordProcessor.Enabled(context, scope, severity_number, event_name) -> bool backs the per-record filtering branch of Logger.Enabled.
  • Current: no enabled() on the API Logger, none on the SDK Logger (only a private _is_enabled() tied to the Development LoggerConfig), and no Enabled on LogRecordProcessor.
  • Missing: the entire Enabled chain. Without it there is no way to short-circuit log construction, and no per-severity/event filtering hook. Even the coarse "no processors registered ⇒ disabled" case is not exposed.

Part of open-telemetry/community#1751

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions