Skip to content

Commit

Permalink
Ignore reporting signon permission token expiry metrics
Browse files Browse the repository at this point in the history
Tokens for the signon permissions users are automatically rotated once
they expire, so we don't need to trigger alerts for them.
  • Loading branch information
theseanything committed Oct 6, 2023
1 parent 4a30c14 commit c79c39a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/collectors/global_prometheus_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def metrics
def token_expiry_info
# Cache metric to prevent needless expensive calls to the database
Rails.cache.fetch("token_expiry_info", expires_in: 1.hour) do
ApiUser.all.flat_map do |user|
ApiUser.where.not(email: SSOPushCredential::USER_EMAIL).flat_map do |user|
user.authorisations.where(revoked_at: nil).map do |token|
{
expires_at: token.expires_at.to_i,
Expand Down

0 comments on commit c79c39a

Please sign in to comment.