opentelemetry-instrumentation-trilogy 0.66.0 → 0.67.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb6da13cf4aba703e0f5c80dd0aafe2eb2f9d3367413f434ddd6e8e2d3145b6b
|
|
4
|
+
data.tar.gz: de10bd80bbcf263dcdcc38d68210ef644eb4f104f58ce2ca6872f886dc6b060e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed6a4158667fe8608fa6c024903e9f5781c17f68a8c4ef766c8e40ed923c1d76af12443ffe746db651339f0b4ec9d3f724bd26da77888e2c9d7d69c33b0585df
|
|
7
|
+
data.tar.gz: 218472b391df80e9ac2c6701d68a27173832a45000307b4eb4bb92c30cacb9b004cda8ee419790b7bfa73328ba6bc6e9cedbe877d95194bf9739a440e9a7d080
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Release History: opentelemetry-instrumentation-trilogy
|
|
2
2
|
|
|
3
|
+
### v0.67.0 / 2026-03-17
|
|
4
|
+
|
|
5
|
+
* ADDED: Cache static span attributes in Trilogy instrumentation (#2089)
|
|
6
|
+
|
|
3
7
|
### v0.66.0 / 2026-01-13
|
|
4
8
|
|
|
5
9
|
* ADDED: Add SQL Comment Propagator
|
|
@@ -15,7 +19,6 @@
|
|
|
15
19
|
### v0.64.0 / 2025-10-22
|
|
16
20
|
|
|
17
21
|
* BREAKING CHANGE: Min Ruby Version 3.2
|
|
18
|
-
|
|
19
22
|
* ADDED: Min Ruby Version 3.2
|
|
20
23
|
|
|
21
24
|
### v0.63.1 / 2025-09-30
|
|
@@ -37,7 +40,6 @@
|
|
|
37
40
|
### v0.61.0 / 2025-01-16
|
|
38
41
|
|
|
39
42
|
* BREAKING CHANGE: Set minimum supported version to Ruby 3.1
|
|
40
|
-
|
|
41
43
|
* ADDED: Set minimum supported version to Ruby 3.1
|
|
42
44
|
|
|
43
45
|
### v0.60.0 / 2024-09-12
|
|
@@ -15,6 +15,8 @@ module OpenTelemetry
|
|
|
15
15
|
module Client
|
|
16
16
|
def initialize(options = {})
|
|
17
17
|
@connection_options = options # This is normally done by Trilogy#initialize
|
|
18
|
+
@_otel_database_name = connection_options&.dig(:database)
|
|
19
|
+
@_otel_base_attributes = _build_otel_base_attributes.freeze
|
|
18
20
|
|
|
19
21
|
tracer.in_span(
|
|
20
22
|
'connect',
|
|
@@ -38,18 +40,16 @@ module OpenTelemetry
|
|
|
38
40
|
end
|
|
39
41
|
|
|
40
42
|
def query(sql)
|
|
43
|
+
context_attributes = OpenTelemetry::Instrumentation::Trilogy.attributes
|
|
44
|
+
|
|
41
45
|
tracer.in_span(
|
|
42
46
|
OpenTelemetry::Helpers::MySQL.database_span_name(
|
|
43
47
|
sql,
|
|
44
|
-
OpenTelemetry::
|
|
45
|
-
|
|
46
|
-
],
|
|
47
|
-
database_name,
|
|
48
|
+
context_attributes[OpenTelemetry::SemanticConventions::Trace::DB_OPERATION],
|
|
49
|
+
@_otel_database_name,
|
|
48
50
|
config
|
|
49
51
|
),
|
|
50
|
-
attributes: client_attributes(sql).merge!(
|
|
51
|
-
OpenTelemetry::Instrumentation::Trilogy.attributes
|
|
52
|
-
),
|
|
52
|
+
attributes: client_attributes(sql).merge!(context_attributes),
|
|
53
53
|
kind: :client,
|
|
54
54
|
record_exception: config[:record_exception]
|
|
55
55
|
) do |_span, context|
|
|
@@ -67,15 +67,23 @@ module OpenTelemetry
|
|
|
67
67
|
|
|
68
68
|
private
|
|
69
69
|
|
|
70
|
-
def
|
|
70
|
+
def _build_otel_base_attributes
|
|
71
|
+
database_user = connection_options&.dig(:username)
|
|
72
|
+
|
|
71
73
|
attributes = {
|
|
72
74
|
::OpenTelemetry::SemanticConventions::Trace::DB_SYSTEM => 'mysql',
|
|
73
75
|
::OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME => connection_options&.fetch(:host, 'unknown sock') || 'unknown sock'
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_NAME] =
|
|
78
|
+
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_NAME] = @_otel_database_name if @_otel_database_name
|
|
77
79
|
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_USER] = database_user if database_user
|
|
78
80
|
attributes[::OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = config[:peer_service] unless config[:peer_service].nil?
|
|
81
|
+
attributes
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def client_attributes(sql = nil)
|
|
85
|
+
attributes = @_otel_base_attributes.dup
|
|
86
|
+
|
|
79
87
|
attributes['db.instance.id'] = @connected_host unless @connected_host.nil?
|
|
80
88
|
|
|
81
89
|
if sql
|
|
@@ -91,14 +99,6 @@ module OpenTelemetry
|
|
|
91
99
|
attributes
|
|
92
100
|
end
|
|
93
101
|
|
|
94
|
-
def database_name
|
|
95
|
-
connection_options[:database]
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def database_user
|
|
99
|
-
connection_options[:username]
|
|
100
|
-
end
|
|
101
|
-
|
|
102
102
|
def tracer
|
|
103
103
|
Trilogy::Instrumentation.instance.tracer
|
|
104
104
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.67.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenTelemetry Authors
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: opentelemetry-helpers-mysql
|
|
@@ -101,11 +100,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
|
101
100
|
licenses:
|
|
102
101
|
- Apache-2.0
|
|
103
102
|
metadata:
|
|
104
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.
|
|
103
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.67.0/file/CHANGELOG.md
|
|
105
104
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/trilogy
|
|
106
105
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
|
107
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.
|
|
108
|
-
post_install_message:
|
|
106
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.67.0
|
|
109
107
|
rdoc_options: []
|
|
110
108
|
require_paths:
|
|
111
109
|
- lib
|
|
@@ -120,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
120
118
|
- !ruby/object:Gem::Version
|
|
121
119
|
version: '0'
|
|
122
120
|
requirements: []
|
|
123
|
-
rubygems_version:
|
|
124
|
-
signing_key:
|
|
121
|
+
rubygems_version: 4.0.3
|
|
125
122
|
specification_version: 4
|
|
126
123
|
summary: Trilogy instrumentation for the OpenTelemetry framework
|
|
127
124
|
test_files: []
|