opentelemetry-instrumentation-graphql 0.26.5 → 0.26.7

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: 882f9b77148ce1df4548a68ea952642e066f83c6374ab117ff225aa0230759a9
4
- data.tar.gz: e17b57812cd01e4168bccb3fb16e01bfdc8422fcc47fdc8ab5b1d9c8aa15f73d
3
+ metadata.gz: ccb31fdce8c98bf2bb4ec81805090426776c5396c7451e650b2a6bb8a6afa53a
4
+ data.tar.gz: 296640cc5f927a4550a87f401c35dbd61433536a8f3bf718d44a3ecc140a343a
5
5
  SHA512:
6
- metadata.gz: 86ee690ae6f3085598f3d097c37d9f53ba86e57469b75a0ad4a800377b8de4a197ff5772ff4a288a7e25dc708ffd2a2ec0b6a8378e80ce3f32fe3d1921ba9697
7
- data.tar.gz: 958032ccc0726720a9b59d7cae647e46c101346a1206454ac08656fcfd4550ff1770facf101ac82ba83d14176565cfdd2eb7610c1c6a90bf0d85810eb6599885
6
+ metadata.gz: a802470c26d4681da1048e762ed66d73142e488202c86838e19c7dfbd8fa048b34b686cc182def58f1ecc7c7e8ea9b086135f55941a1dba9723b0d54976b08c7
7
+ data.tar.gz: b7700b9cb48fa2b6b32527a2b668aaaec9920874e4af656d3edafb4a2f0d9f84dfddece3f3c664eb866ec9ae962f6785b00eeb93b3c471f6c890ae5d0ebb3331
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release History: opentelemetry-instrumentation-graphql
2
2
 
3
+ ### v0.26.7 / 2023-09-27
4
+
5
+ * FIXED: Micro optimization: build Hash w/ {} (https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/665)
6
+
7
+ ### v0.26.6 / 2023-08-26
8
+
9
+ * FIXED: Improve GraphQL tracing compatibility with other tracers
10
+
3
11
  ### v0.26.5 / 2023-08-03
4
12
 
5
13
  * FIXED: Remove inline linter rules
@@ -15,9 +15,9 @@ module OpenTelemetry
15
15
  module GraphQLTrace # rubocop:disable Metrics/ModuleLength
16
16
  def initialize(trace_scalars: false, **_options)
17
17
  @trace_scalars = trace_scalars
18
- @platform_field_key_cache = Hash.new { |h, k| h[k] = platform_field_key(k) }
19
- @platform_authorized_key_cache = Hash.new { |h, k| h[k] = platform_authorized_key(k) }
20
- @platform_resolve_type_key_cache = Hash.new { |h, k| h[k] = platform_resolve_type_key(k) }
18
+ @_otel_field_key_cache = Hash.new { |h, k| h[k] = _otel_field_key(k) }
19
+ @_otel_authorized_key_cache = Hash.new { |h, k| h[k] = _otel_authorized_key(k) }
20
+ @_otel_resolve_type_key_cache = Hash.new { |h, k| h[k] = _otel_resolve_type_key(k) }
21
21
  super
22
22
  end
23
23
 
@@ -72,76 +72,82 @@ module OpenTelemetry
72
72
  end
73
73
 
74
74
  def execute_field(field:, query:, ast_node:, arguments:, object:, &block)
75
- platform_key = platform_execute_field_key(field: field)
75
+ platform_key = _otel_execute_field_key(field: field)
76
76
  return super unless platform_key
77
77
 
78
- attributes = {}
79
- attributes['graphql.field.parent'] = field.owner&.graphql_name
80
- attributes['graphql.field.name'] = field.graphql_name
81
- attributes['graphql.lazy'] = false
78
+ attributes = {
79
+ 'graphql.field.parent' => field.owner&.graphql_name,
80
+ 'graphql.field.name' => field.graphql_name,
81
+ 'graphql.lazy' => false
82
+ }
82
83
 
83
84
  tracer.in_span(platform_key, attributes: attributes, &block)
84
85
  end
85
86
 
86
87
  def execute_field_lazy(field:, query:, ast_node:, arguments:, object:, &block)
87
- platform_key = platform_execute_field_key(field: field)
88
+ platform_key = _otel_execute_field_key(field: field)
88
89
  return super unless platform_key
89
90
 
90
- attributes = {}
91
- attributes['graphql.field.parent'] = field.owner&.graphql_name
92
- attributes['graphql.field.name'] = field.graphql_name
93
- attributes['graphql.lazy'] = true
91
+ attributes = {
92
+ 'graphql.field.parent' => field.owner&.graphql_name,
93
+ 'graphql.field.name' => field.graphql_name,
94
+ 'graphql.lazy' => true
95
+ }
94
96
 
95
97
  tracer.in_span(platform_key, attributes: attributes, &block)
96
98
  end
97
99
 
98
100
  def authorized(query:, type:, object:, &block)
99
- platform_key = @platform_authorized_key_cache[type]
101
+ platform_key = @_otel_authorized_key_cache[type]
100
102
  return super unless platform_key
101
103
 
102
- attributes = {}
103
- attributes['graphql.type.name'] = type.graphql_name
104
- attributes['graphql.lazy'] = false
104
+ attributes = {
105
+ 'graphql.type.name' => type.graphql_name,
106
+ 'graphql.lazy' => false
107
+ }
105
108
 
106
109
  tracer.in_span(platform_key, attributes: attributes, &block)
107
110
  end
108
111
 
109
112
  def authorized_lazy(query:, type:, object:, &block)
110
- platform_key = @platform_authorized_key_cache[type]
113
+ platform_key = @_otel_authorized_key_cache[type]
111
114
  return super unless platform_key
112
115
 
113
- attributes = {}
114
- attributes['graphql.type.name'] = type.graphql_name
115
- attributes['graphql.lazy'] = true
116
+ attributes = {
117
+ 'graphql.type.name' => type.graphql_name,
118
+ 'graphql.lazy' => true
119
+ }
116
120
 
117
121
  tracer.in_span(platform_key, attributes: attributes, &block)
118
122
  end
119
123
 
120
124
  def resolve_type(query:, type:, object:, &block)
121
- platform_key = @platform_resolve_type_key_cache[type]
125
+ platform_key = @_otel_resolve_type_key_cache[type]
122
126
 
123
- attributes = {}
124
- attributes['graphql.type.name'] = type.graphql_name
125
- attributes['graphql.lazy'] = false
127
+ attributes = {
128
+ 'graphql.type.name' => type.graphql_name,
129
+ 'graphql.lazy' => false
130
+ }
126
131
 
127
132
  tracer.in_span(platform_key, attributes: attributes, &block)
128
133
  end
129
134
 
130
135
  def resolve_type_lazy(query:, type:, object:, &block)
131
- platform_key = @platform_resolve_type_key_cache[type]
136
+ platform_key = @_otel_resolve_type_key_cache[type]
132
137
 
133
- attributes = {}
134
- attributes['graphql.type.name'] = type.graphql_name
135
- attributes['graphql.lazy'] = true
138
+ attributes = {
139
+ 'graphql.type.name' => type.graphql_name,
140
+ 'graphql.lazy' => true
141
+ }
136
142
 
137
143
  tracer.in_span(platform_key, attributes: attributes, &block)
138
144
  end
139
145
 
140
146
  private
141
147
 
142
- def platform_execute_field_key(field:, &block)
148
+ def _otel_execute_field_key(field:, &block)
143
149
  trace_field = trace_field?(field)
144
- platform_key = @platform_field_key_cache[field] if trace_field
150
+ platform_key = @_otel_field_key_cache[field] if trace_field
145
151
  platform_key if platform_key && trace_field
146
152
  end
147
153
 
@@ -155,7 +161,7 @@ module OpenTelemetry
155
161
  end
156
162
  end
157
163
 
158
- def platform_field_key(field)
164
+ def _otel_field_key(field)
159
165
  return unless config[:enable_platform_field]
160
166
 
161
167
  if config[:legacy_platform_span_names]
@@ -165,7 +171,7 @@ module OpenTelemetry
165
171
  end
166
172
  end
167
173
 
168
- def platform_authorized_key(type)
174
+ def _otel_authorized_key(type)
169
175
  return unless config[:enable_platform_authorized]
170
176
 
171
177
  if config[:legacy_platform_span_names]
@@ -175,7 +181,7 @@ module OpenTelemetry
175
181
  end
176
182
  end
177
183
 
178
- def platform_resolve_type_key(type)
184
+ def _otel_resolve_type_key(type)
179
185
  return unless config[:enable_platform_resolve_type]
180
186
 
181
187
  if config[:legacy_platform_span_names]
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module GraphQL
10
- VERSION = '0.26.5'
10
+ VERSION = '0.26.7'
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-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.5
4
+ version: 0.26.7
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-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.0
47
+ version: '2.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.0
54
+ version: '2.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 1.55.1
151
+ version: 1.56.1
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 1.55.1
158
+ version: 1.56.1
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: simplecov
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 3.7.6
179
+ version: '3.19'
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 3.7.6
186
+ version: '3.19'
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: yard
189
189
  requirement: !ruby/object:Gem::Requirement
@@ -198,20 +198,6 @@ dependencies:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0.9'
201
- - !ruby/object:Gem::Dependency
202
- name: yard-doctest
203
- requirement: !ruby/object:Gem::Requirement
204
- requirements:
205
- - - "~>"
206
- - !ruby/object:Gem::Version
207
- version: 0.1.6
208
- type: :development
209
- prerelease: false
210
- version_requirements: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - "~>"
213
- - !ruby/object:Gem::Version
214
- version: 0.1.6
215
201
  description: GraphQL instrumentation for the OpenTelemetry framework
216
202
  email:
217
203
  - cncf-opentelemetry-contributors@lists.cncf.io
@@ -234,10 +220,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
234
220
  licenses:
235
221
  - Apache-2.0
236
222
  metadata:
237
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.26.5/file/CHANGELOG.md
223
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.26.7/file/CHANGELOG.md
238
224
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/graphql
239
225
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
240
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.26.5
226
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-graphql/0.26.7
241
227
  post_install_message:
242
228
  rdoc_options: []
243
229
  require_paths: