kuberneteskubernetes-helmvictoriametrics

how do I add a label to all metrics collected by vmagent?


the task is to add the permanent label k8s_cluster=state to the help chart victoria-metrics-agent, I tried adding it via extraLabels, but it is added only to pod, deployment, etc. vmagent I use helm chart https://github.com/VictoriaMetrics/helm-charts


Solution

  • Have you tried configuring vmagent with the following flag:

    /path/to/vmagent -remoteWrite.label=k8s_cluster=state ...
    

    https://docs.victoriametrics.com/vmagent.html#adding-labels-to-metrics