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

require prometheus client libs in mail_fetcher #2327

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

richardTowers
Copy link
Contributor

This is job is currently erroring in all environments, albeit after it's already done all the important work.

{"@timestamp":"2024-09-16T13:05:05.605Z","message":"Finished running MailFetcher in production mode - 2024-09-16 13:05:05 UTC","level":"INFO","tags":["rails"]}
	script/mail_fetcher:58:in `<main>': uninitialized constant Prometheus::Client::Push (NameError)
	Prometheus::Client::Push.new(

Note the "Finished running MailFetcher in production mode" log before the error

  • the script has still done everything it needs to, it just hasn't sent the metrics, which fortunately is on the very last line of the script.

This looks like the same mistake I made when doing metrics for publishing-api:

https://github.com/alphagov/publishing-api/commit/30374578660e126bd49e3654ebe0ebf3ce2a3dff

We need to explicitly require the push library to use it. I'm not 100% sure if we really need the other two imports (client and registry), but publishing-api has them, so we may as well be consistent. Can't hurt, surely.

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

Follow these steps if you are doing a Rails upgrade.

This is job is currently erroring in all environments, albeit after it's
already done all the important work.

    {"@timestamp":"2024-09-16T13:05:05.605Z","message":"Finished running MailFetcher in production mode - 2024-09-16 13:05:05 UTC","level":"INFO","tags":["rails"]}
		script/mail_fetcher:58:in `<main>': uninitialized constant Prometheus::Client::Push (NameError)
		Prometheus::Client::Push.new(

Note the "Finished running MailFetcher in production mode" log before the error
- the script has still done everything it needs to, it just hasn't sent the
metrics, which fortunately is on the very last line of the script.

This looks like the same mistake I made when doing metrics for publishing-api:

    alphagov/publishing-api@3037457

We need to explicitly require the push library to use it. I'm not 100% sure if
we really need the other two imports (client and registry), but publishing-api
has them, so we may as well be consistent. Can't hurt, surely.
@richardTowers richardTowers merged commit 4a90ae2 into main Sep 16, 2024
14 checks passed
@richardTowers richardTowers deleted the fix-metrics branch September 16, 2024 13:20
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