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

Provide earliest and latest expiry date for graph apps #14

Open
mblaschke opened this issue Mar 23, 2022 · 3 comments
Open

Provide earliest and latest expiry date for graph apps #14

mblaschke opened this issue Mar 23, 2022 · 3 comments

Comments

@mblaschke
Copy link
Member

Would make queries easier to check when an app secret/cert is expiring

@deggja
Copy link

deggja commented Jan 5, 2023

Hello @mblaschke,

Thanks for all the awesome exporters. I'm an avid user of the Log Analytics exporter that you guys created.

I'm testing the Resource manager exporter now. It is working but I am having some trouble understanding what kind of data I am actually exporting.

My goal: to be able to extract the expiry date of service principals in Azure Active Directory.

I am targeting Graph data by disabling all other scraping and running it with --scrape.time.graph to remove all the unnecessary data. I get the values outputted to localhost:8080 on the /metrics endpoint, but in the following format (redacted credentials from output):

azurerm_graph_app_credential{appAppID="redacted",credentialID="redacted",credentialName="service-principal-test",credentialType="password",type="startDate"} 1.364265162e+02

Is there any way to extract the actual date for the expiry with this exporter or am I expecting too much?

@mblaschke
Copy link
Member Author

mblaschke commented Jan 15, 2023

what about using max by (appAppID) (azurerm_graph_app_credential{type="startDate"})?

the startDate/endDate is provided as unix timestamp, you can convert it easily in Grafana to datetime but when i remember correcly Grafana uses milliseconds where Prometheus is normally using seconds you have to convert (metric * 1000) the metric value.

if you want a relative time (eg "expiring in") you have use time() - azurerm_graph_app_credential.

@deggja
Copy link

deggja commented Jan 16, 2023


what about using max by (appAppID) (azurerm_graph_app_credential{type="startDate"})?

the startDate/endDate is provided as unix timestamp, you can convert it easily in Grafana to datetime but when i remember correcly Grafana uses milliseconds where Prometheus is normally using seconds you have to convert (metric * 1000) the metric value.

if you want a relative time (eg "expiring in") you have use time() - azurerm_graph_app_credential.

Perfect - that works.

Thanks @mblaschke !

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