Documentation
¶
Overview ¶
Package senders provides functionality for sending data to Wavefront through the Wavefront proxy or via direct ingestion.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Centroid ¶
A centroid encapsulates a mean value and the count of points associated with that value.
type DirectConfiguration ¶
type DirectConfiguration struct {
Server string // Wavefront URL of the form https://<INSTANCE>.wavefront.com
Token string // Wavefront API token with direct data ingestion permission
// max batch of data sent per flush interval. defaults to 10,000. recommended not to exceed 40,000.
BatchSize int
// size of internal buffer beyond which received data is dropped.
// helps with handling brief increases in data and buffering on errors.
// separate buffers are maintained per data type (metrics, spans and distributions)
// buffers are not pre-allocated to max size and vary based on actual usage.
// defaults to 50,000. higher values could use more memory.
MaxBufferSize int
// interval (in seconds) at which to flush data to Wavefront. defaults to 1 Second.
// together with batch size controls the max theoretical throughput of the sender.
FlushIntervalSeconds int
}
Configuration for the direct ingestion sender
type DistributionSender ¶
type DistributionSender interface {
// Sends a distribution of metrics to Wavefront with optional timestamp and tags.
// Each centroid is a 2-dimensional entity with the first dimension the mean value
// and the second dimension the count of points in the centroid.
// The granularity informs the set of intervals (minute, hour, and/or day) by which the
// histogram data should be aggregated.
SendDistribution(name string, centroids []Centroid, hgs map[HistogramGranularity]bool, ts int64, source string, tags map[string]string) error
}
Interface for sending distributions to Wavefront
type EventSender ¶
type EventSender interface {
// Sends an event to Wavefront with optional tags
SendEvent(name string, startMillis, endMillis int64, source string, tags map[string]string) error
}
Interface for sending events to Wavefront. NOT yet supported.
type HistogramGranularity ¶
type HistogramGranularity int8
The interval (MINUTE, HOUR and/or DAY) by which the histogram data should be aggregated.
const ( MINUTE HistogramGranularity = iota HOUR DAY )
func (*HistogramGranularity) String ¶
func (hg *HistogramGranularity) String() string
type MetricSender ¶
type MetricSender interface {
// Sends a single metric to Wavefront with optional timestamp and tags.
SendMetric(name string, value float64, ts int64, source string, tags map[string]string) error
// Sends a delta counter (counter aggregated at the Wavefront service) to Wavefront.
// the timestamp for a delta counter is assigned at the server side.
SendDeltaCounter(name string, value float64, source string, tags map[string]string) error
}
Interface for sending metrics to Wavefront
type ProxyConfiguration ¶
type ProxyConfiguration struct {
Host string // the hostname of the Wavefront proxy
MetricsPort int // metrics port on which the proxy is listening on, typically 2878.
DistributionPort int // distribution port on which the proxy is listening on, typically 40000.
TracingPort int // tracing port on which the proxy is listening on.
FlushIntervalSeconds int // defaults to 1 second
}
Configuration for the proxy sender
type Sender ¶
type Sender interface {
MetricSender
DistributionSender
SpanSender
internal.Flusher
Close()
}
Interface for sending metrics, distributions and spans to Wavefront
func NewDirectSender ¶
func NewDirectSender(cfg *DirectConfiguration) (Sender, error)
func NewProxySender ¶
func NewProxySender(cfg *ProxyConfiguration) (Sender, error)
type SpanSender ¶
type SpanSender interface {
// Sends a tracing span to Wavefront.
// traceId, spanId, parentIds and preceding spanIds are expected to be UUID strings.
// parents and preceding spans can be empty for a root span.
// span tag keys can be repeated (example: "user"="foo" and "user"="bar")
// span logs are currently omitted
SendSpan(name string, startMillis, durationMillis int64, source, traceId, spanId string, parents, followsFrom []string, tags []SpanTag, spanLogs []SpanLog) error
}
Interface for sending tracing spans to Wavefront