Class: Atatus::Transport::Serializers::SpanSerializer Private
- Inherits:
-
Serializer
- Object
- Serializer
- Atatus::Transport::Serializers::SpanSerializer
- Defined in:
- lib/atatus/transport/serializers/span_serializer.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: ContextSerializer
Instance Attribute Summary collapse
- #context_serializer ⇒ Object readonly private
Attributes inherited from Serializer
Instance Method Summary collapse
- #build(span) ⇒ Object private
-
#initialize(config) ⇒ SpanSerializer
constructor
private
A new instance of SpanSerializer.
Constructor Details
#initialize(config) ⇒ SpanSerializer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SpanSerializer.
25 26 27 28 29 |
# File 'lib/atatus/transport/serializers/span_serializer.rb', line 25 def initialize(config) super @context_serializer = ContextSerializer.new(config) end |
Instance Attribute Details
#context_serializer ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/atatus/transport/serializers/span_serializer.rb', line 31 def context_serializer @context_serializer end |
Instance Method Details
#build(span) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/atatus/transport/serializers/span_serializer.rb', line 33 def build(span) { span: { id: span.id, transaction_id: span.transaction.id, parent_id: span.parent_id, name: keyword_field(span.name), type: join_type(span), duration: ms(span.duration), context: context_serializer.build(span.context), stacktrace: span.stacktrace.to_a, timestamp: span., trace_id: span.trace_id, sample_rate: span.sample_rate, outcome: keyword_field(span.outcome) } } end |