-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] Make it easier to map OpenTelemetry Severity to Loki level label #14313
Comments
Pinging code owners: @gramidt @gouthamve @jpkrohling @kovrus @mar4uk. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Sounds reasonable to me! Would you like to open a PR for that? |
@jpkrohling I do not have the skills to do it. |
I don't know if the issue is related but the opentelemtry documentation states :
What actually happens is that severityText contains the original value. If I have the following config : - type: regex_parser
id: extract-nginx-log #Goto end
parse_from: body
regex: '(?P<statuscode>\d{3}) .*'
severity:
parse_from: attributes.statuscode
mapping:
error: "5xx"
warn: "4xx"
info: "3xx"
debug: "2xx" And the following log : The log entry will have "201" as |
Don't worry, thanks for the issue anyway. I'll assign this to me and take a look soon. |
Nevermind my previous comment. SeverityText should be the original one. The mapping could maybe be done through the "Severity" ? A severity of I would be happy to try this one. |
Is your feature request related to a problem? Please describe.
Currently, the log level is tracked as SeverityText (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) in v0.60.0, while the same information is tracked in the level label in Loki (https://grafana.com/docs/grafana/latest/explore/logs-integration/). It would be optimal if we could avoid tracking the log level as both "SeverityText" and "level" in the OTEL Collector to make Loki work and support mapping between "SeverityText" and "level" in the Loki Exporter configuration.
Example
If the level is not set, Loki presents the log line as purple because the body text includes the word "Alert"
If the level is set but not part of loki.attribute.labels, then Loki presents the logline as purple because the body text includes the word "Alert"
If the level is set and part of loki.attribute.labels, then Loki presents the logline as green because Loki uses the log level from the level label.
Describe the solution you'd like
Support mapping between "SeverityText" and "level" in the Loki Exporter configuration in the OTEL Collector, so the user is not forced into Loki-specific transformation in the OTEL Collector. Ideally, it should happen automatically since the purpose of the fields is the same on both sides.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: