Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global_tags annotation #82

Open
mkmik opened this issue Feb 15, 2022 · 3 comments
Open

Add global_tags annotation #82

mkmik opened this issue Feb 15, 2022 · 3 comments

Comments

@mkmik
Copy link
Contributor

mkmik commented Feb 15, 2022

Oftentimes you don't need a brand new class. All you want is to add a common tag to all the metrics emitted by a given pod.

Proposal

annotations:
  telegraf.influxdata.com/global-tag-literal-region: us-east1
  telegraf.influxdata.com/global-tag-fieldref-ns: metadata.namespace
  telegraf.influxdata.com/global-tag-configmapkeyref-foo: bar.baz

equivalent to use this generated config:

    [global_tags]
      region = "us-east1"
      ns = "myns"
      foo = "quz"

(the implementation may choose to use some intermediate env vars if so desired)

@mkmik
Copy link
Contributor Author

mkmik commented Feb 16, 2022

from a quick peek in the sources I noticed that technically the telegraf.influxdata.com/inputs annotation can be abused to inject a [global_tags] snippet, however this doesn't work well when the "class" configs already contain a the global_tags.

A first class feature telegraf.influxdata.com/global-tag-... feature should be able to merge the global tags from the "system" config with the tags defined by the pod annotation.

@mkmik
Copy link
Contributor Author

mkmik commented Feb 16, 2022

(@cbos I see you did something similar in spirit in in #75, perhaps you'll find this useful)

@cbos
Copy link
Contributor

cbos commented Feb 16, 2022

@mkmik Thanks for the notification, this is indeed a useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants