mkoertgen / azure-app-exporter

Exposing Prometheus Metrics for Azure App Registration useful for alerting on expiring Service Principal Credentials.
Apache License 2.0
4 stars 4 forks source link

fix: Clear registry before updating it with new values to clear remov… #12

Closed dploeger closed 2 months ago

dploeger commented 5 months ago

…ed credentials

Fixes #11

mkoertgen commented 4 months ago

Thanks for the contribution @dploeger.

A small question for my understanding: When clearing the expired metrics on any observe we will probably lose track of old apps. I guess this is no problem when we rely on prometheus scraping the endpoint frequently enough, right?

dploeger commented 4 months ago

A small question for my understanding: When clearing the expired metrics on any observe we will probably lose track of old apps. I guess this is no problem when we rely on prometheus scraping the endpoint frequently enough, right?

Yes, exactly. In my view, exporters are only responsible to return the current state of things. Prometheus is responsible for storing history.