opentelemetry-instrumentation-mysql2 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ea7871c2d5272a19f91159b2b9f72e07e265fed7dd673c03b3ef2c7506aed62
4
- data.tar.gz: 49579a5b7030b8fd8e19900158ad8438ed91a2f9188e8d1e4ee2799503f72f4a
3
+ metadata.gz: e5556a962e40c18ff1e4c02618b9772bb6a9708bbcfa4867c62924118bfdf1de
4
+ data.tar.gz: 856f5881c0c843902bf79b38969f9dc20e9286719ebccde33c4155a2f4b06e54
5
5
  SHA512:
6
- metadata.gz: d762f5106fd527d7f4dfc43830bb6ad7fc46cb7944e8b2468888fe77078c39a3764836149124760c04a8738c9840ec028f34f54899ab5a33dba99b66cadb02d5
7
- data.tar.gz: 3e55e547de48c4b2132d4a95023627a8d1a96b0a5f7ee38c3bc565548b541c8da8f2f64817cc636b7de830642a931899b47860939e290d3cbcda7e26b244bc06
6
+ metadata.gz: 36a64234a88f39e07e957721e434633db8636c86467a457fe298492100c9c36f465b37aa36ee4f6a7b37d3747bb1df7c338077514b27e41f867697e19f1dda78
7
+ data.tar.gz: 6c8f6ffa8a510838c2c559da473b57edd7024d21696bcc143a8bfad6eb6ccba86e021a11cb6b8e9a6deee56ee4dab711274685a3e6bd3792ac6b7fa7e861e44c
data/CHANGELOG.md CHANGED
@@ -1,29 +1,33 @@
1
1
  # Release History: opentelemetry-instrumentation-mysql2
2
2
 
3
+ ### v0.24.0 / 2023-05-25
4
+
5
+ * ADDED: Add config[:obfuscation_limit] to pg and mysql2
6
+
3
7
  ### v0.23.0 / 2023-04-17
4
8
 
5
- * BREAKING CHANGE: Drop support for EoL Ruby 2.7
9
+ * BREAKING CHANGE: Drop support for EoL Ruby 2.7
6
10
 
7
- * ADDED: Drop support for EoL Ruby 2.7
8
- * FIXED: Ensure encoding errors handled during SQL obfuscation for Trilogy
11
+ * ADDED: Drop support for EoL Ruby 2.7
12
+ * FIXED: Ensure encoding errors handled during SQL obfuscation for Trilogy
9
13
 
10
14
  ### v0.22.0 / 2023-01-14
11
15
 
12
- * BREAKING CHANGE: Removed deprecated instrumentation options
16
+ * BREAKING CHANGE: Removed deprecated instrumentation options
13
17
 
14
- * ADDED: Add option to configure span name
15
- * ADDED: Removed deprecated instrumentation options
16
- * DOCS: Fix gem homepage
17
- * DOCS: More gem documentation fixes
18
+ * ADDED: Add option to configure span name
19
+ * ADDED: Removed deprecated instrumentation options
20
+ * DOCS: Fix gem homepage
21
+ * DOCS: More gem documentation fixes
18
22
 
19
23
  ### v0.21.1 / 2022-10-26
20
24
 
21
- * FIXED: Handle encoding errors in mysql obfuscation
25
+ * FIXED: Handle encoding errors in mysql obfuscation
22
26
 
23
27
  ### v0.21.0 / 2022-06-09
24
28
 
25
29
  * Upgrading Base dependency version
26
- * FIXED: Broken test file requirements
30
+ * FIXED: Broken test file requirements
27
31
 
28
32
  ### v0.20.1 / 2022-05-03
29
33
 
@@ -31,7 +35,7 @@
31
35
 
32
36
  ### v0.20.0 / 2021-12-01
33
37
 
34
- * ADDED: Add default options config helper + env var config option support
38
+ * ADDED: Add default options config helper + env var config option support
35
39
 
36
40
  ### v0.19.1 / 2021-09-29
37
41
 
@@ -39,11 +43,11 @@
39
43
 
40
44
  ### v0.19.0 / 2021-08-12
41
45
 
42
- * BREAKING CHANGE: Add option for db.statement
46
+ * BREAKING CHANGE: Add option for db.statement
43
47
 
44
- * ADDED: Add option for db.statement
45
- * DOCS: Update docs to rely more on environment variable configuration
46
- * DOCS: Move to using new db_statement
48
+ * ADDED: Add option for db.statement
49
+ * DOCS: Update docs to rely more on environment variable configuration
50
+ * DOCS: Move to using new db_statement
47
51
 
48
52
  ### v0.18.1 / 2021-06-23
49
53
 
@@ -22,6 +22,7 @@ module OpenTelemetry
22
22
  option :peer_service, default: nil, validate: :string
23
23
  option :db_statement, default: :include, validate: %I[omit include obfuscate]
24
24
  option :span_name, default: :statement_type, validate: %I[statement_type db_name db_operation_and_name]
25
+ option :obfuscation_limit, default: 2000, validate: :integer
25
26
 
26
27
  private
27
28
 
@@ -30,6 +30,7 @@ module OpenTelemetry
30
30
 
31
31
  QUERY_NAME_RE = Regexp.new("^(#{QUERY_NAMES.join('|')})", Regexp::IGNORECASE)
32
32
 
33
+ # From: https://github.com/newrelic/newrelic-ruby-agent/blob/0235b288d85b8bc795bdc1a24621dd9f84cfef45/lib/new_relic/agent/database/obfuscation_helpers.rb#L9-L34
33
34
  COMPONENTS_REGEX_MAP = {
34
35
  single_quotes: /'(?:[^']|'')*?(?:\\'.*|'(?!'))/,
35
36
  double_quotes: /"(?:[^"]|"")*?(?:\\".*|"(?!"))/,
@@ -70,8 +71,9 @@ module OpenTelemetry
70
71
  private
71
72
 
72
73
  def obfuscate_sql(sql)
73
- if sql.size > 2000
74
- 'SQL query too large to remove sensitive data ...'
74
+ if sql.size > config[:obfuscation_limit]
75
+ truncated_sql = sql[..sql.index(generated_mysql_regex) - 1]
76
+ truncated_sql + "...\nSQL truncated (> #{config[:obfuscation_limit]} characters)"
75
77
  else
76
78
  obfuscated = OpenTelemetry::Common::Utilities.utf8_encode(sql, binary: true)
77
79
  obfuscated = obfuscated.gsub(generated_mysql_regex, '?')
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Mysql2
10
- VERSION = '0.23.0'
10
+ VERSION = '0.24.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.48.1
159
+ version: 1.50.2
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.48.1
166
+ version: 1.50.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -227,10 +227,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
227
227
  licenses:
228
228
  - Apache-2.0
229
229
  metadata:
230
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.23.0/file/CHANGELOG.md
230
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.24.0/file/CHANGELOG.md
231
231
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/mysql2
232
232
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
233
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.23.0
233
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.24.0
234
234
  post_install_message:
235
235
  rdoc_options: []
236
236
  require_paths: