-
Notifications
You must be signed in to change notification settings - Fork 893
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
Standardize SDK logging levels #2039
Comments
@open-telemetry/javascript-approvers @open-telemetry/ruby-approvers @open-telemetry/erlang-approvers |
It might also be worth trying to unify these logging levels with the logs telemetry signal severity levels: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#severity-fields |
Erlang uses RFC 5424 log levels. Elixir before 1.11 used only Technically there are 2 additional configuration options for Erlan |
Note that the Erlang SDK isn't wired up to actually use that environment variable. If I remember correctly it is because I was going to wire it up, so added it as a configuration value that is read and parsed, but then wasn't sure how to actually use it :). Never got around to poking people to get that hashed out but now it sounds like this is going to be worked on. |
While I agree that we should define a common "set" of logging levels that "should" be supported, different runtimes, languages and libraries will have their own set of levels that are used by their communities. So as per the (signalfx/gdi-specification#139), I like the definition of
|
I think I disagree. This is a config SIG issue in my opinion, but what we want is a single configuration that can be deployed to all your SDKs and your collector that behaves in a consistent manner. |
I think we're good now in Erlang as the levels are getting translated. |
If we add support for log level to file config, we can standardize on an enumeration, and let each language define how values map to their ecosystem. A natural starting point would be to use the severity level definition from the log data model. |
Currently, the SDK logging is specified to be configured via the
OTEL_LOG_LEVEL
environment variable. There currently is only one log level listed in the specification:info
. However, other log levels are not specified. It is important that each language use the same logging level so user configuration of environment variables will be cross-language compatible.The compliance matrix shows only three language implement this environment variable: javascript, ruby, and erlang. Auditing these languages I have found the following logging levels being used.
Javascript
https://github.com/open-telemetry/opentelemetry-js/blob/feea5167c15c41f0aeedc60959e36c18315c7ede/packages/opentelemetry-core/src/utils/environment.ts#L187-L195
Ruby
https://github.com/open-telemetry/opentelemetry-ruby/blob/62d6ee584ce23ab23d8cde447c872b49486cedbd/sdk/lib/opentelemetry/sdk/forwarding_logger.rb#L20-L31
Erlang
As far as I can tall (I'm definitely not an Erlang programmer), they are using the built-in logging levels
Proposed Solution
The intersection of the already implemented logging levels are:
debug
,info
,error
.Standardizing on these values would mean that these languages will remain compliant. However, currently, only Javascript has released a stable release of OpenTelemetry. That would mean that if we wanted to add more than this minimal set of logging levels they should ideally remain compatible with the Javascript levels. Specifically, it seems having a "none" level would be ideal for users that do not want any logging output.
The text was updated successfully, but these errors were encountered: