open-telemetry / opentelemetry-specification

Specifications for OpenTelemetry
https://opentelemetry.io
Apache License 2.0
3.76k stars 890 forks source link

SeverityNumber as required parameter in EmitEvent #4261

Open pellared opened 1 month ago

pellared commented 1 month ago

I have a feeling that all Events should have SeverityNumber set to a specified value.

_Originally posted by @pellared in https://github.com/open-telemetry/opentelemetry-specification/pull/4259#discussion_r1801514796_

Setting the severity is crucial to support the most common way of filtering - by severity level.

Related to:

pellared commented 1 week ago

SIG meeting notes: @tedsuo finds that it should not be required and that INFO (8?) should be the default value is unspecified. Ted is against the proposal to make it required, or set it by the SDK, or use a default value for a parameter in the API if a language has such option. He stated that 0 should be handled as INFO.

pellared commented 1 week ago

I think that the proposal to handle 0 as INFO is not acceptable change for https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-severitynumber as 0 is seen as an unspecified/undefined/invalid value e.g.

Also it would not look nice given the definition:

Smaller numerical values correspond to less severe events (such as debug events), larger numerical values correspond to more severe events (such as errors and critical events).

I propose that the API MUST default SeverityNumber to INFO(8) or make it required.