Class: Honeycomb::Aws::ApiHandler

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

Overview

An AWS plugin handler that creates spans around API calls.

Each aws-sdk client provides a one-to-one mapping of methods to API operations. However, this doesn’t mean that each method results in only one HTTP request to Amazon’s servers. There may be request errors, retries, redirects, etc. So whereas SdkHandler wraps the logical operation in a span, ApiHandler wraps the individual API requests in separate child spans.

Plugin accomplishes this by adding ApiHandler as close to sending as possible, before the client retries requests, follows redirects, or even parses out response errors. That way, a new span is created for every literal HTTP request. But it also means we have to take care to propagate error information to the span correctly, since the stock AWS error handlers are upstream from this one.

Defined Under Namespace

Classes: JsonError, S3Redirect, XmlError

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object



153
154
155
156
157
158
# File 'lib/honeycomb/integrations/aws.rb', line 153

def call(context)
  context.config.honeycomb_client.start_span(name: "aws-api") do |span|
    instrument(span, context)
    @handler.call(context)
  end
end