opencensus-exporter

module
v0.0.0-...-8af1c95 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0

README

VMware has ended active development of this project, this repository will no longer be updated.

Wavefront OpenCensus Go Exporter Build Status Go Report Card

This exporter provides OpenCensus trace and stats support to push metrics, histograms and traces into Wavefront.

It builds on the Wavefront Go SDK.

Requirements

  • Go 1.11 or higher

Usage

  1. 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"
    )
    
  2. 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

  3. Register the exporter

    trace.RegisterExporter(exporter)    // for exporting traces
    view.RegisterExporter(exporter)     // for exporting metrics
    
  4. Instrument your code using OpenCensus. Learn more at https://opencensus.io/quickstart/go/

Exporter Options

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

Directories

Path Synopsis
Package wavefront provides OpenCensus trace and stats support to push metrics, histograms and traces into Wavefront.
Package wavefront provides OpenCensus trace and stats support to push metrics, histograms and traces into Wavefront.

Jump to

Keyboard shortcuts

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