Skip to content

Conversation

Nastaliss
Copy link

Purpose

Add prometheus metrics that get pushed to a Prometheus pushgateway on success.

Proposal

By default, the script uses the SelfCheckMetricsBase class as its metrics collector, that does not do anything on start, stop, etc.
If the Prometheus env variables are defined, the metrics collector will use SelfCheckPrometheusMetrics that extends SelfCheckMetricsBase and will update its metrics and push them to the pushgateway on exit.

This allows users to extend the MetricsBase class to integrate their own system, as well as having a single if clause that does not render the rest of the code unreadable.

@Nastaliss Nastaliss marked this pull request as draft August 19, 2025 16:39
@sylvinus
Copy link
Member

LGTM, I imagine we'll refactor this if we have many more prom integrations elsewhere in Messages but OK as a first step!

@Nastaliss Nastaliss marked this pull request as ready for review August 22, 2025 08:41
for better grepability
@Nastaliss Nastaliss merged commit e5147e1 into selfcheck Aug 22, 2025
9 checks passed
@Nastaliss Nastaliss deleted the selfcheck-prometheus branch August 22, 2025 08:45
@Nastaliss
Copy link
Author

LGTM, I imagine we'll refactor this if we have many more prom integrations elsewhere in Messages but OK as a first step!

Definitely, although this one is a bit special as it's pushing in a PushGateway and not exposing metrics as we'll do in the backend

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.

2 participants