Class: Honeycomb::Aws::Plugin

Inherits:
Seahorse::Client::Plugin
  • Object
show all
Defined in:
lib/honeycomb/integrations/aws.rb

Overview

Instruments AWS clients with Honeycomb events.

This plugin is automatically added to any aws-sdk client class your app uses. It uses SdkHandler to wrap a Honeycomb span around each invocation of a client object method. Within that span, there is typically at least one actual HTTP API call to Amazon, so each API call is wrapped in a separate span by ApiHandler.

This plugin adds the following options which you can use to configure your aws-sdk clients:

  • ‘:honeycomb` - Boolean indicating whether to enable Honeycomb instrumentation. Defaults to `true`.

  • ‘:honeycomb_client` - Allows you to set a custom Honeycomb client object. Defaults to the global Honeycomb.client.

Examples:

Disable the Honeycomb AWS integration globally.

Aws.config.update(honeycomb: false)

Disable the Honeycomb AWS integration locally.

s3 = Aws::S3::Client.new(honeycomb: false)

Use a different client globally.

Aws.config.update(honeycomb_client: custom)

Use a different client locally.

dynamodb = Aws::DynamoDB::Client.new(honeycomb_client: custom)

See Also:

Instance Method Summary collapse

Instance Method Details

#add_handlers(handlers, config) ⇒ Object



63
64
65
66
67
68
# File 'lib/honeycomb/integrations/aws.rb', line 63

def add_handlers(handlers, config)
  return unless config.honeycomb && config.honeycomb_client

  handlers.add(SdkHandler, step: :initialize)
  handlers.add(ApiHandler, step: :sign, priority: 39)
end