Skip to content

Commit ff4bd9d

Browse files
committed
docs: Use AWS SDK v3 in example
1 parent 51f6328 commit ff4bd9d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

instrumentation/aws_sdk/example/Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
source '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'
69
gem 'opentelemetry-api'
710
gem 'opentelemetry-instrumentation-aws_sdk'
811
gem 'opentelemetry-sdk'

instrumentation/aws_sdk/example/trace_demonstration.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
ENV['OTEL_TRACES_EXPORTER'] ||= 'console'
1414

1515
OpenTelemetry::SDK.configure do |c|
16-
c.use 'OpenTelemetry::Instrumentation::AwsSdk', suppress_internal_instrumentation: false
16+
c.use 'OpenTelemetry::Instrumentation::AwsSdk'
1717
end
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)
2022
sns.publish message: 'ruby sending message to sns'

0 commit comments

Comments
 (0)