From fa9b8149b71feb97e88e753edf5bd2e9ce497cc3 Mon Sep 17 00:00:00 2001 From: zvkemp Date: Fri, 20 Dec 2024 13:32:59 -0500 Subject: [PATCH] expand metrics appraisal matrix --- instrumentation/sidekiq/Appraisals | 79 ++++++++++++++---------------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/instrumentation/sidekiq/Appraisals b/instrumentation/sidekiq/Appraisals index e9c13239d..2d92a17f7 100644 --- a/instrumentation/sidekiq/Appraisals +++ b/instrumentation/sidekiq/Appraisals @@ -1,46 +1,39 @@ # frozen_string_literal: true -appraise 'sidekiq-7.0' do - gem 'sidekiq', '~> 7.0' - - remove_gem 'opentelemetry-metrics-sdk' - remove_gem 'opentelemetry-metrics-api' -end - -appraise 'sidekiq-7.0-metrics-sdk' do - gem 'sidekiq', '~> 7.0' -end - -# explicitly test without SDK -appraise 'sidekiq-7.0-metrics-api' do - gem 'sidekiq', '~> 7.0' - - remove_gem 'opentelemetry-metrics-sdk' -end - -appraise 'sidekiq-6.5' do - gem 'sidekiq', '>= 6.5', '< 7.0' - remove_gem 'opentelemetry-metrics-api' - remove_gem 'opentelemetry-metrics-sdk' -end - -appraise 'sidekiq-6.0' do - gem 'sidekiq', '>= 6.0', '< 6.5' - gem 'redis', '< 4.8' - remove_gem 'opentelemetry-metrics-api' - remove_gem 'opentelemetry-metrics-sdk' -end - -appraise 'sidekiq-5.2' do - gem 'sidekiq', '~> 5.2' - gem 'redis', '< 4.8' - remove_gem 'opentelemetry-metrics-api' - remove_gem 'opentelemetry-metrics-sdk' -end - -appraise 'sidekiq-4.2' do - gem 'sidekiq', '~> 4.2' - gem 'redis', '< 4.8' - remove_gem 'opentelemetry-metrics-api' - remove_gem 'opentelemetry-metrics-sdk' +{ + 'sidekiq-7' => [['sidekiq', '~> 7.0']], + 'sidekiq-6.5' => [['sidekiq', '>= 6.5', '< 7.0']], + 'sidekiq-6.0' => [ + ['sidekiq', '>= 6.0', '< 6.5'], + ['redis', '< 4.8'] + ], + 'sidekiq-5.2' => [ + ['sidekiq', '~> 5.2'], + ['redis', '< 4.8'] + ], + 'sidekiq-4.2' => [ + ['sidekiq', '~> 4.2'], + ['redis', '< 4.8'] + ] +}.each do |gemfile_name, specs| + appraise gemfile_name do + specs.each do |spec| + gem *spec + remove_gem 'opentelemetry-metrics-api' + remove_gem 'opentelemetry-metrics-sdk' + end + end + + appraise "#{gemfile_name}-metrics-api" do + specs.each do |spec| + gem *spec + remove_gem 'opentelemetry-metrics-sdk' + end + end + + appraise "#{gemfile_name}-metrics-sdk" do + specs.each do |spec| + gem *spec + end + end end