Skip to content

Convert gauges into metrics - #136

Open
jannikluhn wants to merge 2 commits into
mainfrom
chore/metrics-counters
Open

Convert gauges into metrics#136
jannikluhn wants to merge 2 commits into
mainfrom
chore/metrics-counters

Conversation

@jannikluhn

Copy link
Copy Markdown
Contributor

Closes #134

TotalSuccessfulIdentityRegistration, TotalDecryptionKeysReceived and
TotalFailedRPCCalls are only ever incremented, so Counter is the correct
type. Series names are unchanged, so existing queries keep working, and
rate() over them is now legitimate rather than an accident.
Prometheus counters carry _total as a suffix, not a prefix, and the
plural belongs on the thing being counted:

  shutter_api_total_successful_identities_registration
    -> shutter_api_successful_identity_registrations_total
  shutter_api_total_decryption_keys_received
    -> shutter_api_decryption_keys_received_total
  shutter_api_total_failed_rpc_calls
    -> shutter_api_failed_rpc_calls_total

Go identifiers drop their now-redundant Total prefix to match. Existing
series keep their history under the old names but stop being written to,
so any dashboard or alert rule querying them needs updating.
Comment thread metrics/metrics.go
prometheus.MustRegister(TotalFailedRPCCalls)
prometheus.MustRegister(SuccessfulIdentityRegistrations)
prometheus.MustRegister(DecryptionKeysReceived)
prometheus.MustRegister(FailedRPCCalls)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This alert will be impacted if we add this change: https://github.com/shutter-network/keyper-metrics/blob/main/config/vmalert/alerts.rules.yaml#L23 if you could please open an issue/PR to fix it, thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, issue and PR

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.

Convert gauge metrics into counters

2 participants