Class: OpenTelemetry::Instrumentation::AwsSdk::Instrumentation

Inherits:
Base
  • Object
show all
Defined in:
lib/opentelemetry/instrumentation/aws_sdk/instrumentation.rb

Overview

The OpenTelemetry::Instrumentation::AwsSdk::Instrumentation class contains logic to detect and install the AwsSdk instrumentation.

Configuration keys and options

:inject_messaging_context

Allows adding of context key/value to Message Attributes for SQS/SNS messages.

  • false (default) - Context key/value will not be added.
  • true - Context key/value will be added.

:enable_internal_instrumentation

Enables tracing of spans of internal span kind.

  • false (default) - Internal spans are not traced
  • true - Internal spans are traced.

:suppress_internal_instrumentation (deprecated)

This configuration has been deprecated in a favor of :enable_internal_instrumentation

Examples:

An explicit default configurations

OpenTelemetry::SDK.configure do |c|
  c.use 'OpenTelemetry::Instrumentation::AwsSdk', {
    inject_messaging_context: false,
    enable_internal_instrumentation: false
  }
end

Constant Summary collapse

MINIMUM_VERSION =
Gem::Version.new('2.0.0')

Instance Method Summary collapse

Instance Method Details

#gem_versionObject



60
61
62
63
64
65
66
67
68
# File 'lib/opentelemetry/instrumentation/aws_sdk/instrumentation.rb', line 60

def gem_version
  if Gem.loaded_specs['aws-sdk']
    Gem.loaded_specs['aws-sdk'].version
  elsif Gem.loaded_specs['aws-sdk-core']
    Gem.loaded_specs['aws-sdk-core'].version
  elsif defined?(::Aws::CORE_GEM_VERSION)
    Gem::Version.new(::Aws::CORE_GEM_VERSION)
  end
end