Documentation
¶
Overview ¶
Package senders provides functionality for sending data to Wavefront through the Wavefront proxy or via direct ingestion.
Index ¶
- func GetBuffer() *bytes.Buffer
- func HistoLine(name string, centroids []histogram.Centroid, ...) (string, error)
- func MetricLine(name string, value float64, ts int64, source string, tags map[string]string, ...) (string, error)
- func PutBuffer(buf *bytes.Buffer)
- func SpanLine(name string, startMillis, durationMillis int64, source, traceId, spanId string, ...) (string, error)
- func SpanLogJSON(traceId, spanId string, spanLogs []SpanLog) (string, error)
- type DirectConfiguration
- type DistributionSender
- type EventSender
- type MetricSender
- type ProxyConfiguration
- type Sender
- type SpanLog
- type SpanLogs
- type SpanSender
- type SpanTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HistoLine ¶ added in v0.9.1
func HistoLine(name string, centroids []histogram.Centroid, hgs map[histogram.Granularity]bool, ts int64, source string, tags map[string]string, defaultSource string) (string, error)
Gets a histogram line in the Wavefront histogram data format: {!M | !H | !D} [<timestamp>] #<count> <mean> [centroids] <histogramName> source=<source> [pointTags] Example: "!M 1533531013 #20 30.0 #10 5.1 request.latency source=appServer1 region=us-west"
func MetricLine ¶ added in v0.9.1
func MetricLine(name string, value float64, ts int64, source string, tags map[string]string, defaultSource string) (string, error)
Gets a metric line in the Wavefront metrics data format: <metricName> <metricValue> [<timestamp>] source=<source> [pointTags] Example: "new-york.power.usage 42422.0 1533531013 source=localhost datacenter=dc1"
func SpanLine ¶ added in v0.9.1
func SpanLine(name string, startMillis, durationMillis int64, source, traceId, spanId string, parents, followsFrom []string, tags []SpanTag, spanLogs []SpanLog, defaultSource string) (string, error)
Gets a span line in the Wavefront span data format: <tracingSpanName> source=<source> [pointTags] <start_millis> <duration_milli_seconds> Example: "getAllUsers source=localhost traceId=7b3bf470-9456-11e8-9eb6-529269fb1459 spanId=0313bafe-9457-11e8-9eb6-529269fb1459
parent=2f64e538-9457-11e8-9eb6-529269fb1459 application=Wavefront http.method=GET 1533531013 343500"
Types ¶
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 buffers 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 []histogram.Centroid, hgs map[histogram.Granularity]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 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)
Creates and returns a Wavefront Direct Ingestion Sender instance
func NewProxySender ¶
func NewProxySender(cfg *ProxyConfiguration) (Sender, error)
Creates and returns a Wavefront Proxy Sender instance
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