diff --git a/lib/govuk_app_config/govuk_prometheus_exporter.rb b/lib/govuk_app_config/govuk_prometheus_exporter.rb index 2ed34af5..e24308cb 100644 --- a/lib/govuk_app_config/govuk_prometheus_exporter.rb +++ b/lib/govuk_app_config/govuk_prometheus_exporter.rb @@ -1,6 +1,9 @@ module GovukPrometheusExporter def self.should_configure - if File.basename($PROGRAM_NAME) == "rake" || + # Allow us to force the Prometheus Exporter for persistent Rake tasks... + if ENV["GOVUK_PROMETHEUS_EXPORTER"] == "force" + true + elsif File.basename($PROGRAM_NAME) == "rake" || defined?(Rails) && (Rails.const_defined?("Console") || Rails.env == "test") false else