Skip to content

Commit

Permalink
bfuscation for mysql2, dalli and pg
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi committed Oct 4, 2023
1 parent 02473de commit 9c89751
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c89751

Please sign in to comment.