Closed bingkunyangvungle closed 3 months ago
Could this be because the labels contain dots? Prometheus labels are quite strict with what characters are allowed in them. Could you try a label such as io_kubernetes_container_name
?
Thank you @ptodev , I just tried with your suggestion io_kubernetes_container_name
and it still returns error:
Error: /etc/alloy/config.alloy:82:37: component "io_kubernetes_container_name" does not exist or is out of scope
81 | store_container_labels = false
82 | allowlisted_container_labels = [io_kubernetes_container_name]
| ^
83 | }
Not sure what this one was. And it's not in the doc as we.
You're missing the quotation marks :)
allowlisted_container_labels = ["io_kubernetes_container_name"]
Oh my, this is the cause. Really appreciate for your help! @ptodev
The issue resolves. But the metrics doesn't appear neither. Still need more investigation.
Hi @bingkunyangvungle, out of curiosity - how did you resolve the issue?
URL
https://github.com/grafana/alloy/blob/9f6bc3a1ab553fd25c439dab1b148cb0736e59ba/docs/sources/reference/components/prometheus.exporter.cadvisor.md
Feedback
I'm currently using
prometheus.exporter.cadvisor "cadvisor"
to get the related metrics. The metric can show up, but when I was trying to add the labels using the following configuration:The label doesn't show up in the metrics. I've already set this:
store_container_labels = false
because in the doc, it mentioned:Could anyone help to look into this and provide some guideline? Thank you.