opentelemetry-instrumentation-mysql2 0.21.0 → 0.21.1

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: 4289cd2222f7e02809e775d1ebe4201fb87abbdd3eca443230c6b3d82ff338d2
4
- data.tar.gz: 67e7e40dac313faac5fc2be2ed7638868c729516b869e5721c26ce16ddaba2fc
3
+ metadata.gz: 72d506d7b5ea829dc35ee0f90a02a0ed2231b895204016a806e45a9561f4bce1
4
+ data.tar.gz: 41d0788f8de74f287a736cf4e70fa106d6963391bb5561a82bd48bb2432e1041
5
5
  SHA512:
6
- metadata.gz: 4c8768bcc3400a86832cdce83a82e390ec9cbe4f614a76621a108e5f28971e824781c4e08848177c3af9cae4bd662539c4845767aaf27fcb6a484ebb513fe45b
7
- data.tar.gz: 141513bd59aec67545022a4369d0e437760687d36c36ccfb0795c7e00595810beba59c1af45cfa3ec81af4faa03bc7f9d1214d7871d194ff7e9e234cd00cee8b
6
+ metadata.gz: 13c5fad74e52b3865b6d9366820be142ac778326cd8e6156ad9899b8f3ba92964797bc727fb2504f654ed4cb37c38472496958dfd4647d1b0ef6be55a8834c63
7
+ data.tar.gz: 13837ce27d7519f1671a74539faa7b9fa13faea8a36bb96b48af806f9b9c8d6f7ce03b7dbb00fb4ab3d4dee120e655457176f1ba001dbba57e8aaa3f7f96c209
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-mysql2
2
2
 
3
+ ### v0.21.1 / 2022-10-26
4
+
5
+ * FIXED: Handle encoding errors in mysql obfuscation
6
+
3
7
  ### v0.21.0 / 2022-06-09
4
8
 
5
9
  * Upgrading Base dependency version
data/README.md CHANGED
@@ -55,7 +55,7 @@ end
55
55
 
56
56
  ## Examples
57
57
 
58
- An example of usage can be seen in [`example/mysql2.rb`](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/mysql2/example/mysql2.rb).
58
+ An example of usage can be seen in [`example/mysql2.rb`](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/mysql2/example/mysql2.rb).
59
59
 
60
60
  ## How can I get involved?
61
61
 
@@ -70,7 +70,7 @@ The `opentelemetry-instrumentation-mysql2` gem is distributed under the Apache 2
70
70
  [mysql2-home]: https://github.com/brianmario/mysql2
71
71
  [bundler-home]: https://bundler.io
72
72
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
73
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
73
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
74
74
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
75
75
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
76
76
  [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -9,7 +9,7 @@ module OpenTelemetry
9
9
  module Mysql2
10
10
  module Patches
11
11
  # Module to prepend to Mysql2::Client for instrumentation
12
- module Client
12
+ module Client # rubocop:disable Metrics/ModuleLength
13
13
  QUERY_NAMES = [
14
14
  'set names',
15
15
  'select',
@@ -73,10 +73,13 @@ module OpenTelemetry
73
73
  if sql.size > 2000
74
74
  'SQL query too large to remove sensitive data ...'
75
75
  else
76
- obfuscated = sql.gsub(generated_mysql_regex, '?')
76
+ obfuscated = OpenTelemetry::Common::Utilities.utf8_encode(sql, binary: true)
77
+ obfuscated = obfuscated.gsub(generated_mysql_regex, '?')
77
78
  obfuscated = 'Failed to obfuscate SQL query - quote characters remained after obfuscation' if detect_unmatched_pairs(obfuscated)
78
79
  obfuscated
79
80
  end
81
+ rescue StandardError
82
+ 'OpenTelemetry error: failed to obfuscate sql'
80
83
  end
81
84
 
82
85
  def generated_mysql_regex
@@ -142,6 +145,7 @@ module OpenTelemetry
142
145
  QUERY_NAME_RE.match(sql) { |match| match[1].downcase } unless sql.nil?
143
146
  rescue StandardError => e
144
147
  OpenTelemetry.logger.debug("Error extracting sql statement type: #{e.message}")
148
+ nil
145
149
  end
146
150
  end
147
151
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Mysql2
10
- VERSION = '0.21.0'
10
+ VERSION = '0.21.1'
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.21.0
4
+ version: 0.21.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-10-26 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: 0.73.0
159
+ version: 1.3.0
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: 0.73.0
166
+ version: 1.3.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -223,14 +223,14 @@ files:
223
223
  - lib/opentelemetry/instrumentation/mysql2/instrumentation.rb
224
224
  - lib/opentelemetry/instrumentation/mysql2/patches/client.rb
225
225
  - lib/opentelemetry/instrumentation/mysql2/version.rb
226
- homepage: https://github.com/open-telemetry/opentelemetry-ruby
226
+ homepage: https://github.com/open-telemetry/opentelemetry-contrib
227
227
  licenses:
228
228
  - Apache-2.0
229
229
  metadata:
230
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.21.0/file.CHANGELOG.html
231
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/mysql2
232
- bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
233
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.21.0
230
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-mysql2/v0.21.1/file.CHANGELOG.html
231
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/mysql2
232
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
233
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-mysql2/v0.21.1
234
234
  post_install_message:
235
235
  rdoc_options: []
236
236
  require_paths: