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

[API] Introduce a new global level api.diag for internal Diagnostic Logging (Part 1) #1877

Closed
MSNev opened this issue Jan 27, 2021 · 7 comments
Assignees

Comments

@MSNev
Copy link
Contributor

MSNev commented Jan 27, 2021

Introduction of new api.diag global logger as discussed during SIG meetings and linked to #1754

Basic outline

  • Provide a top-level diagnostic logger from the API as api.diag with methods like api.diag.warn, api.diag.debug, etc.
  • diag logger is no-op by default
  • register a default logging implementation by calling api.diag.setLogger(loggingImpl)

Part 1

  • For now we should keep but deprecate direct use of the NoopLogger and ConsoleLogger classes

Part 2

Will include breaking changes

  • Once contrib is changed to use api.diag, these exports will be removed, this will require that they stop using local Logger instances
  • This will also have breaking changes for
    • Configuration definitions that use api.Logger and core.LogLevel
    • Functions that currently get or pass api.Logger instances
    • The type of the environment OTEL_LOG_LEVEL
@MSNev
Copy link
Contributor Author

MSNev commented Jan 27, 2021

Please assign to me as I can't assign it myself

@vmarchaud
Copy link
Member

vmarchaud commented Jan 27, 2021

Quick question: does the exact name has been discussed in the SIG today (i couldn't attend sadly), i feel like shortening to diag kinda "obsfucate" its usage, what about just using api.diagnostics ?

@MSNev
Copy link
Contributor Author

MSNev commented Jan 27, 2021

It was originally discussed 2 Sig's back, and part of the reason for the shortened name is to better support code minification, which is also the reason for introducing in the first place see #1754 for part of the discussion

@vmarchaud
Copy link
Member

Okay cool i didn't miss anything then. I understand the code minification issue that of course impact everyone using otel, however i want to be sure that we all agree on "sacrificing" readability (at least in my opinion) for this goal.

@aabmass
Copy link
Member

aabmass commented Feb 12, 2021

Quick question, is this logger intended to be usable by instrumentations and exporters or truly "internal"? I maintain the Google Cloud OTel exporters (in a different repo) where the code base also has plenty options.logger || new NoopLogger(). I want to know if I can use this when its ready.

@MSNev
Copy link
Contributor Author

MSNev commented Feb 12, 2021

Yes, this is designed to be used for all "internal" diagnostic logging of the Api, Sdk's, instrumentations, exporters and all contributed components.

So read "internal" as the OpenTelemetry and supporting components vs the "application" that uses OpenTelemetry as the diagnostic logs are local to the executing environment.

@MSNev
Copy link
Contributor Author

MSNev commented Feb 18, 2021

This is included in v0.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants