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

[exporter/loki] Documentation incorrect on mapping severity to level #31333

Closed
alexgenon opened this issue Feb 20, 2024 · 6 comments · Fixed by #32901
Closed

[exporter/loki] Documentation incorrect on mapping severity to level #31333

alexgenon opened this issue Feb 20, 2024 · 6 comments · Fixed by #32901
Assignees
Labels
documentation Improvements or additions to documentation exporter/loki Loki Exporter

Comments

@alexgenon
Copy link

Component(s)

exporter/loki

Describe the issue you're reporting

The Loki exporter documentation states that the record.severity is mapping to record.attributes.level (used by Loki) but it appears that it is the severityNumber which is used for the mapping (code reference)

@alexgenon alexgenon added the needs triage New item requiring triage label Feb 20, 2024
@github-actions github-actions bot added the exporter/loki Loki Exporter label Feb 20, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jpkrohling
Copy link
Member

@mar4uk, do you remember if this was changed from the original implementation?

@crobert-1
Copy link
Member

Sorry if this is obvious, but what's the difference from the code vs. documentation? From my understanding of the OTLP log spec, severity would be the SeverityNumber that's being used, and then record.attributes.level is what's being used in code. Where's the mismatch that you're seeing?

Is the expectation from documentation that the exporter should actually be getting the severity from a different field in a log that's explicitly named severity? I guess in my reading I assumed severity in this case is equivalent to SeverityNumber, but if that's the case maybe documentation should be updated to match more exactly?

For context, it looks like this functionality along with the README comment came in the same change.

@alexgenon
Copy link
Author

@crobert-1, indeed, the goal is to correct the documentation on the mapping.
There are 2 fields in the OTLP log spec: SeverityText and SeverityNumber.
In the documentation of the loki exporter, it is stated that record.severity (which corresponds to SeverityText is used to defined loki's record.attributes.level but in the code, it is actually SeverityNumber which is used.
This is linked to #28612 which is asking for the entire removal of the promotion of the severity as a Loki label.

@crobert-1
Copy link
Member

Okay, thanks for the clarification! I didn't know there was an understanding that record.severity corresponds to SeverityText here. 👍

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Mar 5, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 6, 2024
@crobert-1 crobert-1 removed the Stale label May 6, 2024
@jpkrohling jpkrohling self-assigned this May 7, 2024
jpkrohling added a commit to jpkrohling/opentelemetry-collector-contrib that referenced this issue May 7, 2024
Fixes open-telemetry#31333

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
jpkrohling added a commit that referenced this issue May 7, 2024
…32901)

Fixes #31333

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation exporter/loki Loki Exporter
Projects
None yet
3 participants