Skip to content

Commit

Permalink
feat!: Update obfusaction limit
Browse files Browse the repository at this point in the history
This obfuscation limit matches what New Relic uses for their Ruby agent.
The previous 2000 limit seemed arbitrary.
  • Loading branch information
kaylareopelle committed Sep 6, 2024
1 parent 74ffb88 commit 3217b90
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helpers/sql-obfuscation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

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

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

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

0 comments on commit 3217b90

Please sign in to comment.