OpenCensus Go Exporter

Zenoss maintains the opencensus-go-exporter-zenoss library to allow Go applications instrumented with OpenCensus to export metrics to Zenoss Cloud.


You can install this library into your GOPATH with the following command.

go get -u


Using the exporter requires importing the package, creating an exporter, and registering the exporter.

package main

import (
	// OpenCensus packages.

	// Zenoss helper for sending directly to a single API endpoint.

	// Zenoss OpenCensus exporter.

const (
    ZenossAPIKey = "YOUR-API-KEY"
    ZenossSource = "YOUR-APPLICATION"

func main() {
	// Create a Zenoss API client to which we'll send metrics. 
	client, _ := endpoint.New(endpoint.Config{APIKey: ZenossAPIKey})

    // Create Zenoss OpenCensus exporter.
    exporter, _ := zenoss.NewExporter(zenoss.Options{
        Output: client,
        Source: ZenossSource,

    // Register Zenoss OpenCensus exporter. 

    // Instrument your application with OpenCensus stats.

    // Flush client before exiting to send any buffered metrics.

A complete working example can be found in the examples/ directory of the opencensus-go-exporter-zenoss repository.