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

Docs feedback: loki.process labels values don't support empty strings #1695

Open
jameshartig opened this issue Sep 17, 2024 · 0 comments
Open
Labels
type/docs Docs Squad label across all Grafana Labs repos

Comments

@jameshartig
Copy link

URL

https://grafana.com/docs/alloy/latest/reference/components/loki/loki.process/

Feedback

The docs suggest you can set an empty value in the values key/value map but that's not actually supported by the code.

stage.labels {
    values = {
      env  = "",         // Sets up an 'env' label, based on the 'env' extracted value.
      user = "username", // Sets up a 'user' label, based on the 'username' extracted value.
    }
}

The above code snippet from the docs suggest that an empty value implies using the key but the code does not do that. See

if lValue, ok := extracted[*lSrc]; ok {
and
if lValue, ok := labels[labelKey]; ok {
.

I would expect those to check for the value being empty but they're not.

@jameshartig jameshartig added the type/docs Docs Squad label across all Grafana Labs repos label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

No branches or pull requests

1 participant