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

Set prometheus scrape port for workers #110

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

RMcVelia
Copy link
Contributor

Context

When enabling prometheus monitoring for a deployment, the "prometheus.io/port" is hardcoded to the web_port
This is the wrong port for sidekiq workers

Changes proposed in this pull request

Update terraform to use the sidekiq port if not is_web
Could have made it optional to pass the port to the module, but I'm only currently aware of sidekiq workers requiring scraping.

Guidance to review

Currently DFE-Digital/schools-experience#3236 has been deployed from this branch, and metrics are being loaded to prometheus.

Checklist

  • I have performed a self-review of my code, including formatting and typos
  • I have cleaned the commit history
  • I have added the Devops label
  • I have attached the pull request to the trello card

@@ -9,7 +9,7 @@ locals {
prometheus_scrape_annotations = var.enable_prometheus_monitoring ? {
"prometheus.io/scrape" = "true"
"prometheus.io/path" = "/metrics"
"prometheus.io/port" = var.web_port
"prometheus.io/port" = var.is_web ? var.web_port : 9394
Copy link
Member

Choose a reason for hiding this comment

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

Can we create a worker_port variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@RMcVelia RMcVelia force-pushed the 1889-scrape-custom-metrics branch from e5c12f2 to 23af94e Compare July 11, 2024 12:20
@RMcVelia RMcVelia force-pushed the 1889-scrape-custom-metrics branch from 23af94e to aacddbd Compare July 11, 2024 13:00
@RMcVelia RMcVelia merged commit 7ffc46f into main Jul 12, 2024
3 checks passed
@RMcVelia RMcVelia deleted the 1889-scrape-custom-metrics branch July 12, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants