diff --git a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb index 827f44e3a..0d4c3b0ad 100644 --- a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb +++ b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb @@ -13,6 +13,8 @@ module Tracers # GraphQLTracer contains the OpenTelemetry tracer implementation compatible with # the GraphQL tracer API class GraphQLTracer < ::GraphQL::Tracing::PlatformTracing + DEFAULT_HASH = {}.freeze + self.platform_keys = { 'lex' => 'graphql.lex', 'parse' => 'graphql.parse', @@ -130,7 +132,7 @@ def attributes_for(key, data) attrs['graphql.operation.name'] = data[:query].selected_operation_name || 'anonymous' attrs.freeze else - {} + DEFAULT_HASH end end