Skip to content

Commit

Permalink
Require sidekiq/api in GovukPrometheusExporter
Browse files Browse the repository at this point in the history
The workers were erroring with:
```
PrometheusExporter::Instrumentation::SidekiqProcess Prometheus Exporter Failed
To Collect Stats uninitialized constant Sidekiq::Process
PrometheusExporter::Instrumentation::SidekiqQueue Prometheus Exporter Failed To
Collect Stats uninitialized constant Sidekiq::Queue
PrometheusExporter::Instrumentation::SidekiqStats Prometheus Exporter Failed To
Collect Stats uninitialized constant Sidekiq::Stats
```

and failing to send metrics following a switch from Statsd to Prometheus Exporter:
alphagov/govuk_sidekiq@763144d

Sidekiq::Process, Sidekiq::Queue, Sidekiq::Stats are defined in Sidekiq API. It
appears that to get access to the functionality the API needs to be required
See https://github.com/sidekiq/sidekiq/wiki/API
  • Loading branch information
AgaDufrat committed Jun 15, 2023
1 parent 4e13e83 commit c19c381
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/govuk_app_config/govuk_prometheus_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def self.configure

if defined?(Sidekiq)
Sidekiq.configure_server do |config|
require "sidekiq/api"
require "prometheus_exporter/instrumentation"
config.server_middleware do |chain|
chain.add PrometheusExporter::Instrumentation::Sidekiq
Expand Down

0 comments on commit c19c381

Please sign in to comment.