lib/opentelemetry/instrumentation/pg/instrumentation.rb in opentelemetry-instrumentation-pg-0.19.2 vs lib/opentelemetry/instrumentation/pg/instrumentation.rb in opentelemetry-instrumentation-pg-0.20.0
- old
+ new
@@ -35,18 +35,22 @@
present do
defined?(::PG)
end
compatible do
- Gem.loaded_specs['pg'].version > Gem::Version.new(MINIMUM_VERSION)
+ gem_version > Gem::Version.new(MINIMUM_VERSION)
end
option :peer_service, default: nil, validate: :string
option :enable_sql_obfuscation, default: false, validate: :boolean
option :enable_statement_attribute, default: true, validate: :boolean
- option :db_statement, default: :include, validate: ->(opt) { %I[omit include obfuscate].include?(opt) }
+ option :db_statement, default: :include, validate: %I[omit include obfuscate]
private
+
+ def gem_version
+ Gem::Version.new(::PG::VERSION)
+ end
def require_dependencies
require_relative 'patches/connection'
end