Class: Gruf::Lightstep::Headers
- Inherits:
-
Object
- Object
- Gruf::Lightstep::Headers
- Defined in:
- lib/gruf/lightstep/headers.rb
Overview
Abstraction accessor class for B3 propagation headers across GRPC ActiveCall objects
Constant Summary collapse
- OT_KEYS =
{ parent_span_id: %w[ot-tracer-parentspanid OT-Tracer-ParentSpanId HTTP_X_OT_TRACER_PARENTSPANID], span_id: %w[ot-tracer-spanid OT-Tracer-SpanId HTTP_X_OT_TRACER_SPANID], trace_id: %w[ot-tracer-traceid OT-Tracer-TraceId HTTP_X_OT_TRACER_TRACEID], sampled: %w[ot-tracer-sampled OT-Tracer-Sampled HTTP_X_OT_TRACER_SAMPLED], flags: %w[ot-tracer-flags OT-Tracer-Flags HTTP_X_OT_TRACER_FLAGS] }.freeze
Instance Attribute Summary collapse
-
#active_call ⇒ Object
readonly
Returns the value of attribute active_call.
Instance Method Summary collapse
-
#initialize(active_call) ⇒ Headers
constructor
A new instance of Headers.
- #metadata ⇒ Hash
- #to_h ⇒ Hash
-
#value(key) ⇒ String|NilClass
Return a B3 propagation header if present.
Constructor Details
#initialize(active_call) ⇒ Headers
Returns a new instance of Headers.
42 43 44 |
# File 'lib/gruf/lightstep/headers.rb', line 42 def initialize(active_call) @active_call = active_call end |
Instance Attribute Details
#active_call ⇒ Object (readonly)
Returns the value of attribute active_call.
24 25 26 |
# File 'lib/gruf/lightstep/headers.rb', line 24 def active_call @active_call end |
Instance Method Details
#metadata ⇒ Hash
64 65 66 |
# File 'lib/gruf/lightstep/headers.rb', line 64 def @active_call. end |
#to_h ⇒ Hash
71 72 73 |
# File 'lib/gruf/lightstep/headers.rb', line 71 def to_h @active_call. end |