diff --git a/config/env.example.optional b/config/env.example.optional index 6a0b37b6e..293f03ea7 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -246,6 +246,12 @@ REDIS_SIDEKIQ_MASTER='master_name' REDIS_SIDEKIQ_PASSWORD='sentinel_and_redis_password' REDIS_SIDEKIQ_USERNAME='sentinel_and_redis_username' +# configuration for prometheus metrics web server +# launched with sidekiq +PROMETHEUS_EXPORTER_BIND="0.0.0.0" +PROMETHEUS_EXPORTER_PORT="9394" +PROMETHEUS_EXPORTER_ENABLED="disabled" + # Setup log level, info if nil # can be debug, info, warn, error, fatal, and unknown DS_LOG_LEVEL='info' diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 2a9bca8ef..f1ccf9ab1 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -16,6 +16,11 @@ if ENV.has_key?('REDIS_SIDEKIQ_SENTINELS') role: :master } + if ENV['PROMETHEUS_EXPORTER_ENABLED'] == 'enabled' + Yabeda.configure! + Yabeda::Prometheus::Exporter.start_metrics_server! + end + if ENV['SKIP_RELIABLE_FETCH'].blank? Sidekiq::ReliableFetch.setup_reliable_fetch!(config) end