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

feat: expose jwt exp date as metric #77

Merged
merged 3 commits into from
Jan 22, 2024
Merged

feat: expose jwt exp date as metric #77

merged 3 commits into from
Jan 22, 2024

Conversation

rafalgalaw
Copy link
Collaborator

@rafalgalaw rafalgalaw commented Jan 22, 2024

Parses jwt and exposes expiry date to prometheus like the following:

garm_operator_info_jwt_expires_at{controller="garm_operator"} 1.737204962e+09

With a grafana field override, the gauge value can be visualized like so:
image

@rafalgalaw rafalgalaw marked this pull request as ready for review January 22, 2024 10:12
@rafalgalaw rafalgalaw linked an issue Jan 22, 2024 that may be closed by this pull request
Copy link
Member

@bavarianbidi bavarianbidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i really ❤️ this - just few small nits

pkg/client/client.go Outdated Show resolved Hide resolved
pkg/client/client.go Outdated Show resolved Hide resolved
pkg/client/client.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
@rafalgalaw rafalgalaw merged commit e021ad7 into main Jan 22, 2024
3 checks passed
@rafalgalaw rafalgalaw deleted the feat/jwt-metrics branch January 22, 2024 19:35
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

Successfully merging this pull request may close these issues.

Expose garms JWT auth token ExpiresAt property as metric
2 participants