opentelemetry-instrumentation-graphql 0.26.7 → 0.27.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: e3ee635af1f62a05846c78d64428fa90b5ac8f1261b90be335d6f02b8de7584b
|
4
|
+
data.tar.gz: 631182b40fa00d6e7fdd042c4b1bfa9f20f3128e305970c96ff202351620330a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af62b6f0ac50d37da5345ed03fc706b15a9ed86030f85d7bd2e1361062d8dd4a400fc842b826f6995b23341a2a5f7b71a7ca119f077c036a12ce947d41a3b04
|
7
|
+
data.tar.gz: c1450b329869c2194a14983da27c98c1389a64aea06300ac9a5815745cfa4e84e0ff1125d98c732e3d1a9b37f658b21165f283eeeef90dfcf8c6df822bcfa2d9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-graphql
|
2
2
|
|
3
|
+
### v0.27.0 / 2023-11-28
|
4
|
+
|
5
|
+
* CHANGED: Performance optimization cache attribute hashes [#723](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/723)
|
6
|
+
|
7
|
+
### v0.26.8 / 2023-11-23
|
8
|
+
|
9
|
+
* CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
|
10
|
+
|
3
11
|
### v0.26.7 / 2023-09-27
|
4
12
|
|
5
13
|
* FIXED: Micro optimization: build Hash w/ {} (https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/665)
|
@@ -16,8 +16,46 @@ module OpenTelemetry
|
|
16
16
|
def initialize(trace_scalars: false, **_options)
|
17
17
|
@trace_scalars = trace_scalars
|
18
18
|
@_otel_field_key_cache = Hash.new { |h, k| h[k] = _otel_field_key(k) }
|
19
|
+
@_otel_field_key_cache.compare_by_identity
|
19
20
|
@_otel_authorized_key_cache = Hash.new { |h, k| h[k] = _otel_authorized_key(k) }
|
21
|
+
@_otel_authorized_key_cache.compare_by_identity
|
20
22
|
@_otel_resolve_type_key_cache = Hash.new { |h, k| h[k] = _otel_resolve_type_key(k) }
|
23
|
+
@_otel_resolve_type_key_cache.compare_by_identity
|
24
|
+
|
25
|
+
@_otel_type_attrs_cache = Hash.new do |h, type|
|
26
|
+
h[type] = {
|
27
|
+
'graphql.type.name' => type.graphql_name,
|
28
|
+
'graphql.lazy' => false
|
29
|
+
}.freeze
|
30
|
+
end
|
31
|
+
@_otel_type_attrs_cache.compare_by_identity
|
32
|
+
|
33
|
+
@_otel_lazy_type_attrs_cache = Hash.new do |h, type|
|
34
|
+
h[type] = {
|
35
|
+
'graphql.type.name' => type.graphql_name,
|
36
|
+
'graphql.lazy' => true
|
37
|
+
}.freeze
|
38
|
+
end
|
39
|
+
@_otel_lazy_type_attrs_cache.compare_by_identity
|
40
|
+
|
41
|
+
@_otel_field_attrs_cache = Hash.new do |h, field|
|
42
|
+
h[field] = {
|
43
|
+
'graphql.field.parent' => field.owner&.graphql_name,
|
44
|
+
'graphql.field.name' => field.graphql_name,
|
45
|
+
'graphql.lazy' => false
|
46
|
+
}.freeze
|
47
|
+
end
|
48
|
+
@_otel_field_attrs_cache.compare_by_identity
|
49
|
+
|
50
|
+
@_otel_lazy_field_attrs_cache = Hash.new do |h, field|
|
51
|
+
h[field] = {
|
52
|
+
'graphql.field.parent' => field.owner&.graphql_name,
|
53
|
+
'graphql.field.name' => field.graphql_name,
|
54
|
+
'graphql.lazy' => true
|
55
|
+
}.freeze
|
56
|
+
end
|
57
|
+
@_otel_lazy_field_attrs_cache.compare_by_identity
|
58
|
+
|
21
59
|
super
|
22
60
|
end
|
23
61
|
|
@@ -73,26 +111,18 @@ module OpenTelemetry
|
|
73
111
|
|
74
112
|
def execute_field(field:, query:, ast_node:, arguments:, object:, &block)
|
75
113
|
platform_key = _otel_execute_field_key(field: field)
|
76
|
-
return super unless platform_key
|
114
|
+
return super(field: field, query: query, ast_node: ast_node, object: object, arguments: arguments, &block) unless platform_key
|
77
115
|
|
78
|
-
attributes =
|
79
|
-
'graphql.field.parent' => field.owner&.graphql_name,
|
80
|
-
'graphql.field.name' => field.graphql_name,
|
81
|
-
'graphql.lazy' => false
|
82
|
-
}
|
116
|
+
attributes = @_otel_field_attrs_cache[field]
|
83
117
|
|
84
118
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
85
119
|
end
|
86
120
|
|
87
121
|
def execute_field_lazy(field:, query:, ast_node:, arguments:, object:, &block)
|
88
122
|
platform_key = _otel_execute_field_key(field: field)
|
89
|
-
return super unless platform_key
|
123
|
+
return super(field: field, query: query, ast_node: ast_node, object: object, arguments: arguments, &block) unless platform_key
|
90
124
|
|
91
|
-
attributes =
|
92
|
-
'graphql.field.parent' => field.owner&.graphql_name,
|
93
|
-
'graphql.field.name' => field.graphql_name,
|
94
|
-
'graphql.lazy' => true
|
95
|
-
}
|
125
|
+
attributes = @_otel_lazy_field_attrs_cache[field]
|
96
126
|
|
97
127
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
98
128
|
end
|
@@ -101,10 +131,7 @@ module OpenTelemetry
|
|
101
131
|
platform_key = @_otel_authorized_key_cache[type]
|
102
132
|
return super unless platform_key
|
103
133
|
|
104
|
-
attributes =
|
105
|
-
'graphql.type.name' => type.graphql_name,
|
106
|
-
'graphql.lazy' => false
|
107
|
-
}
|
134
|
+
attributes = @_otel_type_attrs_cache[type]
|
108
135
|
|
109
136
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
110
137
|
end
|
@@ -113,33 +140,19 @@ module OpenTelemetry
|
|
113
140
|
platform_key = @_otel_authorized_key_cache[type]
|
114
141
|
return super unless platform_key
|
115
142
|
|
116
|
-
attributes =
|
117
|
-
'graphql.type.name' => type.graphql_name,
|
118
|
-
'graphql.lazy' => true
|
119
|
-
}
|
120
|
-
|
143
|
+
attributes = @_otel_lazy_type_attrs_cache[type]
|
121
144
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
122
145
|
end
|
123
146
|
|
124
147
|
def resolve_type(query:, type:, object:, &block)
|
125
148
|
platform_key = @_otel_resolve_type_key_cache[type]
|
126
|
-
|
127
|
-
attributes = {
|
128
|
-
'graphql.type.name' => type.graphql_name,
|
129
|
-
'graphql.lazy' => false
|
130
|
-
}
|
131
|
-
|
149
|
+
attributes = @_otel_type_attrs_cache[type]
|
132
150
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
133
151
|
end
|
134
152
|
|
135
153
|
def resolve_type_lazy(query:, type:, object:, &block)
|
136
154
|
platform_key = @_otel_resolve_type_key_cache[type]
|
137
|
-
|
138
|
-
attributes = {
|
139
|
-
'graphql.type.name' => type.graphql_name,
|
140
|
-
'graphql.lazy' => true
|
141
|
-
}
|
142
|
-
|
155
|
+
attributes = @_otel_lazy_type_attrs_cache[type]
|
143
156
|
tracer.in_span(platform_key, attributes: attributes, &block)
|
144
157
|
end
|
145
158
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.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-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -156,6 +156,20 @@ dependencies:
|
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: 1.56.1
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: rubocop-performance
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 1.19.1
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 1.19.1
|
159
173
|
- !ruby/object:Gem::Dependency
|
160
174
|
name: simplecov
|
161
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,10 +234,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
220
234
|
licenses:
|
221
235
|
- Apache-2.0
|
222
236
|
metadata:
|
223
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.
|
237
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.27.0/file/CHANGELOG.md
|
224
238
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/graphql
|
225
239
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
226
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.
|
240
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.27.0
|
227
241
|
post_install_message:
|
228
242
|
rdoc_options: []
|
229
243
|
require_paths:
|