Class: Datadog::Encoding::MsgpackEncoder

Inherits:
Encoder
  • Object
show all
Defined in:
lib/ddtrace/encoding.rb

Overview

Encoder for the Msgpack format

Instance Attribute Summary

Attributes inherited from Encoder

#content_type

Instance Method Summary collapse

Methods inherited from Encoder

#encode_services, #encode_traces

Constructor Details

#initializeMsgpackEncoder

Returns a new instance of MsgpackEncoder.



55
56
57
58
# File 'lib/ddtrace/encoding.rb', line 55

def initialize
  Datadog::Tracer.log.debug('using Msgpack encoder')
  @content_type = 'application/msgpack'
end

Instance Method Details

#encode(obj) ⇒ Object



60
61
62
# File 'lib/ddtrace/encoding.rb', line 60

def encode(obj)
  MessagePack.pack(obj)
end