lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb in opentelemetry-instrumentation-graphql-0.26.4 vs lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb in opentelemetry-instrumentation-graphql-0.26.5
- old
+ new
@@ -22,11 +22,11 @@
'execute_query' => 'graphql.execute_query',
'execute_query_lazy' => 'graphql.execute_query_lazy',
'execute_multiplex' => 'graphql.execute_multiplex'
}
- def platform_trace(platform_key, key, data) # rubocop:disable Metrics/CyclomaticComplexity
+ def platform_trace(platform_key, key, data)
return yield if platform_key.nil?
tracer.in_span(platform_key, attributes: attributes_for(key, data)) do |span|
yield.tap do |response|
next unless key == 'validate'
@@ -83,10 +83,10 @@
def config
GraphQL::Instrumentation.instance.config
end
- def attributes_for(key, data) # rubocop:disable Metrics/CyclomaticComplexity
+ def attributes_for(key, data)
attributes = {}
case key
when 'execute_field', 'execute_field_lazy'
attributes['graphql.field.parent'] = data[:owner]&.graphql_name # owner is the concrete type, not interface
attributes['graphql.field.name'] = data[:field]&.graphql_name