fastly / fastly-exporter

A Prometheus exporter for the Fastly Real-time Analytics API
Apache License 2.0
98 stars 36 forks source link

Add Token Expiration gauge metric #164

Closed leklund closed 6 months ago

leklund commented 6 months ago

New gauge metric: fastly_rt_token_expiration

Returns the expires_at timestamp of the FASTLY_API_TOKEN.

This addresses part of #146.

If the the metric is not in the blocklist, it will create a a TokenRecorder that has two methods: Gatherer() and Set()

Sample:

# HELP fastly_rt_token_expiration Unix timestamp of the expiration time of the Fastly API Token
# TYPE fastly_rt_token_expiration gauge
fastly_rt_token_expiration{token_id="token_id_1234",user_id="user_id_5678"} 1.721232155e+09