diff --git a/instrumentation/active_job/CHANGELOG.md b/instrumentation/active_job/CHANGELOG.md index 4bdc9a478..24527ef69 100644 --- a/instrumentation/active_job/CHANGELOG.md +++ b/instrumentation/active_job/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-active_job +### v0.7.4 / 2024-07-30 + +* FIXED: Honour dynamic changes in configuration + ### v0.7.3 / 2024-07-22 * FIXED: ActiveJob::Handlers.unsubscribe diff --git a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb index 4dfdeb2d6..6e4bf337f 100644 --- a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb +++ b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActiveJob - VERSION = '0.7.3' + VERSION = '0.7.4' end end end diff --git a/instrumentation/aws_lambda/CHANGELOG.md b/instrumentation/aws_lambda/CHANGELOG.md index 9e8d73ce0..3166104d3 100644 --- a/instrumentation/aws_lambda/CHANGELOG.md +++ b/instrumentation/aws_lambda/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-aws_lambda +### v0.1.1 / 2024-07-30 + +* FIXED: Register lambda span + ### v0.1.0 / 2024-05-11 Initial release. diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb index 6723022fd..2269f5455 100644 --- a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module AwsLambda - VERSION = '0.1.0' + VERSION = '0.1.1' end end end diff --git a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb index 855b0bc6e..92ae0fc8a 100644 --- a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb +++ b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb @@ -71,7 +71,7 @@ _(last_span.instrumentation_scope).must_be_kind_of OpenTelemetry::SDK::InstrumentationScope _(last_span.instrumentation_scope.name).must_equal 'OpenTelemetry::Instrumentation::AwsLambda' - _(last_span.instrumentation_scope.version).must_equal '0.1.0' + _(last_span.instrumentation_scope.version).must_equal OpenTelemetry::Instrumentation::AwsLambda::VERSION _(last_span.hex_span_id.size).must_equal 16 _(last_span.hex_trace_id.size).must_equal 32 diff --git a/instrumentation/graphql/CHANGELOG.md b/instrumentation/graphql/CHANGELOG.md index f18b62e02..4aae6d42d 100644 --- a/instrumentation/graphql/CHANGELOG.md +++ b/instrumentation/graphql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-graphql +### v0.28.4 / 2024-07-30 + +* FIXED: Add super calls to GraphqlTrace + ### v0.28.3 / 2024-07-23 * DOCS: Add cspell to CI diff --git a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb index 70c966623..cb82bf2c7 100644 --- a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb +++ b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb @@ -60,15 +60,15 @@ def initialize(trace_scalars: false, **_options) 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) @@ -89,11 +89,11 @@ def validate(query:, validate:, &block) 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) @@ -102,11 +102,13 @@ def execute_query(query:, &block) 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) @@ -133,7 +135,7 @@ def authorized(query:, type:, object:, &block) 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) @@ -141,19 +143,19 @@ def authorized_lazy(query:, type:, object:, &block) 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 diff --git a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb index 3792724a8..da398eb73 100644 --- a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb +++ b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module GraphQL - VERSION = '0.28.3' + VERSION = '0.28.4' end end end diff --git a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb index 22e194036..4fb0e9d85 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb @@ -361,6 +361,41 @@ def platform_field_key(field) _(custom_events).must_equal(true) end end + + module CustomTrace + def execute_multiplex(multiplex:) + multiplex.context[:custom_trace_execute_multiplex_ran] = true + super + end + + def execute_query(query:) + query.context[:custom_trace_execute_query_ran] = true + super + end + end + + it 'works with other trace modules' do + [GraphQL::Schema, SomeOtherGraphQLAppSchema, SomeGraphQLAppSchema].each(&:_reset_tracer_for_testing) + instrumentation.instance_variable_set(:@installed, false) + + custom_trace_schema = Class.new(GraphQL::Schema) do + query(Class.new(GraphQL::Schema::Object) do + graphql_name 'Query' + field :int, Integer, fallback_value: 5 + end) + + trace_with(CustomTrace) + end + + instrumentation.install({ schemas: [custom_trace_schema] }) + res = custom_trace_schema.execute('{ int }') + assert_equal 5, res['data']['int'], 'The query ran successfully' + + assert res.context[:custom_trace_execute_query_ran], 'The custom execute_query hook ran' + assert res.query.multiplex.context[:custom_trace_execute_multiplex_ran], 'The custom execute_multiplex hook ran' + + assert spans.find { |s| s.name == 'graphql.execute_query' }, 'OpenTelementry ran' + end end end end