jaeger

package module
v0.0.0-...-a1b153e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 22 Imported by: 1

README

OpenTelemetry-Go Jaeger Exporter

OpenTelemetry Jaeger exporter

Installation

go get -u github.com/Ch1f/otel/exporters/trace/jaeger

Documentation

Overview

Package jaeger contains an OpenTelemetry tracing exporter for Jaeger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectorEndpointFromEnv

func CollectorEndpointFromEnv() string

CollectorEndpointFromEnv return environment variable value of JAEGER_ENDPOINT

func NewExportPipeline

func NewExportPipeline(endpointOption EndpointOption, opts ...Option) (apitrace.Provider, func(), error)

NewExportPipeline sets up a complete export pipeline with the recommended setup for trace provider

Types

type CollectorEndpointOption

type CollectorEndpointOption func(o *CollectorEndpointOptions)

func WithCollectorEndpointOptionFromEnv

func WithCollectorEndpointOptionFromEnv() CollectorEndpointOption

WithCollectorEndpointOptionFromEnv uses environment variables to set the username and password if basic auth is required.

func WithHTTPClient

func WithHTTPClient(client *http.Client) CollectorEndpointOption

WithHTTPClient sets the http client to be used to make request to the collector endpoint.

func WithPassword

func WithPassword(password string) CollectorEndpointOption

WithPassword sets the password to be used if basic auth is required.

func WithUsername

func WithUsername(username string) CollectorEndpointOption

WithUsername sets the username to be used if basic auth is required.

type CollectorEndpointOptions

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

type EndpointOption

type EndpointOption func() (batchUploader, error)

func WithAgentEndpoint

func WithAgentEndpoint(agentEndpoint string) EndpointOption

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

func WithCollectorEndpoint

func WithCollectorEndpoint(collectorEndpoint string, options ...CollectorEndpointOption) EndpointOption

WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector. For example, http://localhost:14268/api/traces

type Exporter

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

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

func NewRawExporter

func NewRawExporter(endpointOption EndpointOption, opts ...Option) (*Exporter, error)

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

It will IGNORE Disabled option.

func (*Exporter) ExportSpan

func (e *Exporter) ExportSpan(ctx context.Context, d *export.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 Option

type Option func(*options)

func RegisterAsGlobal

func RegisterAsGlobal() Option

RegisterAsGlobal enables the registration of the trace provider of the new pipeline as Global Trace Provider.

func WithBufferMaxCount

func WithBufferMaxCount(bufferMaxCount int) Option

WithBufferMaxCount defines the total number of traces that can be buffered in memory

func WithDisabled

func WithDisabled(disabled bool) Option

func WithDisabledFromEnv

func WithDisabledFromEnv() Option

WithDisabledFromEnv uses environment variables and overrides disabled field.

func WithProcess

func WithProcess(process Process) Option

WithProcess sets the process with the information about the exporting process.

func WithProcessFromEnv

func WithProcessFromEnv() Option

WithProcessFromEnv uses environment variables and overrides jaeger exporter's Process.

func WithSDK

func WithSDK(config *sdktrace.Config) Option

WithSDK sets the SDK config for the exporter pipeline.

type Process

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

	// Tags are added to Jaeger Process exports
	Tags []kv.KeyValue
}

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

func ProcessFromEnv

func ProcessFromEnv() Process

ProcessFromEnv parse environment variables into jaeger exporter's Process. It will return a nil tag slice if the environment variable JAEGER_TAGS is malformed.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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