node-cert-exporter icon indicating copy to clipboard operation
node-cert-exporter copied to clipboard

[Feature] Add support for configuring labels emitted in metrics

Open costasd opened this issue 3 years ago • 0 comments

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

costasd avatar Sep 23 '22 11:09 costasd