Skip to content

Commit ffa9e49

Browse files
j15ekaylareopellejterapin
authored
docs: Use AWS SDK v3 in example (#1522)
* docs: Use AWS SDK v3 in example * Update instrumentation/aws_sdk/example/Gemfile Co-authored-by: Juli Tera <[email protected]> --------- Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Juli Tera <[email protected]>
1 parent 0e11770 commit ffa9e49

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

instrumentation/aws_sdk/example/Gemfile

Lines changed: 5 additions & 2 deletions
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.203.0'
6+
gem 'aws-sdk-sns', '~> 1.83.0'
67
gem 'opentelemetry-api'
7-
gem 'opentelemetry-instrumentation-aws_sdk'
8+
gem 'opentelemetry-instrumentation-aws_sdk', '~> 0.7.0'
89
gem 'opentelemetry-sdk'
10+
# AWS SDK core needs an XML library
11+
gem 'rexml'

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)