class Datadog::Contrib::Aws::ParsedContext
A wrapper around Seahorse::Client::RequestContext
Attributes
context[R]
Public Class Methods
new(context)
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 6 def initialize(context) @context = context end
Public Instance Methods
host()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 42 def host context.http_request.endpoint.host end
http_method()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 26 def http_method context.http_request.http_method end
operation()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 18 def operation context.operation_name end
path()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 38 def path context.http_request.endpoint.path end
region()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 30 def region context.client.config.region end
resource()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 14 def resource "#{service}.#{operation}" end
retry_attempts()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 34 def retry_attempts context.retries end
safely(attr, fallback = nil)
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 10 def safely(attr, fallback = nil) public_send(attr) rescue fallback end
status_code()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 22 def status_code context.http_response.status_code end
Private Instance Methods
service()
click to toggle source
# File lib/ddtrace/contrib/aws/parsed_context.rb, line 50 def service context.client.class.to_s.split('::')[1].downcase end