opentelemetry-instrumentation-trilogy 0.56.3 → 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: e7aa67e08b66f73cd642d5dcaa13122c6c9639b50c35eb224a0978c73c9be1e7
4
- data.tar.gz: 014a7d026c44f924a08e81d0c25d42132a114199efafa929aa1172786953fae7
3
+ metadata.gz: '09504a134e2dbff7d4b256525dc3b3633de98e89badfd6776ab673c8eea9f2ee'
4
+ data.tar.gz: c33bef4cdb1a85edbd2060aa12e786efd379f67aee03ca0ef23a3d0141267c97
5
5
  SHA512:
6
- metadata.gz: 7e4b68e200cae859e0117b0ee57e13c79946c52b0231e2a1a3476d43ddc1c6dda637c6af6556e805e2f66e378e92bb8a352c84ca586e6bc24939e32ca3740ae0
7
- data.tar.gz: 48a2bc454a232c530d72221ae134b71a3874ee83cd078ce35dd45c3fd9c16f52f76112e555e671333eb9e60a7a3dc4853c7b1bfae26fecefaa705bc1bf45e29c
6
+ metadata.gz: 695b8bfa62151a372159af269e5cc72a69d8c0ce8c336e9b07266cee91a090dbd7d6d8f01a07d6e4b3c95824ef39a19610d499866cc14f8a4452674b6ff965e7
7
+ data.tar.gz: 5be93ffc2130b07a722b95c61b0a6fc7572a03f4979b23bfed6ef13b34a77ccb08fea86241c716ac6289bc59141e2003479d493ae64ea73c20b0a43441a99ecc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-trilogy
2
2
 
3
+ ### v0.57.0 / 2023-10-27
4
+
5
+ * ADDED: Instrument connect and ping
6
+
3
7
  ### v0.56.3 / 2023-08-03
4
8
 
5
9
  * FIXED: Remove inline linter rules
@@ -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.fetch(:host, 'unknown sock')
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
- case config[:db_statement]
75
- when :obfuscate
76
- attributes[::OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT] = obfuscate_sql(sql)
77
- when :include
78
- attributes[::OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT] = sql
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
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Trilogy
10
- VERSION = '0.56.3'
10
+ VERSION = '0.57.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-trilogy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.3
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-08-03 00:00:00.000000000 Z
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.2.0
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.2.0
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.55.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.55.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.56.3/file/CHANGELOG.md
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.56.3
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: