Closed brpaz closed 3 years ago
Hi, the issue is likely the default configs for collecting from Kubernetes. -config.expand-env
will replace anything in the form ${<something>}
, which includes the relabel configs used to collect metrics from nodes:
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
replacement: /api/v1/nodes/${1}/proxy/metrics
This will be replaced with the empty string instead of the node name, which will break the scrape jobs. Change the instances of ${1}
to $1
, restart the Agent (or call /-/reload if you're running >0.14.0), and you should start to see metrics again.
This has confused me a couple of times too :)
(You can also use $${1}
in the config to escape it from being expanded but that would stop working if you turned off -config.expand-env
. $1
works for both as long as long as the character after the 1
isn't alphanumeric, like the slash in this expample.)
@rfratto ah, that makes sense. I will test that on the weekend and will close this issue then, if it works.
Thank you.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Hello. I have deployed Grafana Agent into a Kubernetes cluster and I am pushing metrics to Grafana cloud. I was trying to remove the credentials stored into the Config file, stored as config map, and found out that I use could envrionment variables, that would be replaced at runtime by the agent with the correct values.
I follow the instructions to set the
-config.expand-env=true
flag, but after set it the agent just stop sending metrics to Grafana Cloud. I haven´t done anything more. I have remove the flag, the metrics start appearing again:I don´t see any error log on the agent pod.
Probably I am doing a very basic mistake, but can´t figure what.
Here is my deployment manifest:
And the agent config (without any envrionment variables interpolation yet:
Agent logs: