From 3217b9046698dc92377d5354a62a5db6fbd056b4 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Fri, 6 Sep 2024 10:07:51 -0700 Subject: [PATCH] feat!: Update obfusaction limit This obfuscation limit matches what New Relic uses for their Ruby agent. The previous 2000 limit seemed arbitrary. --- helpers/sql-obfuscation/README.md | 2 +- .../lib/opentelemetry/helpers/sql_obfuscation.rb | 2 +- .../lib/opentelemetry/instrumentation/mysql2/instrumentation.rb | 2 +- .../pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb | 2 +- .../opentelemetry/instrumentation/trilogy/instrumentation.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/sql-obfuscation/README.md b/helpers/sql-obfuscation/README.md index 1e86bacdf..c518d1b08 100644 --- a/helpers/sql-obfuscation/README.md +++ b/helpers/sql-obfuscation/README.md @@ -26,7 +26,7 @@ end Make sure the `Instrumentation` class for your gem contains configuration options for: - `:obfuscation_limit`: the length at which the obfuscated SQL string will be truncated. - Example: `option :obfuscation_limit, default: 2000, validate: :integer` + Example: `option :obfuscation_limit, default: 16384, validate: :integer` If you want to add support for a new adapter, update the following constants to include keys for your adapter: diff --git a/helpers/sql-obfuscation/lib/opentelemetry/helpers/sql_obfuscation.rb b/helpers/sql-obfuscation/lib/opentelemetry/helpers/sql_obfuscation.rb index a09025102..a773d99ef 100644 --- a/helpers/sql-obfuscation/lib/opentelemetry/helpers/sql_obfuscation.rb +++ b/helpers/sql-obfuscation/lib/opentelemetry/helpers/sql_obfuscation.rb @@ -20,7 +20,7 @@ module Helpers # `option :db_statement, default: :include, validate: %I[omit include obfuscate]` # * `:obfuscation_limit` # Example: - # `option :obfuscation_limit, default: 2000, validate: :integer` + # `option :obfuscation_limit, default: 16384, validate: :integer` # # If you want to add support for a new adapter, update the following # constants to include keys for your adapter: diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb index 9a7b78ccb..8fe5569de 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/instrumentation.rb @@ -22,7 +22,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base option :peer_service, default: nil, validate: :string 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 + option :obfuscation_limit, default: 16384, validate: :integer private diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb index 2eeb6ac66..d4b76db91 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/instrumentation.rb @@ -26,7 +26,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base option :peer_service, default: nil, validate: :string option :db_statement, default: :obfuscate, validate: %I[omit include obfuscate] - option :obfuscation_limit, default: 2000, validate: :integer + option :obfuscation_limit, default: 16384, validate: :integer private diff --git a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/instrumentation.rb b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/instrumentation.rb index 684fbe660..88e706a1d 100644 --- a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/instrumentation.rb +++ b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/instrumentation.rb @@ -26,7 +26,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base option :peer_service, default: nil, validate: :string 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 + option :obfuscation_limit, default: 16384, validate: :integer option :propagator, default: nil, validate: :string attr_reader :propagator