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

[Feature] Add support for configuring labels emitted in metrics #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

costasd
Copy link
Contributor

@costasd costasd commented Sep 23, 2022

In environments with lots of nodes or lots of certificates (or both), emitting all labels might prove problematic due to the increased cardinality.

To keep cardinality under control, this commit introduces a way to configure which labels should be emitted, by introducing a new command line switch, --include-labels.

Examples:

$ ./bin/node-cert-exporter ... --include-labels alg,path,subject

$ ./bin/node-cert-exporter ... --include-labels alg --include-labels path

- What I did
Introduced a new switch that allows for choosing which labels emitted metrics should have.

- How I did it
New switch, conditionals in exporter.go

- How to verify it

  • tests are included to ensure filtering inside exporter's New() works
  • manually with and without using the --include-labels switch, which should show the presence of absence of labels.

- Description for the CHANGELOG
Configurable labels in metrics are now possible

In environments with lots of nodes or lots of certificates (or both),
emitting all labels might prove problematic due to the increased cardinality.

To keep cardinality under control, this commit introduces a way to configure
which labels should be emitted, by introducing a new command line switch,
`--include-labels`.

Examples:
```
$ ./bin/node-cert-exporter ... --include-labels alg,path,subject

$ ./bin/node-cert-exporter ... --include-labels alg --include-labels path
```

Signed-off-by: Costas Drogos <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant