This exporter provides OpenCensus trace and stats support to push metrics, histograms and traces into Wavefront.
It builds on the Wavefront Go SDK.
-
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.
- Go 1.9 or higher