go.opencensus.io: go.opencensus.io/exporter/zipkin Index | Examples | Files | Directories

package zipkin

import "go.opencensus.io/exporter/zipkin"

Package zipkin contains an trace exporter for Zipkin.

Code:

// import (
//     openzipkin "github.com/openzipkin/zipkin-go"
//     "github.com/openzipkin/zipkin-go/reporter/http"
//     "go.opencensus.io/exporter/trace/zipkin"
// )

localEndpoint, err := openzipkin.NewEndpoint("server", "192.168.1.5:5454")
if err != nil {
    log.Print(err)
}
reporter := http.NewReporter("http://localhost:9411/api/v2/spans")
exporter := zipkin.NewExporter(reporter, localEndpoint)
trace.RegisterExporter(exporter)

Index

Examples

Package Files

zipkin.go

type Exporter Uses

type Exporter struct {
    // contains filtered or unexported fields
}

Exporter is an implementation of trace.Exporter that uploads spans to a Zipkin server.

func NewExporter Uses

func NewExporter(reporter reporter.Reporter, localEndpoint *model.Endpoint) *Exporter

NewExporter returns an implementation of trace.Exporter that uploads spans to a Zipkin server.

reporter is a Zipkin Reporter which will be used to send the spans. These can be created with the openzipkin library, using one of the packages under github.com/openzipkin/zipkin-go/reporter.

localEndpoint sets the local endpoint of exported spans. It can be constructed with github.com/openzipkin/zipkin-go.NewEndpoint, e.g.:

localEndpoint, err := NewEndpoint("my server", listener.Addr().String())

localEndpoint can be nil.

func (*Exporter) ExportSpan Uses

func (e *Exporter) ExportSpan(s *trace.SpanData)

ExportSpan exports a span to a Zipkin server.

Directories

PathSynopsis
example

Package zipkin imports 5 packages (graph) and is imported by 7 packages. Updated 2019-02-24. Refresh now. Tools for package owners.