-
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] Clarification about the hardcoded loki label "exporter=OTLP" #22155
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
To send a log entry to Loki at least one label is needed. It was decided to set default label I think it would be nice to allow users to configure setting default labels (there is a discussion about it #21508). Will work on it soon |
I understand the initial wish to avoid dropped logs. But definitely agreed, being able to select the default labels to add or not is a nice enhancement. |
|
I'll take the blame for this, it should have been "otelcol" or something like that. The label was originally proposed by @cyriltovena when we were doing a refactoring of this component a year or so ago, but I should have proposed something better than OTLP. At this point, changing this would likely cause confusion to current users and I would propose the exporter to have a "default label/value" property, with the possibility of this being disabled. Like: defaults:
label:
enabled: true # default to true, meaning that all data points being exported will have the default label/value
name: exporter # default to "exporter", which is the current label name
value: OTLP # default to "OTLP", which is the current label value Not having a "defaults" node or "label" node keeps the current behavior. Setting "enabled" to false would disable the default label entirely, meaning that users should ensure that labels must exist for log entries to be submitted to Loki. We should also have a metric to record the number of log entries that got ignored because they lacked a label. |
Thaks for the details @jpkrohling ! Understood So I agree, with a way to disable or configure the hardcoded values. About the metrics I thought the absence of labels would be monitored by |
That would be one case, but it would store all failures, not only the ones caused by not having any labels in the record. |
as part of #23863 I added new metric |
This issue was addressed by #23863 |
If you believe there's still anything pending for this, feel free to reopen or comment here. |
Component(s)
exporter/loki, pkg/translator/loki
Describe the issue you're reporting
Hello,
Working on a migration to the the recent Loki exporter, based on the pkg translator loki, which replace the initial version with some breaking changes, I'm wondering if the hardcoded label
exporter=OTLP
is not a conventional mistake.OTLP is the OpenTelemetry Protocol, but by using the Loki exporter I don't understand what that means.
Your source logs can come from many source, not necessarly OTLP, and the otel collector doesn't use the OTLP protocol to send logs to Loki so I don't understand. I would eventualy hardcode a label "exporter=OtelCollector" or something else, but OTLP is probably a conceptual mistake.
I'm also wondering if it makes completely sense to hardcode a label like that https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/translator/loki/convert.go#LL31C22-L31C22
Maybe the end user don't want to have a common arbitrary label to all the logs ?
It's not a problem in my case, but it seems not very flexible.
The text was updated successfully, but these errors were encountered: