Class: OpenTracing::Instrumentation::Faraday::TraceMiddleware::Config
- Inherits:
-
Object
- Object
- OpenTracing::Instrumentation::Faraday::TraceMiddleware::Config
- Defined in:
- lib/opentracing/instrumentation/faraday/trace_middleware.rb
Overview
Config for TraceMiddleware
Constant Summary collapse
- DEFAULT_COMMAND_NAME =
'faraday_request'
- DEFAULT_COMPONENT =
'faraday'
- DEFAULT_EXPECTED_ERRORS =
[StandardError].freeze
Instance Attribute Summary collapse
-
#component ⇒ String
Value for component tag.
-
#expected_errors ⇒ Array<Class>
List of handled errors.
-
#inject ⇒ Boolean
Inject trace headers to response.
-
#operation_name ⇒ String
Operation name of tracing span.
-
#response_logger ⇒ ResponseLogger
Instance of response logger.
-
#service_name ⇒ String
Value for service_name tag.
-
#tracer ⇒ OpenTracing::Tracer
Instance of tracer.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
33 34 35 36 37 38 39 40 41 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 33 def initialize @tracer = OpenTracing.global_tracer @operation_name = DEFAULT_COMMAND_NAME @component = DEFAULT_COMPONENT @expected_errors = DEFAULT_EXPECTED_ERRORS @service_name = nil @inject = true @response_logger = ResponseLogger.new end |
Instance Attribute Details
#component ⇒ String
Value for component tag
61 62 63 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 61 def component @component end |
#expected_errors ⇒ Array<Class>
List of handled errors.
56 57 58 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 56 def expected_errors @expected_errors end |
#inject ⇒ Boolean
Inject trace headers to response
76 77 78 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 76 def inject @inject end |
#operation_name ⇒ String
Operation name of tracing span.
51 52 53 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 51 def operation_name @operation_name end |
#response_logger ⇒ ResponseLogger
Instance of response logger
71 72 73 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 71 def response_logger @response_logger end |
#service_name ⇒ String
Value for service_name tag.
66 67 68 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 66 def service_name @service_name end |
#tracer ⇒ OpenTracing::Tracer
Instance of tracer. Should implement OpenTracing::Tracer API.
46 47 48 |
# File 'lib/opentracing/instrumentation/faraday/trace_middleware.rb', line 46 def tracer @tracer end |