serializer

package
v0.0.0-...-1d9613f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

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.

Old V1 intake endpoint

The intake endpoint from the V1 API could ingest a large variety of JSON structs. To send arbitrary payloads to this endpoint use SendJSONToV1Intake that do not require a Marshaler object.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AgentPayloadVersion is the versions of the agent-payload repository
	// used to serialize to protobuf
	AgentPayloadVersion string
)

Functions

This section is empty.

Types

type Serializer

type Serializer struct {
	Forwarder forwarder.Forwarder
}

Serializer serializes metrics to the correct format and routes the payloads to the correct endpoint in the Forwarder

func (*Serializer) SendEvents

func (s *Serializer) SendEvents(e marshaler.Marshaler) error

SendEvents serializes a list of event and sends the payload to the forwarder

func (*Serializer) SendJSONToV1Intake

func (s *Serializer) SendJSONToV1Intake(data interface{}) error

SendJSONToV1Intake serializes a payload and sends it to the forwarder. Some code sends arbitrary payload the v1 API.

func (*Serializer) SendMetadata

func (s *Serializer) SendMetadata(m marshaler.Marshaler) error

SendMetadata serializes a metadata payload and sends it to the forwarder

func (*Serializer) SendSeries

func (s *Serializer) SendSeries(series marshaler.Marshaler) error

SendSeries serializes a list of serviceChecks and sends the payload to the forwarder

func (*Serializer) SendServiceChecks

func (s *Serializer) SendServiceChecks(sc marshaler.Marshaler) error

SendServiceChecks serializes a list of serviceChecks and sends the payload to the forwarder

func (*Serializer) SendSketch

func (s *Serializer) SendSketch(sketches marshaler.Marshaler) error

SendSketch serializes a list of SketSeriesList and sends the payload to the forwarder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL