Skip to content

Commit

Permalink
Address feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
jterapin committed Sep 30, 2024
1 parent 7736eb0 commit 1e1a29e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion instrumentation/aws_sdk/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ appraise 'aws-sdk-3' do
end

# pre-Observability support in V3 SDK
appraise 'aws-sdk-3.2' do
appraise 'aws-sdk-3.202' do
gem 'aws-sdk-core', '~> 3.202'
gem 'aws-sdk-lambda', '~> 1.127'
gem 'aws-sdk-dynamodb', '~> 1.118'
Expand Down
9 changes: 4 additions & 5 deletions instrumentation/aws_sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@ This instrumentation offers the following configuration options:
span kind of `internal` are suppressed from traces.

## Integration with SDK V3's Telemetry support
AWS SDK for Ruby V3 added support for Observability which includes a configuration,
AWS SDK for Ruby V3 added support for Observability which includes a new configuration,
`telemetry_provider` and an OpenTelemetry-based telemetry provider. Only applies to
AWS service gems released after 2024-09-03.

Using the OTel telemetry provider will give you insights about specific handlers
during the SDK request/response lifecycle.

Using later versions of these gems will give more details on the internal spans.
See below for example usage:
```ruby
# configures the OpenTelemetry SDK with instrumentation defaults
OpenTelemetry::SDK.configure do |c|
c.use 'OpenTelemetry::Instrumentation::AwsSdk'
end

# create otel provider and pass to client config
# create open-telemetry provider and pass to client config
otel_provider = Aws::Telemetry::OTelProvider.new
client = Aws::S3::Client.new(telemetry_provider: otel_provider)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base

install do |_config|
require_dependencies
patch if telemetry_plugin?
patch_telemetry_plugin if telemetry_plugin?
add_plugins(Seahorse::Client::Base, *loaded_service_clients)
end

Expand Down Expand Up @@ -61,10 +61,13 @@ def supports_telemetry_plugin?(klass)
end

def telemetry_plugin?
::Aws.const_defined?('Plugins::Telemetry')
::Aws::Plugins.const_defined?(:Telemetry)
end

def patch
# Patches AWS SDK V3's telemetry plugin for integration
# This patch supports configuration set by this gem and
# additional span attributes that was not provided by the plugin
def patch_telemetry_plugin
::Aws::Plugins::Telemetry::Handler.prepend(Patches::Handler)
end

Expand Down

0 comments on commit 1e1a29e

Please sign in to comment.