chore(yabeda): use webrick and check enabled flag
This commit is contained in:
parent
3dbb2266d2
commit
fcbd3d94d1
4 changed files with 10 additions and 1 deletions
|
@ -192,3 +192,5 @@ La compatibilité est testée par Browserstack.<br>[<img src="app/assets/images/
|
|||
[![View performance data on Skylight](https://badges.skylight.io/status/zAvWTaqO0mu1.svg)](https://oss.skylight.io/app/applications/zAvWTaqO0mu1)
|
||||
|
||||
Nous utilisons Skylight pour suivre les performances de notre application.
|
||||
|
||||
Par ailleurs, nous utilisons [Yabeda](https://github.com/yabeda-rb/yabeda) pour exporter des metriques au format prometheus. L'activation se fait via la variable d'environnement `PROMETHEUS_EXPORTER_ENABLED` voir config/env.example.optional .
|
||||
|
|
|
@ -2,5 +2,9 @@
|
|||
|
||||
require_relative "config/environment"
|
||||
|
||||
if ENV['PROMETHEUS_EXPORTER_ENABLED'] == 'enabled'
|
||||
Yabeda::Prometheus::Exporter.start_metrics_server!
|
||||
end
|
||||
|
||||
run Rails.application
|
||||
Rails.application.load_server
|
||||
|
|
|
@ -244,7 +244,7 @@ REDIS_SIDEKIQ_PASSWORD='sentinel_and_redis_password'
|
|||
REDIS_SIDEKIQ_USERNAME='sentinel_and_redis_username'
|
||||
|
||||
# configuration for prometheus metrics web server
|
||||
# launched with sidekiq
|
||||
# launched with sidekiq and puma
|
||||
PROMETHEUS_EXPORTER_BIND="0.0.0.0"
|
||||
PROMETHEUS_EXPORTER_PORT="9394"
|
||||
PROMETHEUS_EXPORTER_ENABLED="disabled"
|
||||
|
|
3
config/initializers/prometheus_metrics.rb
Normal file
3
config/initializers/prometheus_metrics.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
if ENV['PROMETHEUS_EXPORTER_ENABLED'] == 'enabled' && !Sidekiq.server?
|
||||
Prometheus::Client.config.data_store = Prometheus::Client::DataStores::DirectFileStore.new(dir: Rails.root.join('tmp', 'prometheus'))
|
||||
end
|
Loading…
Reference in a new issue