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

Push fact check metrics to prometheus #2269

Merged
merged 3 commits into from
Sep 13, 2024
Merged

Conversation

richardTowers
Copy link
Contributor

@richardTowers richardTowers commented Aug 1, 2024

Inspired by alphagov/search-api-v2#209

This adds the prometheus-client gem, and then uses it to send fact check emails metrics to prometheus via the pushgateway.

We can't use the conventional prometheus collector, because this code runs as a script, rather than a web process.

This should not be merged until we've set the PROMETHEUS_PUSHGATEWAY_URL environment variable. (edit: this is already set automatically for all apps)

In terms of testing this, we could probably just deploy this branch to integration, then see whether we can see the new metric in prometheus, then put some broken emails in the inbox (?) and see if the count goes up?

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

Inspired by alphagov/search-api-v2#209

This adds the prometheus-client gem, and then uses it to send fact check emails metrics to prometheus via the pushgateway.

We can't use the conventional prometheus collector, because this code runs as a script, rather than a web process.

This should not be merged until we've set the PROMETHEUS_PUSHGATEWAY_URL environment variable.
The job name should really be the same for all metrics published by this
_thing_. We currently have publisher (for the web app) and
publisher-worker for the worker. I think publisher-metrics is probably a
good job name for these specificly metricsy things.
@Tetrino Tetrino merged commit 7c3f0ce into main Sep 13, 2024
12 checks passed
@Tetrino Tetrino deleted the custom-prometheus-metrics branch September 13, 2024 10:54
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