opentelemetry-instrumentation-trilogy 0.56.2 → 0.57.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: '09504a134e2dbff7d4b256525dc3b3633de98e89badfd6776ab673c8eea9f2ee'
|
4
|
+
data.tar.gz: c33bef4cdb1a85edbd2060aa12e786efd379f67aee03ca0ef23a3d0141267c97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 695b8bfa62151a372159af269e5cc72a69d8c0ce8c336e9b07266cee91a090dbd7d6d8f01a07d6e4b3c95824ef39a19610d499866cc14f8a4452674b6ff965e7
|
7
|
+
data.tar.gz: 5be93ffc2130b07a722b95c61b0a6fc7572a03f4979b23bfed6ef13b34a77ccb08fea86241c716ac6289bc59141e2003479d493ae64ea73c20b0a43441a99ecc
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-trilogy
|
2
2
|
|
3
|
+
### v0.57.0 / 2023-10-27
|
4
|
+
|
5
|
+
* ADDED: Instrument connect and ping
|
6
|
+
|
7
|
+
### v0.56.3 / 2023-08-03
|
8
|
+
|
9
|
+
* FIXED: Remove inline linter rules
|
10
|
+
|
3
11
|
### v0.56.2 / 2023-07-14
|
4
12
|
|
5
13
|
* ADDED: `db.user` attribute (recommended connection-level attribute)
|
@@ -48,6 +48,28 @@ module OpenTelemetry
|
|
48
48
|
|
49
49
|
FULL_SQL_REGEXP = Regexp.union(MYSQL_COMPONENTS.map { |component| COMPONENTS_REGEX_MAP[component] })
|
50
50
|
|
51
|
+
def initialize(options = {})
|
52
|
+
@connection_options = options # This is normally done by Trilogy#initialize
|
53
|
+
|
54
|
+
tracer.in_span(
|
55
|
+
'connect',
|
56
|
+
attributes: client_attributes.merge!(OpenTelemetry::Instrumentation::Trilogy.attributes),
|
57
|
+
kind: :client
|
58
|
+
) do
|
59
|
+
super
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def ping(...)
|
64
|
+
tracer.in_span(
|
65
|
+
'ping',
|
66
|
+
attributes: client_attributes.merge!(OpenTelemetry::Instrumentation::Trilogy.attributes),
|
67
|
+
kind: :client
|
68
|
+
) do
|
69
|
+
super
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
51
73
|
def query(sql)
|
52
74
|
tracer.in_span(
|
53
75
|
database_span_name(sql),
|
@@ -60,10 +82,10 @@ module OpenTelemetry
|
|
60
82
|
|
61
83
|
private
|
62
84
|
|
63
|
-
def client_attributes(sql)
|
85
|
+
def client_attributes(sql = nil)
|
64
86
|
attributes = {
|
65
87
|
::OpenTelemetry::SemanticConventions::Trace::DB_SYSTEM => 'mysql',
|
66
|
-
::OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME => connection_options
|
88
|
+
::OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME => connection_options&.fetch(:host, 'unknown sock') || 'unknown sock'
|
67
89
|
}
|
68
90
|
|
69
91
|
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_NAME] = database_name if database_name
|
@@ -71,11 +93,13 @@ module OpenTelemetry
|
|
71
93
|
attributes[::OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = config[:peer_service] unless config[:peer_service].nil?
|
72
94
|
attributes['db.mysql.instance.address'] = @connected_host if defined?(@connected_host)
|
73
95
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
96
|
+
if sql
|
97
|
+
case config[:db_statement]
|
98
|
+
when :obfuscate
|
99
|
+
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT] = obfuscate_sql(sql)
|
100
|
+
when :include
|
101
|
+
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT] = sql
|
102
|
+
end
|
79
103
|
end
|
80
104
|
|
81
105
|
attributes
|
@@ -109,7 +133,7 @@ module OpenTelemetry
|
|
109
133
|
%r{'|"|\/\*|\*\/}.match(obfuscated)
|
110
134
|
end
|
111
135
|
|
112
|
-
def database_span_name(sql)
|
136
|
+
def database_span_name(sql)
|
113
137
|
case config[:span_name]
|
114
138
|
when :statement_type
|
115
139
|
extract_statement_type(sql)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-trilogy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.57.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-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: '2.5'
|
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: 2.
|
68
|
+
version: '2.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
187
|
+
version: 1.56.1
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
194
|
+
version: 1.56.1
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: simplecov
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,20 +240,6 @@ dependencies:
|
|
240
240
|
- - "~>"
|
241
241
|
- !ruby/object:Gem::Version
|
242
242
|
version: '0.9'
|
243
|
-
- !ruby/object:Gem::Dependency
|
244
|
-
name: yard-doctest
|
245
|
-
requirement: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - "~>"
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: 0.1.6
|
250
|
-
type: :development
|
251
|
-
prerelease: false
|
252
|
-
version_requirements: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - "~>"
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: 0.1.6
|
257
243
|
description: Adds auto instrumentation that includes SQL metadata
|
258
244
|
email:
|
259
245
|
- cncf-opentelemetry-contributors@lists.cncf.io
|
@@ -275,10 +261,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
275
261
|
licenses:
|
276
262
|
- Apache-2.0
|
277
263
|
metadata:
|
278
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.
|
264
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.57.0/file/CHANGELOG.md
|
279
265
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/trilogy
|
280
266
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
281
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.
|
267
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.57.0
|
282
268
|
post_install_message:
|
283
269
|
rdoc_options: []
|
284
270
|
require_paths:
|