Class: Datadog::Contrib::Aws::ParsedContext
- Inherits:
-
Object
- Object
- Datadog::Contrib::Aws::ParsedContext
- Defined in:
- lib/ddtrace/contrib/aws/parsed_context.rb
Overview
A wrapper around Seahorse::Client::RequestContext
Instance Method Summary collapse
- #host ⇒ Object
- #http_method ⇒ Object
-
#initialize(context) ⇒ ParsedContext
constructor
A new instance of ParsedContext.
- #operation ⇒ Object
- #path ⇒ Object
- #region ⇒ Object
- #resource ⇒ Object
- #retry_attempts ⇒ Object
- #safely(attr, fallback = nil) ⇒ Object
- #status_code ⇒ Object
Constructor Details
#initialize(context) ⇒ ParsedContext
Returns a new instance of ParsedContext.
6 7 8 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 6 def initialize(context) @context = context end |
Instance Method Details
#host ⇒ Object
42 43 44 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 42 def host context.http_request.endpoint.host end |
#http_method ⇒ Object
26 27 28 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 26 def http_method context.http_request.http_method end |
#operation ⇒ Object
18 19 20 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 18 def operation context.operation_name end |
#path ⇒ Object
38 39 40 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 38 def path context.http_request.endpoint.path end |
#region ⇒ Object
30 31 32 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 30 def region context.client.config.region end |
#resource ⇒ Object
14 15 16 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 14 def resource "#{service}.#{operation}" end |
#retry_attempts ⇒ Object
34 35 36 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 34 def retry_attempts context.retries end |
#safely(attr, fallback = nil) ⇒ Object
10 11 12 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 10 def safely(attr, fallback = nil) public_send(attr) rescue fallback end |
#status_code ⇒ Object
22 23 24 |
# File 'lib/ddtrace/contrib/aws/parsed_context.rb', line 22 def status_code context.http_response.status_code end |