Class: Datadog::Tracing::Contrib::Aws::ParsedContext
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::Aws::ParsedContext
- Defined in:
- lib/datadog/tracing/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
- #params ⇒ 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.
7 8 9 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 7 def initialize(context) @context = context end |
Instance Method Details
#host ⇒ Object
47 48 49 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 47 def host context.http_request.endpoint.host end |
#http_method ⇒ Object
31 32 33 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 31 def http_method context.http_request.http_method end |
#operation ⇒ Object
19 20 21 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 19 def operation context.operation_name end |
#params ⇒ Object
23 24 25 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 23 def params context.params end |
#path ⇒ Object
43 44 45 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 43 def path context.http_request.endpoint.path end |
#region ⇒ Object
35 36 37 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 35 def region context.client.config.region end |
#resource ⇒ Object
15 16 17 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 15 def resource "#{service}.#{operation}" end |
#retry_attempts ⇒ Object
39 40 41 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 39 def retry_attempts context.retries end |
#safely(attr, fallback = nil) ⇒ Object
11 12 13 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 11 def safely(attr, fallback = nil) public_send(attr) rescue fallback end |
#status_code ⇒ Object
27 28 29 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 27 def status_code context.http_response.status_code end |