opentelemetry-instrumentation-mysql2 0.21.1 → 0.22.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 139dddefaff180304528b83c6fe468bc16334d8d79b9f3ce3008a341aec4c7fc
|
4
|
+
data.tar.gz: 22b7924ecb2b9e33404865a13bb755ecfda62ee2e90a5a62fc24df0530a971ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b632dd330fd5846e6d500990a8e38629e62b91040ab2f39f1d52d10a145af92076ee4ef6d2e8d10fb5decace8858d02cc070b256212f70cbb6d858bfa062b50a
|
7
|
+
data.tar.gz: b71616e71765cc3d1fcdb8a987db447e6f58511ef53a491fe7b377746d62880a8e178b93d01d10a6b01c3d7c4d1d955d48fb6e8cdec1b0371ed7b02348c4a47a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-mysql2
|
2
2
|
|
3
|
+
### v0.22.0 / 2023-01-14
|
4
|
+
|
5
|
+
* BREAKING CHANGE: Removed deprecated instrumentation options
|
6
|
+
|
7
|
+
* ADDED: Add option to configure span name
|
8
|
+
* ADDED: Removed deprecated instrumentation options
|
9
|
+
* DOCS: Fix gem homepage
|
10
|
+
* DOCS: More gem documentation fixes
|
11
|
+
|
3
12
|
### v0.21.1 / 2022-10-26
|
4
13
|
|
5
14
|
* FIXED: Handle encoding errors in mysql obfuscation
|
@@ -10,15 +10,7 @@ module OpenTelemetry
|
|
10
10
|
# The Instrumentation class contains logic to detect and install the Mysql2
|
11
11
|
# instrumentation
|
12
12
|
class Instrumentation < OpenTelemetry::Instrumentation::Base
|
13
|
-
install do |
|
14
|
-
if config[:enable_sql_obfuscation]
|
15
|
-
config[:db_statement] = :obfuscate
|
16
|
-
OpenTelemetry.logger.warn(
|
17
|
-
'Instrumentation mysql2 configuration option enable_sql_obfuscation has been deprecated,' \
|
18
|
-
'use db_statement option instead'
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
13
|
+
install do |_config|
|
22
14
|
require_dependencies
|
23
15
|
patch_client
|
24
16
|
end
|
@@ -28,8 +20,8 @@ module OpenTelemetry
|
|
28
20
|
end
|
29
21
|
|
30
22
|
option :peer_service, default: nil, validate: :string
|
31
|
-
option :enable_sql_obfuscation, default: false, validate: :boolean
|
32
23
|
option :db_statement, default: :include, validate: %I[omit include obfuscate]
|
24
|
+
option :span_name, default: :statement_type, validate: %I[statement_type db_name db_operation_and_name]
|
33
25
|
|
34
26
|
private
|
35
27
|
|
@@ -95,20 +95,23 @@ module OpenTelemetry
|
|
95
95
|
%r{'|"|\/\*|\*\/}.match(obfuscated)
|
96
96
|
end
|
97
97
|
|
98
|
-
def database_span_name(sql)
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
98
|
+
def database_span_name(sql) # rubocop:disable Metrics/CyclomaticComplexity
|
99
|
+
case config[:span_name]
|
100
|
+
when :statement_type
|
101
|
+
extract_statement_type(sql)
|
102
|
+
when :db_name
|
103
|
+
database_name
|
104
|
+
when :db_operation_and_name
|
105
|
+
op = OpenTelemetry::Instrumentation::Mysql2.attributes['db.operation']
|
106
|
+
name = database_name
|
107
|
+
if op && name
|
108
|
+
"#{op} #{name}"
|
109
|
+
elsif op
|
110
|
+
op
|
111
|
+
elsif name
|
112
|
+
name
|
113
|
+
end
|
114
|
+
end || 'mysql'
|
112
115
|
end
|
113
116
|
|
114
117
|
def database_name
|
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.
|
4
|
+
version: 0.22.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:
|
11
|
+
date: 2023-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.4'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '2.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.41.1
|
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.
|
166
|
+
version: 1.41.1
|
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-contrib
|
226
|
+
homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
227
227
|
licenses:
|
228
228
|
- Apache-2.0
|
229
229
|
metadata:
|
230
|
-
changelog_uri: https://
|
230
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.22.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://
|
233
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-mysql2/0.22.0
|
234
234
|
post_install_message:
|
235
235
|
rdoc_options: []
|
236
236
|
require_paths:
|