-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] Auto replace labels with dot to underscore #14113
Comments
Pinging code owners: @gramidt @jpkrohling. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This is absolutely needed, especially with the change between the Legacy Exporter & the New Exporter and the way hints are now set by the Attributes Processor, whereas previously you could do dot to underscore label mapping in the Legacy Exporter. |
@mar4uk, can you keep this on your radar? |
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 Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi, something similar to BTW: there is already a translator to convert from OpenTelemetry naming convention into Prometheus (here Loki) naming convention cf. https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/translator/prometheus |
+1 We can add it. I guess, we would keep it behind some config parameter and not make it default behavior? |
If Loki doesn't accept labels that contain dots, in which scenario would you need to send labels with dots? I cannot rule out that I am reading the description correctly. |
@kovrus, didn't we have this translation already in the past? Did it get lost? |
@kago-dk - Loki doesn't accept label index mappings with Adding in the auto-conversion option would effectively remove the necessity of having to relabel all your necessary attributes/labels. So basically I'm 🙏 over here for this to be added :) |
In the legacy exporter, we used the attributes mapping as part of the exporter config to create loki labels.
I am actually hesitating now about supporting this feature. It would require a major config change, also I guess, it would make sense to control what loki labels should be created, so exclude/include filters probably would have to be added as well, etc. Also, changing attribute names (replacing |
FYI We also use the hints approach (using the attributes processor) to provide tenant information to the exporter. |
I agree, @kovrus. Besides, Loki may end up supporting dots in the future, causing yet another breaking change for this exporter. I'd stick with explicit vs. implicit here. |
I want to see if we can revisit this. I don't see And even if it does support it, we still have to support the existing users of Loki that haven't or cannot upgrade.
Could you give an example? The best I can get to is the following: Without Transform processor
With Transform Processor:
(I couldn't find how to do "insert" with OTTL). Again, this is from me reading the docs but I couldn't find a simpler way to do it. While this is smaller, its only by a bit and its just as cumbersome as before. If I want to do 6 labels in Loki, I have to manually escape them and specify the config. |
Hi, I synced with @kovrus offline and we decided to support this usecase. We will escape |
Hi @gouthamve, great news that you will support automatic escape of |
That is a more risky thing to support as it could lead to massive cardinality. However, given a resource is more or less stable, I am inclined to consider it. Could you open a new issue for this so we can have a discussion there? |
@mar4uk would like to take it over, so it is assigned to her now. |
Loki doesn't support label names containing dots. Added label names normalization to follow Prometheus label names standard. Dots in label names will be converted to underscores before sending them to Loki Link to tracking Issue: #14113 --------- Co-authored-by: Evan Bradley <[email protected]>
This seems to have been done. I'm closing, if anything is still pending let me know and I'll reopen. |
Is your feature request related to a problem? Please describe.
Loki doesn`t accept labels that contains dots, so I have to duplicate my attributes via processors copying the value from attribute with dot to other attribute with underscore.
Ex:
host.name
copy to ->host_name
Describe the solution you'd like
Would be nice if the str replace happens automatically by the lokiexporter
Describe alternatives you've considered
No response
Additional context
@jpkrohling
The text was updated successfully, but these errors were encountered: