From 13c1fe1eb3a89b1027871505c15009c1d47afd0e Mon Sep 17 00:00:00 2001 From: Sean Rankine Date: Tue, 4 Jul 2023 09:40:36 +0100 Subject: [PATCH 1/2] Fix recursive call with prometheus_exporter and opentelemetry instrumentation 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. --- lib/govuk_app_config/govuk_prometheus_exporter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/govuk_app_config/govuk_prometheus_exporter.rb b/lib/govuk_app_config/govuk_prometheus_exporter.rb index aa3a271..d72321d 100644 --- a/lib/govuk_app_config/govuk_prometheus_exporter.rb +++ b/lib/govuk_app_config/govuk_prometheus_exporter.rb @@ -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) From ad306e98d03188e41330f5ca60af4e2b830613a1 Mon Sep 17 00:00:00 2001 From: Sean Rankine Date: Tue, 4 Jul 2023 09:53:57 +0100 Subject: [PATCH 2/2] Bump version 8.1.1 --- CHANGELOG.md | 4 ++++ lib/govuk_app_config/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 041f34d..3b87ca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.1.1 + +* Fix prometheus_exporter to method patching compatible with open telemetry. + # 8.1.0 * Add ability to enable Open Telemetry instrumentation for Rails applications. diff --git a/lib/govuk_app_config/version.rb b/lib/govuk_app_config/version.rb index 5cb54b3..b89202b 100644 --- a/lib/govuk_app_config/version.rb +++ b/lib/govuk_app_config/version.rb @@ -1,3 +1,3 @@ module GovukAppConfig - VERSION = "8.1.0".freeze + VERSION = "8.1.1".freeze end