diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb index 014f38ccd5..610bf5a5fc 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/instrumentation.rb @@ -20,7 +20,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit obfuscate include] + option :db_statement, default: :obfuscate, validate: %I[omit obfuscate include] private diff --git a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb index d426a4bf3b..512ba03599 100644 --- a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb +++ b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb @@ -28,7 +28,7 @@ describe 'tracing' do before do - instrumentation.install + instrumentation.install(db_statement: :include) end it 'accepts peer service name from config' do diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb index 3e85c3ff3d..9a7b78ccbc 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb @@ -20,7 +20,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit include obfuscate] + option :db_statement, default: :obfuscate, validate: %I[omit include obfuscate] option :span_name, default: :statement_type, validate: %I[statement_type db_name db_operation_and_name] option :obfuscation_limit, default: 2000, validate: :integer diff --git a/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb b/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb index e363980c73..6eb1ada726 100644 --- a/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb +++ b/instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb @@ -22,7 +22,7 @@ let(:instrumentation) { OpenTelemetry::Instrumentation::Mysql2::Instrumentation.instance } let(:exporter) { EXPORTER } let(:span) { exporter.finished_spans.first } - let(:config) { {} } + let(:config) { { db_statement: :include } } before do exporter.reset diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb index bf6a4dcdcd..2eeb6ac668 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb @@ -25,7 +25,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: %I[omit include obfuscate] + option :db_statement, default: :obfuscate, validate: %I[omit include obfuscate] option :obfuscation_limit, default: 2000, validate: :integer private diff --git a/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb b/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb index 57bef47975..2ffe68c2d4 100644 --- a/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb +++ b/instrumentation/pg/test/opentelemetry/instrumentation/pg/instrumentation_test.rb @@ -51,7 +51,8 @@ let(:user) { ENV.fetch('TEST_POSTGRES_USER', 'postgres') } let(:dbname) { ENV.fetch('TEST_POSTGRES_DB', 'postgres') } let(:password) { ENV.fetch('TEST_POSTGRES_PASSWORD', 'postgres') } - + let(:config) { { db_statement: :include } } + before do instrumentation.install(config) end