opentelemetry-helpers-mysql 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9d42a7d0833fbf6224f6435bb9bee23ef24830ccaefe1e7bf5b4f187b3b25aa
4
- data.tar.gz: ccd8299a58f64ddd09bcb6b3569274e28f165bc62e657f629dee487cfb588749
3
+ metadata.gz: 35a3692a554b75d3c3f77984f3a89cffc6eb40a265204e6c43b0baaf347c3a96
4
+ data.tar.gz: 3520b64c00ad6e95cceb8e91f5205f846c2ed683560066147eb7df95f65e89cd
5
5
  SHA512:
6
- metadata.gz: 0672230d8bde59e344cfaa0bd3f35322458ea6e484823d95919ebcc10cc0bb00ac3c02078218ca2b8a597a0645512fdee2244e0b88d6504e28fde40fd031e1cc
7
- data.tar.gz: '037259bf659728563dbc62d5b3a62d91ffebb67baa166380acd166e44e606a413219f4eba14c7568f9d2c35fa195d31539aa6ef7e5a050b69a6f8e763749b648'
6
+ metadata.gz: e4b37f0a30f25c66926675c41743e69be7c2d69bb7e20420a4a9ccbf6ec1b2f8136ad088fb57d8d42f4290ba342056d47dae1f1c7ee29d473b0ad9d7667de049
7
+ data.tar.gz: 4a722436fa2227a8f94271a039f5ffd9c57963895b6385c3961acc93c7fdfe00c89f798cd7916ed98d7bea261e4c8ffb8ae4968e2e4b4ed289c30392369b5a10
data/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
- # Release History: opentelemetry-helpers-mysql
1
+ # Release History: opentelemetry-helpers-mysql
2
+
3
+ ### v0.5.0 / 2026-03-17
4
+
5
+ * ADDED: Optimize extract_statement_type regex and encoding in helpers-mysql (#2088)
6
+
7
+ ### v0.4.0 / 2025-10-22
8
+
9
+ * BREAKING CHANGE: Min Ruby Version 3.2
10
+ * ADDED: Min Ruby Version 3.2
2
11
 
3
12
  ### v0.3.0 / 2025-09-30
4
13
 
@@ -7,7 +16,6 @@
7
16
  ### v0.2.0 / 2025-01-16
8
17
 
9
18
  * BREAKING CHANGE: Set minimum supported version to Ruby 3.1
10
-
11
19
  * ADDED: Set minimum supported version to Ruby 3.1
12
20
 
13
21
  ### v0.1.2 / 2024-11-26
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenTelemetry Instrumentation Helpers: MySQL
2
2
 
3
- This Ruby gem contains logic shared among MySQL adapter libraries, such as mysql2 and trilogy. It's intended for use by by gem authors instrumenting MySQL adapter libraries.
3
+ This Ruby gem contains logic shared among MySQL adapter libraries, such as mysql2 and trilogy. It's intended for use by gem authors instrumenting MySQL adapter libraries.
4
4
 
5
5
  ## Usage
6
6
 
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Helpers
9
9
  module MySQL
10
- VERSION = '0.3.0'
10
+ VERSION = '0.5.0'
11
11
  end
12
12
  end
13
13
  end
@@ -42,7 +42,7 @@ module OpenTelemetry
42
42
  # Ignore query names that might appear in comments prepended to the
43
43
  # statement.
44
44
  PREPENDED_COMMENTS_REGEX = %r{(?:\/\*.*?\*\/)}m
45
- QUERY_NAME_REGEX = Regexp.new("^\s*(?:#{PREPENDED_COMMENTS_REGEX})?\s*\\b(#{QUERY_NAMES.join('|')})\\b.*", Regexp::IGNORECASE)
45
+ QUERY_NAME_REGEX = Regexp.new("^\s*(?:#{PREPENDED_COMMENTS_REGEX})?\s*\\b(#{QUERY_NAMES.join('|')})\\b", Regexp::IGNORECASE)
46
46
 
47
47
  # This is a span naming utility intended for use in MySQL database
48
48
  # adapter instrumentation.
@@ -68,9 +68,11 @@ module OpenTelemetry
68
68
 
69
69
  # @api private
70
70
  def extract_statement_type(sql)
71
- sql = OpenTelemetry::Common::Utilities.utf8_encode(sql, binary: true)
71
+ return unless sql
72
72
 
73
- QUERY_NAME_REGEX.match(sql) { |match| match[1].downcase } unless sql.nil?
73
+ sql = OpenTelemetry::Common::Utilities.utf8_encode(sql, binary: true) unless sql.encoding == ::Encoding::UTF_8 && sql.valid_encoding?
74
+
75
+ QUERY_NAME_REGEX.match(sql) { |match| match[1].downcase }
74
76
  rescue StandardError => e
75
77
  OpenTelemetry.handle_error(message: 'Error extracting SQL statement type', exception: e)
76
78
  nil
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-helpers-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-09-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: opentelemetry-api
@@ -57,10 +56,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
57
56
  licenses:
58
57
  - Apache-2.0
59
58
  metadata:
60
- changelog_uri: https://rubydoc.info/gems/opentelemetry-helpers-mysql/0.3.0/file/CHANGELOG.md
59
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-helpers-mysql/0.5.0/file/CHANGELOG.md
61
60
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/helpers/mysql
62
61
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
63
- documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-mysql/0.3.0
62
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-mysql/0.5.0
64
63
  post_install_message: ''
65
64
  rdoc_options: []
66
65
  require_paths:
@@ -69,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
68
  requirements:
70
69
  - - ">="
71
70
  - !ruby/object:Gem::Version
72
- version: '3.1'
71
+ version: '3.2'
73
72
  required_rubygems_version: !ruby/object:Gem::Requirement
74
73
  requirements:
75
74
  - - ">="
76
75
  - !ruby/object:Gem::Version
77
76
  version: '0'
78
77
  requirements: []
79
- rubygems_version: 3.3.27
80
- signing_key:
78
+ rubygems_version: 4.0.3
81
79
  specification_version: 4
82
80
  summary: MySQL Instrumentation Helpers for the OpenTelemetry framework
83
81
  test_files: []