Data collected by OpenCensus can be exported to any analysis tool or storage backend. OpenCensus exporters can be contributed by anyone, and we provide support for several open source backends and vendors out-of-the-box.

Once you choose your backend, follow the instructions to initialize an exporter. Then, register the initialized exporter.


As an example, a Prometheus exporter is registered and Prometheus is going to scrape :9091 to read the collected data:

import (

func main() {
    exporter, err := prometheus.NewExporter(prometheus.Options{Namespace: "demo"})
    if err != nil {

    // In a seperate go routine, run the Prometheus metrics scraping handler
    go func() {
        http.Handle("/metrics", exporter)
        log.Fatal(http.ListenAndServe(":9091", nil))
    // ... continue with your code
// Add the dependencies by following the instructions at
// https://github.com/census-instrumentation/opencensus-java/tree/master/exporters/stats/prometheus


// Uses a simple Prometheus HTTPServer to export metrics.
io.prometheus.client.exporter.HTTPServer server =
    new HTTPServer("localhost", 9091, true);


As an example, a Zipkin exporter is registered. All collected trace data will be reported to the registered Zipkin endpoint:

import (
    openzipkin "github.com/openzipkin/zipkin-go"

localEndpoint, err := openzipkin.NewEndpoint("example-server", "")
if err != nil {
reporter := http.NewReporter("http://localhost:9411/api/v2/spans")
defer reporter.Close()

exporter := zipkin.NewExporter(reporter, localEndpoint)
// Add the dependencies by following the instructions
// at https://github.com/census-instrumentation/opencensus-java/tree/master/exporters/trace/zipkin

    "http://localhost:9411/api/v2/spans", "example-server");

Exporters can be registered dynamically and unregistered. But most users will register an exporter in their main application and never unregister it.

Libraries instrumented with OpenCensus should not register exporters. Exporters should only be registered by main applications.

Supported Backends

T Backend supports Tracing

S Backend supports Stats

Backend C++ Erlang Go Java Node.js PHP Python Ruby
Datadog T S
Instana T T
Jaeger T T T T
Prometheus S S S S
SignalFX S
Stackdriver T S T T S T S T T
Zipkin T T T T T T