jaeger

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

README ¶

OpenCensus Go Jaeger Exporter

Build Status GoDoc

Provides OpenCensus exporter support for Jaeger.

🛑 This library is not maintained

You should migrate to OpenTelemetry Jaeger Exporter.

This library depends on github.com/uber/jaeger-client-go which is DEPRECATED and its documentation says:

Jaeger clients are being retired.

Deprecating Jaeger clients

The Jaeger clients have faithfully served our community for several years. We pioneered many new features, such as remotely controlled samplers and per-operation / adaptive sampling, which were critical to the success of distributed tracing deployments at large organizations. However, now that the larger community in OpenTelemetry has caught up with the Jaeger clients in terms of feature parity and there is full support for exporting data to Jaeger, we believe it is time to decommission Jaeger’s native clients and refocus the efforts on the OpenTelemetry SDKs.

For new applications, we recommend using the OpenTelemetry APIs and SDKs. For existing applications that are already instrumented with the OpenTracing API, we recommend replacing the Jaeger clients with the corresponding OpenTelemetry SDKs and the OpenTracing shim/bridge available in most languages supported by Jaeger.

Timeline

We plan to continue accepting pull requests and making new releases of Jaeger clients through the end of 2021. In January 2022 we will enter a code freeze period for 6 months, during which time we will no longer accept pull requests with new features, with the exception of security-related fixes. After that we will archive the client library repositories and will no longer accept new changes.

Installation

$ go get -u github.com/teal-finance/opencensus-go-exporter-jaeger

Documentation ¶

Overview ¶

Package jaeger contains an OpenCensus tracing exporter for Jaeger.

Index ¶

Examples ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func EmitZipkinBatch ¶

func EmitZipkinBatch(spans []*zipkincore.Span) (err error)

EmitZipkinBatch implements EmitZipkinBatch() of Agent interface.

Types ¶

type Exporter ¶

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

Exporter is an implementation of trace.Exporter that uploads spans to Jaeger.

func NewExporter ¶

func NewExporter(o Options) (*Exporter, error)

NewExporter returns a trace.Exporter implementation that exports the collected spans to Jaeger.

Example (Agent) ¶
package main

import (
	"log"

	jaeger "github.com/teal-finance/opencensus-go-exporter-jaeger"
	"go.opencensus.io/trace"
)

func main() {
	// Register the Jaeger exporter to be able to retrieve
	// the collected spans.
	exporter, err := jaeger.NewExporter(jaeger.Options{
		AgentEndpoint: "localhost:6831",
		Process: jaeger.Process{
			ServiceName: "trace-demo",
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	trace.RegisterExporter(exporter)
}
Output:

Example (Collector) ¶
package main

import (
	"log"

	jaeger "github.com/teal-finance/opencensus-go-exporter-jaeger"
	"go.opencensus.io/trace"
)

func main() {
	// Register the Jaeger exporter to be able to retrieve
	// the collected spans.
	exporter, err := jaeger.NewExporter(jaeger.Options{
		Endpoint: "http://localhost:14268",
		Process: jaeger.Process{
			ServiceName: "trace-demo",
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	trace.RegisterExporter(exporter)
}
Output:

Example (ProcessTags) ¶

ExampleNewExporter_processTags shows how to set ProcessTags on a Jaeger exporter. These tags will be added to the exported Jaeger process.

package main

import (
	"log"

	jaeger "github.com/teal-finance/opencensus-go-exporter-jaeger"
	"go.opencensus.io/trace"
)

func main() {
	// Register the Jaeger exporter to be able to retrieve
	// the collected spans.
	exporter, err := jaeger.NewExporter(jaeger.Options{
		AgentEndpoint: "localhost:6831",
		Process: jaeger.Process{
			ServiceName: "trace-demo",
			Tags: []jaeger.Tag{
				jaeger.StringTag("ip", "127.0.0.1"),
				jaeger.BoolTag("demo", true),
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	trace.RegisterExporter(exporter)
}
Output:

func (*Exporter) ExportSpan ¶

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

ExportSpan exports a SpanData to Jaeger.

func (*Exporter) Flush ¶

func (e *Exporter) Flush()

Flush waits for exported trace spans to be uploaded.

This is useful if your program is ending and you do not want to lose recent spans.

type Options ¶

type Options struct {
	// Endpoint is the Jaeger HTTP Thrift endpoint.
	// For example, http://localhost:14268.
	//
	// Deprecated: Use CollectorEndpoint instead.
	Endpoint string

	// CollectorEndpoint is the full url to the Jaeger HTTP Thrift collector.
	// For example, http://localhost:14268/api/traces
	CollectorEndpoint string

	// AgentEndpoint instructs exporter to send spans to jaeger-agent at this address.
	// For example, localhost:6831.
	AgentEndpoint string

	// OnError is the hook to be called when there is
	// an error occurred when uploading the stats data.
	// If no custom hook is set, errors are logged.
	// Optional.
	OnError func(err error)

	// Username to be used if basic auth is required.
	// Optional.
	Username string

	// Password to be used if basic auth is required.
	// Optional.
	Password string

	// ServiceName is the Jaeger service name.
	// Deprecated: Specify Process instead.
	ServiceName string

	// Process contains the information about the exporting process.
	Process Process

	// BufferMaxCount defines the total number of traces that can be buffered in memory
	BufferMaxCount int
}

Options are the options to be used when initializing a Jaeger exporter.

type Process ¶

type Process struct {
	// ServiceName is the Jaeger service name.
	ServiceName string

	// Tags are added to Jaeger Process exports
	Tags []Tag
}

Process contains the information exported to jaeger about the source of the trace data.

type Tag ¶

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

Tag defines a key-value pair It is limited to the possible conversions to *jaeger.Tag by attributeToTag.

func BoolTag ¶

func BoolTag(key string, value bool) Tag

BoolTag creates a new tag of type bool, exported as jaeger.TagType_BOOL.

func Int64Tag ¶

func Int64Tag(key string, value int64) Tag

Int64Tag creates a new tag of type int64, exported as jaeger.TagType_LONG.

func StringTag ¶

func StringTag(key string, value string) Tag

StringTag creates a new tag of type string, exported as jaeger.TagType_STRING.

Directories ¶

Path Synopsis
Command jaeger is an example program that creates spans and uploads to Jaeger.
Command jaeger is an example program that creates spans and uploads to Jaeger.
Package propagation implement uber-trace-id header propagation used by Jaeger.
Package propagation implement uber-trace-id header propagation used by Jaeger.

Jump to

Keyboard shortcuts

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