Documentation ¶
Index ¶
- func NewClient(conf *config.AgentConfig) *http.Client
- func SetExtraHeaders(h http.Header, extras map[string]string)
- type BasePayloadSender
- type BaseWriter
- type DatadogEndpoint
- type Endpoint
- type NullEndpoint
- type Payload
- type PayloadSender
- type QueuablePayloadSender
- type RetriableError
- type SampledTrace
- type SendStats
- type SenderFailureEvent
- type SenderRetryEvent
- type SenderSuccessEvent
- type ServiceWriter
- type StatsWriter
- type TraceWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasePayloadSender ¶
type BasePayloadSender struct {
// contains filtered or unexported fields
}
BasePayloadSender encodes structures and behaviours common to most PayloadSenders.
func NewBasePayloadSender ¶
func NewBasePayloadSender(endpoint Endpoint) *BasePayloadSender
NewBasePayloadSender creates a new instance of a BasePayloadSender using the provided endpoint.
func (*BasePayloadSender) Monitor ¶
func (s *BasePayloadSender) Monitor() <-chan interface{}
Monitor allows an external entity to monitor events of this sender by receiving Sender*Event structs.
func (*BasePayloadSender) Send ¶
func (s *BasePayloadSender) Send(payload *Payload)
Send sends a single isolated payload through this sender.
func (*BasePayloadSender) Stop ¶
func (s *BasePayloadSender) Stop()
Stop asks this sender to stop and waits until it correctly stops.
type BaseWriter ¶
type BaseWriter struct {
// contains filtered or unexported fields
}
BaseWriter encodes the base components and behaviour of a typical Writer.
func NewBaseWriter ¶
func NewBaseWriter(conf *config.AgentConfig, path string, senderFactory func(Endpoint) PayloadSender) *BaseWriter
NewBaseWriter creates a new instance of a BaseWriter.
func (*BaseWriter) Start ¶
func (w *BaseWriter) Start()
Start starts the necessary components of a BaseWriter.
func (*BaseWriter) Stop ¶
func (w *BaseWriter) Stop()
Stop stops any the stoppable components of a BaseWriter.
type DatadogEndpoint ¶
type DatadogEndpoint struct {
// contains filtered or unexported fields
}
DatadogEndpoint sends payloads to Datadog API.
func NewDatadogEndpoint ¶
func NewDatadogEndpoint(client *http.Client, url, path, apiKey string) *DatadogEndpoint
NewDatadogEndpoint returns an initialized DatadogEndpoint, from a provided http client and remote endpoint path.
func (*DatadogEndpoint) String ¶
func (e *DatadogEndpoint) String() string
func (*DatadogEndpoint) Write ¶
func (e *DatadogEndpoint) Write(payload *Payload) error
Write will send the serialized traces payload to the Datadog traces endpoint.
type NullEndpoint ¶
type NullEndpoint struct{}
NullEndpoint is a void endpoint dropping data.
func (*NullEndpoint) Write ¶
func (ne *NullEndpoint) Write(payload *Payload) error
Write of NullEndpoint just drops the payload and log its size.
type PayloadSender ¶
type PayloadSender interface { Start() Run() Stop() Send(payload *Payload) Monitor() <-chan interface{} // contains filtered or unexported methods }
PayloadSender represents an object capable of asynchronously sending payloads to some endpoint.
type QueuablePayloadSender ¶
type QueuablePayloadSender struct { BasePayloadSender // contains filtered or unexported fields }
QueuablePayloadSender is a specific implementation of a PayloadSender that will queue new payloads on error and retry sending them according to some configurable BackoffTimer.
func NewCustomQueuablePayloadSender ¶
func NewCustomQueuablePayloadSender(endpoint Endpoint, conf writerconfig.QueuablePayloadSenderConf) *QueuablePayloadSender
NewCustomQueuablePayloadSender constructs a new QueuablePayloadSender with custom configuration to send payloads to the provided endpoint.
func NewQueuablePayloadSender ¶
func NewQueuablePayloadSender(endpoint Endpoint) *QueuablePayloadSender
NewQueuablePayloadSender constructs a new QueuablePayloadSender with default configuration to send payloads to the provided endpoint.
func (*QueuablePayloadSender) NumQueuedPayloads ¶
func (s *QueuablePayloadSender) NumQueuedPayloads() int
NumQueuedPayloads returns the number of payloads currently waiting in the queue for a retry
func (*QueuablePayloadSender) Run ¶
func (s *QueuablePayloadSender) Run()
Run executes the QueuablePayloadSender main logic synchronously.
func (*QueuablePayloadSender) Start ¶
func (s *QueuablePayloadSender) Start()
Start asynchronously starts this QueueablePayloadSender.
type RetriableError ¶
type RetriableError struct {
// contains filtered or unexported fields
}
RetriableError is an endpoint error that signifies that the associated operation can be retried at a later point.
func (*RetriableError) Error ¶
func (re *RetriableError) Error() string
Error returns the error string.
type SampledTrace ¶
SampledTrace represents the result of a trace sample operation.
func (*SampledTrace) Empty ¶
func (s *SampledTrace) Empty() bool
Empty returns true if this SampledTrace has no data.
type SenderFailureEvent ¶
SenderFailureEvent encodes information related to the failed sending of a payload without subsequent retry.
type SenderRetryEvent ¶
type SenderRetryEvent struct { Payload *Payload SendTime time.Duration Error error RetryDelay time.Duration RetryNum int }
SenderRetryEvent encodes information related to the failed sending of a payload that triggered an automatic retry.
type SenderSuccessEvent ¶
SenderSuccessEvent encodes information related to the successful sending of a payload.
type ServiceWriter ¶
type ServiceWriter struct { InServices <-chan model.ServicesMetadata BaseWriter // contains filtered or unexported fields }
ServiceWriter ingests service metadata and flush them to the API.
func NewServiceWriter ¶
func NewServiceWriter(conf *config.AgentConfig, InServices <-chan model.ServicesMetadata) *ServiceWriter
NewServiceWriter returns a new writer for services.
func (*ServiceWriter) Run ¶
func (w *ServiceWriter) Run()
Run runs the main loop of the writer goroutine. If buffers services read from input chan and flushes them when necessary.
type StatsWriter ¶
type StatsWriter struct { BaseWriter // InStats is the stream of stat buckets to send out. InStats <-chan []model.StatsBucket // contains filtered or unexported fields }
StatsWriter ingests stats buckets and flushes them to the API.
func NewStatsWriter ¶
func NewStatsWriter(conf *config.AgentConfig, InStats <-chan []model.StatsBucket) *StatsWriter
NewStatsWriter returns a new writer for stats.
func (*StatsWriter) Run ¶
func (w *StatsWriter) Run()
Run runs the event loop of the writer's main goroutine. It reads stat buckets from InStats, builds stat payloads and sends them out using the base writer.
func (*StatsWriter) Start ¶
func (w *StatsWriter) Start()
Start starts the writer, awaiting stat buckets and flushing them.
type TraceWriter ¶
type TraceWriter struct { BaseWriter // contains filtered or unexported fields }
TraceWriter ingests sampled traces and flushes them to the API.
func NewTraceWriter ¶
func NewTraceWriter(conf *config.AgentConfig, in <-chan *SampledTrace) *TraceWriter
NewTraceWriter returns a new writer for traces.
func (*TraceWriter) Run ¶
func (w *TraceWriter) Run()
Run runs the main loop of the writer goroutine. It sends traces to the payload constructor, flushing it periodically and collects stats which are also reported periodically.