Class: EpsagonAwsHandler

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/instrumentation/aws_sdk_plugin.rb

Overview

Generates Spans for all uses of AWS SDK

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/instrumentation/aws_sdk_plugin.rb', line 20

def call(context)
  tracer.in_span('', kind: :client) do |span|
    untraced do
      @handler.call(context).tap do
        span.set_attribute('aws.service', context.client.class.to_s.split('::')[1].downcase)
        span.set_attribute('aws.operation', context.operation.name)
        span.set_attribute('aws.region', context.client.config.region)
        span.set_attribute('http.status_code', context.http_response.status_code)
      end
    end
  end
end

#tracerObject



33
34
35
# File 'lib/instrumentation/aws_sdk_plugin.rb', line 33

def tracer
  EpsagonAwsSdkInstrumentation.instance.tracer()
end