senders

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 14 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventLine added in v0.9.5

func EventLine(name string, startMillis, endMillis int64, source string, tags map[string]string, setters ...event.Option) (string, error)

EventLine encode the event to a wf proxy format set endMillis to 0 for a 'Instantaneous' event

func EventLineJSON added in v0.9.5

func EventLineJSON(name string, startMillis, endMillis int64, source string, tags map[string]string, setters ...event.Option) (string, error)

EventLine encode the event to a wf API format set endMillis to 0 for a 'Instantaneous' event

func HistoLine added in v0.9.1

func HistoLine(name string, centroids histogram.Centroids, 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"

func SpanLogJSON added in v0.9.3

func SpanLogJSON(traceId, spanId string, spanLogs []SpanLog) (string, error)

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 500,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 Deprecated: Use 'senders.NewSender(url)'

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
}

DistributionSender 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, setters ...event.Option) error
}

EventSender 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
}

MetricSender Interface for sending metrics to Wavefront

type MultiSender added in v0.9.8

type MultiSender interface {
	Sender
}

MultiSender Interface for sending metrics, distributions and spans to multiple Wavefront services at the same time

func NewMultiSender added in v0.9.8

func NewMultiSender(senders ...Sender) MultiSender

NewMultiSender creates a new Wavefront MultiClient

type Option added in v0.9.8

type Option func(*configuration)

Option Wavefront client configuration options

func BatchSize added in v0.9.8

func BatchSize(n int) Option

BatchSize set max batch of data sent per flush interval. defaults to 10,000. recommended not to exceed 40,000.

func FlushIntervalSeconds added in v0.9.8

func FlushIntervalSeconds(n int) Option

FlushIntervalSeconds set the interval (in seconds) at which to flush data to Wavefront. defaults to 1 Second.

func MaxBufferSize added in v0.9.8

func MaxBufferSize(n int) Option

MaxBufferSize set the size of internal buffers beyond which received data is dropped.

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.
	EventsPort       int // events port on which the proxy is listening on.

	FlushIntervalSeconds int // defaults to 1 second
}

Configuration for the proxy sender Deprecated: Use 'senders.NewSender(url)'

type Sender

Sender Interface for sending metrics, distributions and spans to Wavefront

func NewDirectSender

func NewDirectSender(cfg *DirectConfiguration) (Sender, error)

NewDirectSender creates and returns a Wavefront Direct Ingestion Sender instance Deprecated: Use 'senders.NewSender(url)'

func NewProxySender

func NewProxySender(cfg *ProxyConfiguration) (Sender, error)

Creates and returns a Wavefront Proxy Sender instance Deprecated: Use 'senders.NewSender(url)'

func NewSender added in v0.9.8

func NewSender(wfURL string, setters ...Option) (Sender, error)

NewSender creates Wavefront client

type SpanLog

type SpanLog struct {
	Timestamp int64             `json:"timestamp"`
	Fields    map[string]string `json:"fields"`
}

type SpanLogs added in v0.9.3

type SpanLogs struct {
	TraceId string    `json:"traceId"`
	SpanId  string    `json:"spanId"`
	Logs    []SpanLog `json:"logs"`
}

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
}

SpanSender Interface for sending tracing spans to Wavefront

type SpanTag

type SpanTag struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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