# README
package serializer
The Serializer is in charge of routing payloads from the different parts of the agent to the Forwarder. The backend currently offers 2 versions of the intake API. The V1 version takes JSON payloads, the V2 take protocol buffer payloads or JSON depending on endpoint.
While moving all the existing endpoints to the new format, the agent will support both API. That is why the serializer is here to choose a serialization protocol depending on the content and use the correct Forwarder method.
To be sent, a payload needs to implement the Marshaler interface.
# Functions
NewSerializer returns a new Serializer initialized.
# Variables
AgentPayloadVersion is the versions of the agent-payload repository used to serialize to protobuf.
# Structs
Serializer serializes metrics to the correct format and routes the payloads to the correct endpoint in the Forwarder.
# Interfaces
EventsStreamJSONMarshaler handles two serialization logics.
MetricSerializer represents the interface of method needed by the aggregator to serialize its data.
# Type aliases
ProcessMessageBody is a type alias for processes proto message body this type alias allows to avoid importing the process agent payload proto in case it's not needed (dogstastd).