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

stage.json of loki.process cannot have hyphen (-) in the expressions value #5838

Closed
pschiffe opened this issue Nov 22, 2023 · 2 comments · Fixed by #6082
Closed

stage.json of loki.process cannot have hyphen (-) in the expressions value #5838

pschiffe opened this issue Nov 22, 2023 · 2 comments · Fixed by #6082
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. type/docs Docs Squad label across all Grafana Labs repos

Comments

@pschiffe
Copy link

What's wrong?

This is actually a bug in the jmespath/go-jmespath - jmespath/go-jmespath#58
but I wanted to bring it to your attention as well, as it was hard to debug

Workaround for me is to define it like this:

    stage.json {
      expressions = {
        http_user_agent = "\"request_User-Agent\"",
      }
    }

Steps to reproduce

Try to load the provided config.

System information

6.5.10-200.fc38.aarch64

Software version

grafana-agent-flow-0.38.0-1.aarch64

Configuration

loki.process "enrich" {
  forward_to = [loki.write.default.receiver]

  stage.match {
    selector = "{container=\"traefik\"}"

    stage.json {
      expressions = {
        http_user_agent = "request_User-Agent",
      }
    }
  }
}

Logs

Error: /etc/grafana-agent-flow.river:308:1: Failed to build component: building component: invalid stage config invalid stage config could not compile JMES expression: SyntaxError: Unexpected token at the end of the expression: tNumber: match stage failed to create pipeline from config: {{container="traefik"} [{<nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> 0x4002ab7618 <nil> <nil> <nil> <nil> <nil>} {<nil> <nil> <nil> <nil> <nil> <nil> 0x4002bf4768 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil>} {<nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> 0x4002ab7638 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil>}] keep  }
@pschiffe pschiffe added the bug Something isn't working label Nov 22, 2023
Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@github-actions github-actions bot added the needs-attention An issue or PR has been sitting around and needs attention. label Dec 23, 2023
@tpaschalis
Copy link
Member

Thanks for the report and explanation @pschiffe, much appreciated!

Since the issue has a workaround and there doesn't seem to be any fix candidates upstream, I'm going to label this as a docs issue and add the necessary documentation for any future visitors.

@tpaschalis tpaschalis added type/docs Docs Squad label across all Grafana Labs repos and removed bug Something isn't working needs-attention An issue or PR has been sitting around and needs attention. labels Jan 9, 2024
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants