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.
9 10 11 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 9 def initialize(context) @context = context end |
Instance Method Details
#host ⇒ Object
49 50 51 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 49 def host context.http_request.endpoint.host end |
#http_method ⇒ Object
33 34 35 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 33 def http_method context.http_request.http_method end |
#operation ⇒ Object
21 22 23 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 21 def operation context.operation_name end |
#params ⇒ Object
25 26 27 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 25 def params context.params end |
#path ⇒ Object
45 46 47 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 45 def path context.http_request.endpoint.path end |
#region ⇒ Object
37 38 39 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 37 def region context.client.config.region end |
#resource ⇒ Object
17 18 19 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 17 def resource "#{service}.#{operation}" end |
#retry_attempts ⇒ Object
41 42 43 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 41 def retry_attempts context.retries end |
#safely(attr, fallback = nil) ⇒ Object
13 14 15 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 13 def safely(attr, fallback = nil) public_send(attr) rescue fallback end |
#status_code ⇒ Object
29 30 31 |
# File 'lib/datadog/tracing/contrib/aws/parsed_context.rb', line 29 def status_code context.http_response.status_code end |