File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
instrumentation/aws_sdk/example Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 22
33source 'https://rubygems.org'
44
5- gem 'aws-sdk'
5+ gem 'aws-sdk-core' , '~> 3'
6+ gem 'aws-sdk-sns' , '~> 1'
7+ # AWS SDK core needs an XML library
8+ gem 'rexml'
69gem 'opentelemetry-api'
710gem 'opentelemetry-instrumentation-aws_sdk'
811gem 'opentelemetry-sdk'
Original file line number Diff line number Diff line change 1313ENV [ 'OTEL_TRACES_EXPORTER' ] ||= 'console'
1414
1515OpenTelemetry ::SDK . configure do |c |
16- c . use 'OpenTelemetry::Instrumentation::AwsSdk' , suppress_internal_instrumentation : false
16+ c . use 'OpenTelemetry::Instrumentation::AwsSdk'
1717end
1818
19- sns = Aws ::SNS ::Client . new
19+ # For more examples and options, see also https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/observability.html
20+ otel_provider = Aws ::Telemetry ::OTelProvider . new
21+ sns = Aws ::SNS ::Client . new ( telemetry_provider : otel_provider )
2022sns . publish message : 'ruby sending message to sns'
You can’t perform that action at this time.
0 commit comments