VMware has ended active development of this project, this repository will no longer be updated.
This exporter provides OpenCensus trace and stats support to push metrics, histograms and traces into Wavefront.
It builds on the Wavefront Go SDK.
- Go 1.11 or higher
-
Import the SDK and Exporter packages.
import ( "github.com/wavefronthq/wavefront-sdk-go/senders" "github.com/wavefronthq/opencensus-exporter/wavefront" "go.opencensus.io/stats/view" "go.opencensus.io/trace" )
-
Initialize the Sender and Exporter.
sender, _ := senders.NewProxySender(senders.ProxyConfiguration{/*...*/}) exporter, _ = wavefront.NewExporter(sender, /*options...*/) defer func() { // Flush before application exits exporter.Stop() sender.Close() }()
The exporter supports functional options. See Exporter Options
-
Register the exporter
trace.RegisterExporter(exporter) // for exporting traces view.RegisterExporter(exporter) // for exporting metrics
-
Instrument your code using OpenCensus. Learn more at https://opencensus.io/quickstart/go/
Option | Description |
---|---|
Source(string) |
Overrides the source tag that is sent in Metrics and Traces |
QueueSize(int) |
Sets the maximum number of metrics and spans queued before new ones are dropped. QueueSize must be >= 0 |
AppTags(application.Tags) |
Sets the application tags. See example and SDK for more info |
Granularity(histogram.Granularity...) |
Sets the histogram Granularities that must be sent. See SDK docs |
DisableSelfHealth() |
Disables reporting exporter health such as dropped metrics, spans, etc... |
VerboseLogging() |
Logs individual errors to stderr |
See examples folder for a complete example.
view.DistributionData
Notes
Currently, DistributionData
views will appear as a collection of 5 metrics in Wavefront.
For example, if a metric name is my.dist.metric
, it's represented in Wavefront as-
my.dist.metric.count // represents DistributionData.Count
my.dist.metric.min // represents DistributionData.Min
my.dist.metric.max // represents DistributionData.Max
my.dist.metric.mean // represents DistributionData.Mean
my.dist.metric.sumsq // represents DistributionData.SumOfSquaredDev