Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs API: LoggerProvider docs issues #4318

Open
lmolkova opened this issue Nov 23, 2024 · 0 comments
Open

Logs API: LoggerProvider docs issues #4318

lmolkova opened this issue Nov 23, 2024 · 0 comments
Labels

Comments

@lmolkova
Copy link
Contributor

lmolkova commented Nov 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants