deckhouse / k8s-image-availability-exporter

Alert if an image used in Kubernetes cannot be pulled from container registry
Apache License 2.0
211 stars 25 forks source link

Use labels instead of separate metrics #127

Closed tony2001 closed 6 months ago

tony2001 commented 6 months ago

Currently there is a separate set of similar metrics for each deployment kind: k8s_image_availability_exportercronjob k8s_image_availability_exporterdaemonset k8s_image_availability_exporterdeployment k8s_image_availability_exporterstatefulset

So to monitor missing images I have to use 4 different queries instead of one. Why not simplify it by using a kind label instead?

nabokihms commented 6 months ago

Hello, @tony2001. Thanks for opening a PR.

This will be a breaking change, but I don't hesitate to accept.

  1. The README.md file should be changed accordingly.
  2. There are prometheus rules in the chart that use metric names in queries.
  3. Could you please sign your commit with the following command? git rebase HEAD~1 --signoff

P.S. This is a surprise for me that we do not have unit tests for metrics. It would be cool if you could add one, but I understand that for this PR it is out of scope.

tony2001 commented 6 months ago

OK, check it out again pls.

nabokihms commented 6 months ago

@tony2001 thank you for the contribution.