Class: Atatus::Transport::Serializers::SpanSerializer::ContextSerializer Private

Inherits:
Atatus::Transport::Serializers::Serializer show all
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.

Instance Attribute Summary

Attributes inherited from Atatus::Transport::Serializers::Serializer

#config

Instance Method Summary collapse

Methods inherited from Atatus::Transport::Serializers::Serializer

#initialize

Constructor Details

This class inherits a constructor from Atatus::Transport::Serializers::Serializer

Instance Method Details

#build(context) ⇒ 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.

rubocop:disable Metrics/CyclomaticComplexity



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/atatus/transport/serializers/span_serializer.rb', line 54

def build(context)
  return unless context

  base = {}

  base[:tags] = mixed_object(context.labels) if context.labels.any?
  base[:sync] = context.sync unless context.sync.nil?
  base[:db] = build_db(context.db) if context.db
  base[:http] = build_http(context.http) if context.http

  if context.destination
    base[:destination] = build_destination(context.destination)
  end

  base
end