Add port 9394 to docker-compose.yml for Prometheus exporter

This commit is contained in:
Eugene Burmakin 2024-11-20 21:05:02 +01:00
parent 55a575f87a
commit 342f025bf2
2 changed files with 13 additions and 14 deletions

View file

@ -3,21 +3,19 @@
Sidekiq.configure_server do |config|
config.redis = { url: ENV['REDIS_URL'] }
if ENV.fetch('PROMETHEUS_EXPORTER_ENABLED', false)
require 'prometheus_exporter/instrumentation'
require 'prometheus_exporter/instrumentation'
config.server_middleware do |chain|
chain.add PrometheusExporter::Instrumentation::Sidekiq
end
config.server_middleware do |chain|
chain.add PrometheusExporter::Instrumentation::Sidekiq
end
config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
config.on :startup do
PrometheusExporter::Instrumentation::Process.start type: 'sidekiq'
PrometheusExporter::Instrumentation::SidekiqProcess.start
PrometheusExporter::Instrumentation::SidekiqQueue.start
PrometheusExporter::Instrumentation::SidekiqStats.start
end
config.on :startup do
PrometheusExporter::Instrumentation::Process.start type: 'sidekiq'
PrometheusExporter::Instrumentation::SidekiqProcess.start
PrometheusExporter::Instrumentation::SidekiqQueue.start
PrometheusExporter::Instrumentation::SidekiqStats.start
end
end

View file

@ -45,6 +45,7 @@ services:
- dawarich
ports:
- 3000:3000
# - 9394:9394 # Prometheus exporter, uncomment if needed
stdin_open: true
tty: true
entrypoint: dev-entrypoint.sh
@ -65,8 +66,8 @@ services:
DISTANCE_UNIT: km
PHOTON_API_HOST: photon.komoot.io
PHOTON_API_USE_HTTPS: true
PROMETHEUS_EXPORTER_ENABLED: false
PROMETHEUS_EXPORTER_HOST: "0.0.0.0"
PROMETHEUS_EXPORTER_ENABLED: true
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
PROMETHEUS_EXPORTER_PORT: 9394
logging:
driver: "json-file"