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

Define Enabled parameters for Logger #4203

Merged
merged 14 commits into from
Sep 20, 2024
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ release.
([#4067](https://github.com/open-telemetry/opentelemetry-specification/pull/4067))
- Clarify that `Export` MUST NOT be called by simple and batching processors concurrently.
([#4173](https://github.com/open-telemetry/opentelemetry-specification/pull/4173))
- Define `Enabled` parameters for `Logger`.
([#4203](https://github.com/open-telemetry/opentelemetry-specification/pull/4203))

### Events

Expand Down
19 changes: 16 additions & 3 deletions specification/logs/bridge-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,22 @@ All parameters are optional.
To help users avoid performing computationally expensive operations when
generating a `LogRecord`, a `Logger` SHOULD provide this `Enabled` API.

There are currently no required parameters for this API. Parameters can be
added in the future, therefore, the API MUST be structured in a way for
parameters to be added.
The API SHOULD accept the following parameters:

- The [Context](../context/README.md) associated with the `LogRecord`. The API
pellared marked this conversation as resolved.
Show resolved Hide resolved
reyang marked this conversation as resolved.
Show resolved Hide resolved
MAY implicitly use the current Context as a default behavior.
pellared marked this conversation as resolved.
Show resolved Hide resolved
pellared marked this conversation as resolved.
Show resolved Hide resolved
- [Severity Number](./data-model.md#field-severitynumber)
reyang marked this conversation as resolved.
Show resolved Hide resolved

All parameters MUST be optional.
MrAlias marked this conversation as resolved.
Show resolved Hide resolved

Parameters can be added in the future, therefore,
the API MUST be structured in a way for parameters to be added.

It SHOULD be possible to distinguish between an unset parameter value from
a parameter value set explicitly to a valid default value of given type
(e.g. distinguish unset attributes for empty attributes). The exception from
this rule is when the default value of given type is not seen as a valid value
like 0 for [Severity Number](./data-model.md#field-severitynumber).

This API MUST return a language idiomatic boolean type. A returned value of
`true` means the `Logger` is enabled for the provided arguments, and a returned
Expand Down
Loading