Documentation
¶
Index ¶
- func CreateConfig(wfURL string, setters ...Option) (*configuration, error)
- func EventLine(name string, startMillis, endMillis int64, source string, ...) (string, error)
- func EventLineJSON(name string, startMillis, endMillis int64, source string, ...) (string, error)
- func HistoLine(name string, centroids histogram.Centroids, hgs map[histogram.Granularity]bool, ...) (string, error)
- func MetricLine(name string, value float64, ts int64, source string, tags map[string]string, ...) (string, error)
- func SpanLine(name string, startMillis, durationMillis int64, source, traceId, spanId string, ...) (string, error)
- func SpanLogJSON(traceId, spanId string, spanLogs []SpanLog) (string, error)
- type DirectConfigurationdeprecated
- type DistributionSender
- type EventSender
- type MetricSender
- type MultiSender
- type Option
- type ProxyConfigurationdeprecated
- type Sender
- type SpanLog
- type SpanLogs
- type SpanSender
- type SpanTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfig ¶ added in v0.9.10
CreateConfig is for internal use only.
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 is for internal use only.
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)
EventLineJSON is for internal use only.
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)
HistoLine is for internal use only.
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)
MetricLine is for internal use only.
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)
SpanLine is for internal use only.
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
deprecated
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
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
FlushIntervalSeconds set the interval (in seconds) at which to flush data to Wavefront. Defaults to 1 Second.
func MaxBufferSize ¶ added in v0.9.8
MaxBufferSize set the size of internal buffers beyond which received data is dropped. Defaults to 50,000.
func MetricsPort ¶ added in v0.9.10
MetricsPort sets the port on which to report metrics. Default is 2878.
func SDKMetricsTags ¶ added in v0.9.10
SDKMetricsTags adds the tags provided in tags to all internal metrics this library reports. Clients can use multiple SDKMetricsTags calls when creating a sender. In that case, the sender attaches all the tags from each of the SDKMetricsTags calls to all internal metrics. By default, the sender does not attach any tags to internal metrics.
func TracesPort ¶ added in v0.9.10
TracesPort sets the port on which to report traces. Default is 30001.
type ProxyConfiguration
deprecated
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
SDKMetricsTags map[string]string
}
Configuration for the proxy sender
Deprecated: Use 'senders.NewSender(url)'
type Sender ¶
type Sender interface {
MetricSender
DistributionSender
SpanSender
EventSender
internal.Flusher
Close()
}
Sender Interface for sending metrics, distributions and spans to Wavefront
func NewDirectSender
deprecated
func NewDirectSender(cfg *DirectConfiguration) (Sender, error)
NewDirectSender creates and returns a Wavefront Direct Ingestion Sender instance
Deprecated: Use 'senders.NewSender(url)'
func NewProxySender
deprecated
func NewProxySender(cfg *ProxyConfiguration) (Sender, error)
Creates and returns a Wavefront Proxy Sender instance
Deprecated: Use 'senders.NewSender(url)'
func NewWavefrontNoOpClient ¶ added in v0.9.9
NewWavefrontNoOpClient returns a Wavefront Client instance for which all operations are no-ops.
type SpanLogs ¶ added in v0.9.3
type SpanLogs struct {
TraceId string `json:"traceId"`
SpanId string `json:"spanId"`
Logs []SpanLog `json:"logs"`
}
SpanLogs is for internal use only.
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