Skip to content

Commit

Permalink
Fix recursive call with prometheus_exporter and opentelemetry instrum…
Browse files Browse the repository at this point in the history
…entation

This switches prometheus_exporter's method patching to use `prepend`
instead of `alias_method`. Prepend is negligibly slower than
alias_method, but is more compatible other libraries.
  • Loading branch information
theseanything committed Jul 4, 2023
1 parent ff06080 commit 13c1fe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/govuk_app_config/govuk_prometheus_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.configure
server.start

if defined?(Rails)
Rails.application.middleware.unshift PrometheusExporter::Middleware
Rails.application.middleware.unshift PrometheusExporter::Middleware, instrument: :prepend
end

if defined?(Sinatra)
Expand Down

0 comments on commit 13c1fe1

Please sign in to comment.