lib/opentelemetry/instrumentation/active_job/instrumentation.rb in opentelemetry-instrumentation-active_job-0.1.5 vs lib/opentelemetry/instrumentation/active_job/instrumentation.rb in opentelemetry-instrumentation-active_job-0.2.0

- old
+ new

@@ -19,11 +19,11 @@ present do defined?(::ActiveJob) end compatible do - Gem.loaded_specs['activejob'].version >= MINIMUM_VERSION + gem_version >= MINIMUM_VERSION end ## Supported configuration keys for the install config hash: # # span_naming: when `:job_class`, the span names will be set to @@ -50,14 +50,18 @@ # # Note that when using the `:inline` ActiveJob queue adapter, then execution # spans will always be children of the enqueueing spans. This is due to the way # ActiveJob immediately executes jobs during the process of "enqueueing" jobs when # using the `:inline` adapter. - option :propagation_style, default: :link, validate: ->(opt) { %i[link child none].include?(opt) } + option :propagation_style, default: :link, validate: %i[link child none] option :force_flush, default: false, validate: :boolean - option :span_naming, default: :queue, validate: ->(opt) { %i[job_class queue].include?(opt) } + option :span_naming, default: :queue, validate: %i[job_class queue] private + + def gem_version + ::ActiveJob.version + end def require_dependencies require_relative 'patches/base' require_relative 'patches/active_job_callbacks' end