writer

package
v0.39.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 26 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxPayloadSize = 3200000 // 3.2MB is the maximum allowed by the Datadog API

MaxPayloadSize specifies the maximum accumulated payload size that is allowed before a flush is triggered; replaced in tests.

Functions

This section is empty.

Types

type SampledChunks

type SampledChunks struct {
	// TracerPayload contains all the chunks that were sampled as part of processing a payload.
	TracerPayload *pb.TracerPayload
	// Size represents the approximated message size in bytes.
	Size int
	// SpanCount specifies the number of spans that were sampled as part of a trace inside the TracerPayload.
	SpanCount int64
	// EventCount specifies the total number of events found in Traces.
	EventCount int64
}

SampledChunks represents the result of a trace sampling operation.

type StatsWriter

type StatsWriter struct {
	// contains filtered or unexported fields
}

StatsWriter ingests stats buckets and flushes them to the API.

func NewStatsWriter

func NewStatsWriter(cfg *config.AgentConfig, in <-chan pb.StatsPayload) *StatsWriter

NewStatsWriter returns a new StatsWriter. It must be started using Run.

func (*StatsWriter) FlushSync

func (w *StatsWriter) FlushSync() error

FlushSync blocks and sends pending payloads when syncMode is true

func (*StatsWriter) Run

func (w *StatsWriter) Run()

Run starts the StatsWriter, making it ready to receive stats and report metrics.

func (*StatsWriter) SendPayload

func (w *StatsWriter) SendPayload(p pb.StatsPayload)

SendPayload sends a stats payload to the Datadog backend.

func (*StatsWriter) Stop

func (w *StatsWriter) Stop()

Stop stops a running StatsWriter.

type TraceWriter

type TraceWriter struct {
	// In receives sampled spans to be processed by the trace writer.
	// Channel should only be received from when testing.
	In chan *SampledChunks
	// contains filtered or unexported fields
}

TraceWriter buffers traces and APM events, flushing them to the Datadog API.

func NewTraceWriter

func NewTraceWriter(cfg *config.AgentConfig) *TraceWriter

NewTraceWriter returns a new TraceWriter. It is created for the given agent configuration and will accept incoming spans via the in channel.

func (*TraceWriter) FlushSync

func (w *TraceWriter) FlushSync() error

FlushSync blocks and sends pending payloads when syncMode is true

func (*TraceWriter) Run

func (w *TraceWriter) Run()

Run starts the TraceWriter.

func (*TraceWriter) Stop

func (w *TraceWriter) Stop()

Stop stops the TraceWriter and attempts to flush whatever is left in the senders buffers.

Jump to

Keyboard shortcuts

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