Skip to content

Logs API: LoggerProvider docs issues #4318

@lmolkova

Description

@lmolkova

LoggerProvider docs are based on old spec language and should be updated.

Specifically:

  1. Identifying parameters - different loggers should be returned if parameters are different

    For any two calls it is undefined whether the same or different
    `Logger` instances are returned, even for different library names.

    was changed recently (Define attributes equality and make all fields as identifying for Tracer, Meter, Logger, EventLogger opentelemetry-specification#4161) to make all parameters identifiable and guarantee that different loggers are returned.

    the implementation is already compliant, it's just a doc issue.

  2. Logger name should be used as scope name

    name: The name of the instrumenting module.
    ``__name__`` may not be used as this can result in
    different logger names if the loggers are in different files.
    It is better to use a fixed string that can be imported where
    needed and used consistently as the name of the logger.

    Spec language

    For log sources which define a logger name (e.g. Java
    Logger Name)
    the Logger Name should be recorded as the instrumentation scope name.

    https://github.com/open-telemetry/opentelemetry-specification/blob/881f364cb5f64f7f276fbe2e69dbc5f2a0d4e76e/specification/logs/api.md#get-a-logger

    Recommendation is to change the doc to something like

    name: The name of the instrumenting module, package, module or class.
    For log sources which define a logger name (e.g. logging.Logger.name)
    the Logger Name should be recorded as the instrumentation scope name.

  3. Attributes are not documented as parameter in get_logger API

    schema_url: Optional. Specifies the Schema URL of the emitted telemetry.
    """

Part of open-telemetry/community#1751

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions