Grafana Agent Operator PodLogs CR to config generation improperly marshaling sub-stages #6570
Labels
bug
Something isn't working
needs-attention
An issue or PR has been sitting around and needs attention.
variant/operator
Related to Grafana Agent Static Operator.
Discussed in #6551
Originally posted by tmarshall98 February 28, 2024
Hello, I am attempting to setup a custom pipeline in the Grafana Agent PodLogs pipelineStages.
Here is my current CR definition. I am getting logs into Loki from containers on my cluster without issue, but I noticed that the
sub-stages inside matches is actually getting lost inside the grafana-agent config in the pods
I started investigating how the config secret gets generated for the operator and found myself in the jsonnet files.
the Match.stages key, which is a string, is getting parsed by
marshal.intoStages(spec.Match.Stages)
hereThis is then calling the native function by the same name
intoStages
hereThis function is assuming that
stages
is aPipelineStageSpec
, which appears to be lacking the additional stage types, such as logfmt and static_labelsThe loki version of this is a not even a static struct: https://github.com/grafana/loki/blob/c39786bd516c1839c4e698c7bed29573eeedca2b/clients/pkg/logentry/stages/stage.go#L137
The text was updated successfully, but these errors were encountered: