-
Notifications
You must be signed in to change notification settings - Fork 932
SeverityNumber=0 MAY be used to represent an unspecified value
#4535
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
Conversation
|
@tigrannajaryan, @jack-berg, I would love to get feedback from you. |
|
Logs SIG meeting summary: |
SeverityNumber=0 MAY be used to represent an unspecified value
|
You can add JS to the list of languages using |
|
@tigrannajaryan, @jack-berg, can you please take a look? |
|
I think this PR can be merged if nobody objects during today's Spec SIG meeting. |
July 2025 release. ### Context - Add Supplementary Guidelines for environment variables as context carrier specification. ([#4548](#4548)) ### Traces - Define sampling threshold field in OpenTelemetry TraceState; define the behavior of TraceIdRatioBased sampler in terms of W3C Trace Context Level 2 randomness. ([#4166](#4166)) - Define CompositeSampler implementation and built-in ComposableSampler interfaces. ([#4466](#4466)) - Define how SDK implements `Tracer.Enabled`. ([#4537](#4537)) ### Logs - Stabilize `Event Name` parameter of `Logger.Enabled`. ([#4534](#4534)) - Stabilize SDK and No-Op `Logger.Enabled`. ([#4536](#4536)) - `SeverityNumber=0` MAY be used to represent an unspecified value. ([#4535](#4535)) ### Baggage - Add Supplementary Guidelines for environment variables as context carrier specification. ([#4548](#4548)) ### Compatibility - Clarify expectations about Prometheus content negotiation for metric names. ([#4543](#4543)) --------- Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Follows: - #4535 ## Why Related to #4540 Supersedes #4541 per #4541 (comment) and discussions from the last OTel Specification and Logs SIG meetings. **Some comments that were already expressed as comments.** From #4541 (comment): > I'd be in favor of treating `0` as yet another severity when it comes to filtering and comparison, i.e. logs with unspecified/0 severity are dropped when `threshold > 0` and are recorded otherwise. From #4541 (comment): > I think I like the simplicity of > > > if sev < p.Min { > > // drop > > } > > it provides a very reasonable default behavior, which is to drop logs that don't have any severity This is also inline with https://github.com/open-telemetry/opentelemetry-specification/blob/7e7c0bd12a535b332284ecabd228c4749886455f/specification/logs/data-model.md?plain=1#L323-L329 From #4540 (comment): > Relying on int comparison seems to be the most natural option We agreed that this PR does conflict proposal to allow only allow/support 0..24 SeverityNumber values. ## What Removal of > `SeverityNumber` can be compared to another `SeverityNumber` or to numbers in the 1..24 range (or to the corresponding short names). as I find that this sentence is more confusing than clarifying: 1. why comparing values of different types? 2. why can we compare only with integers between 1..24? 3. what about `SeverityNumber` that are greater than 24 or lesser than 1? 4. are the short names normative? Removal of duplicated description > Smaller numerical values in each range represent less important (less severe) events. Larger numerical values in each range represent more important (more severe) events. Moving the comparison example to a better place where the `SeverityNumber` comparison is described > For example `SeverityNumber=17` describes an error that is less critical than an error with `SeverityNumber=20`. Simplify `SeverityProcessor` example. ## Prototype This is exactly how https://pkg.go.dev/go.opentelemetry.io/contrib/processors/minsev currently works. --------- Co-authored-by: Reiley Yang <reyang@microsoft.com> Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
Fixes #4478
Changes
Per #4509 (comment)
The main purpose of this PR would then be to allow to have
0as a "reserved" value as this is how most implementations implement the "unspecified" value e.g.Defining
0as something else would be disruptive for these languages. If it would be safe to "reserve" this value and make it optional.I guess only OTel Rust and OTel Swift have "proper" enums which does not require handling
0as unspecified.