operator icon indicating copy to clipboard operation
operator copied to clipboard

Feature: Option to add clusterName for VMAgent

Open micw opened this issue 3 years ago • 1 comments

I'm running VMAgent on all of my clusters and send to a central monitoring. Currently I need to add the cluster name to every agent as extra label. It would be great if the agent could do this automatically (so that I do not need to specify the cluster name for each cluster manually).

micw avatar Feb 14 '22 11:02 micw

There is special setting - vmAgentExternalLabelName, it adds given label name (prometheus by default), to each series scrapped by vmagent with name of VMAgent CR. It's possible to define it as:

kind: VMAgent
metadata:
   name: east-prod-dc
spec:
  vmAgentExternalLabelName: cluster

in this case, all metrics scrapped by agent get label - cluster: east-prod-dc.

It looks like, this setting must be also added to the ingested metrics to vmagent by push clients, but it's not implemented yet.

f41gh7 avatar Feb 14 '22 13:02 f41gh7