lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb in opentelemetry-instrumentation-graphql-0.28.3 vs lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb in opentelemetry-instrumentation-graphql-0.28.4
- old
+ new
@@ -58,19 +58,19 @@
super
end
def execute_multiplex(multiplex:, &block)
- tracer.in_span('graphql.execute_multiplex', &block)
+ tracer.in_span('graphql.execute_multiplex') { super }
end
def lex(query_string:, &block)
- tracer.in_span('graphql.lex', &block)
+ tracer.in_span('graphql.lex') { super }
end
def parse(query_string:, &block)
- tracer.in_span('graphql.parse', &block)
+ tracer.in_span('graphql.parse') { super }
end
def validate(query:, validate:, &block)
tracer.in_span('graphql.validate') do |span|
super.tap do |response|
@@ -87,28 +87,30 @@
end
end
end
def analyze_multiplex(multiplex:, &block)
- tracer.in_span('graphql.analyze_multiplex', &block)
+ tracer.in_span('graphql.analyze_multiplex') { super }
end
def analyze_query(query:, &block)
- tracer.in_span('graphql.analyze_query', &block)
+ tracer.in_span('graphql.analyze_query') { super }
end
def execute_query(query:, &block)
attributes = {}
attributes['graphql.operation.name'] = query.selected_operation_name if query.selected_operation_name
attributes['graphql.operation.type'] = query.selected_operation.operation_type
attributes['graphql.document'] = query.query_string
- tracer.in_span('graphql.execute_query', attributes: attributes, &block)
+ tracer.in_span('graphql.execute_query', attributes: attributes) do
+ super
+ end
end
def execute_query_lazy(query:, multiplex:, &block)
- tracer.in_span('graphql.execute_query_lazy', &block)
+ tracer.in_span('graphql.execute_query_lazy') { super }
end
def execute_field(field:, query:, ast_node:, arguments:, object:, &block)
platform_key = _otel_execute_field_key(field: field)
return super(field: field, query: query, ast_node: ast_node, object: object, arguments: arguments, &block) unless platform_key
@@ -131,30 +133,30 @@
platform_key = @_otel_authorized_key_cache[type]
return super unless platform_key
attributes = @_otel_type_attrs_cache[type]
- tracer.in_span(platform_key, attributes: attributes, &block)
+ tracer.in_span(platform_key, attributes: attributes) { super }
end
def authorized_lazy(query:, type:, object:, &block)
platform_key = @_otel_authorized_key_cache[type]
return super unless platform_key
attributes = @_otel_lazy_type_attrs_cache[type]
- tracer.in_span(platform_key, attributes: attributes, &block)
+ tracer.in_span(platform_key, attributes: attributes) { super }
end
def resolve_type(query:, type:, object:, &block)
platform_key = @_otel_resolve_type_key_cache[type]
attributes = @_otel_type_attrs_cache[type]
- tracer.in_span(platform_key, attributes: attributes, &block)
+ tracer.in_span(platform_key, attributes: attributes) { super }
end
def resolve_type_lazy(query:, type:, object:, &block)
platform_key = @_otel_resolve_type_key_cache[type]
attributes = @_otel_lazy_type_attrs_cache[type]
- tracer.in_span(platform_key, attributes: attributes, &block)
+ tracer.in_span(platform_key, attributes: attributes) { super }
end
private
def _otel_execute_field_key(field:, &block)