jaeger

package module
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 25 Imported by: 1,052

README

OpenTelemetry-Go Jaeger Exporter

Go Reference

OpenTelemetry span exporter for Jaeger implementation.

Installation

go get -u go.opentelemetry.io/otel/exporters/jaeger

Example

See ../../example/jaeger.

Configuration

The exporter can be used to send spans to:

Environment Variables

The following environment variables can be used (instead of options objects) to override the default configuration.

Environment variable Option Default value
OTEL_EXPORTER_JAEGER_AGENT_HOST WithAgentHost localhost
OTEL_EXPORTER_JAEGER_AGENT_PORT WithAgentPort 6831
OTEL_EXPORTER_JAEGER_ENDPOINT WithEndpoint http://localhost:14268/api/traces
OTEL_EXPORTER_JAEGER_USER WithUsername
OTEL_EXPORTER_JAEGER_PASSWORD WithPassword

Configuration using options have precedence over the environment variables.

Contributing

This exporter uses a vendored copy of the Apache Thrift library (v0.14.1) at a custom import path. When re-generating Thrift code in the future, please adapt import paths as necessary.

References

Documentation

Overview

Package jaeger contains an OpenTelemetry tracing exporter for Jaeger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentEndpointOption

type AgentEndpointOption interface {
	// contains filtered or unexported methods
}

AgentEndpointOption configures a Jaeger agent endpoint.

func WithAgentHost

func WithAgentHost(host string) AgentEndpointOption

WithAgentHost sets a host to be used in the agent client endpoint. This option overrides any value set for the OTEL_EXPORTER_JAEGER_AGENT_HOST environment variable. If this option is not passed and the env var is not set, "localhost" will be used by default.

func WithAgentPort

func WithAgentPort(port string) AgentEndpointOption

WithAgentPort sets a port to be used in the agent client endpoint. This option overrides any value set for the OTEL_EXPORTER_JAEGER_AGENT_PORT environment variable. If this option is not passed and the env var is not set, "6831" will be used by default.

func WithAttemptReconnectingInterval

func WithAttemptReconnectingInterval(interval time.Duration) AgentEndpointOption

WithAttemptReconnectingInterval sets the interval between attempts to re resolve agent endpoint.

func WithDisableAttemptReconnecting

func WithDisableAttemptReconnecting() AgentEndpointOption

WithDisableAttemptReconnecting sets option to disable reconnecting udp client.

func WithLogger

func WithLogger(logger *log.Logger) AgentEndpointOption

WithLogger sets a logger to be used by agent client. WithLogger and WithLogr will overwrite each other.

func WithLogr added in v1.12.0

func WithLogr(logger logr.Logger) AgentEndpointOption

WithLogr sets a logr.Logger to be used by agent client. WithLogr and WithLogger will overwrite each other.

func WithMaxPacketSize

func WithMaxPacketSize(size int) AgentEndpointOption

WithMaxPacketSize sets the maximum UDP packet size for transport to the Jaeger agent.

type CollectorEndpointOption

type CollectorEndpointOption interface {
	// contains filtered or unexported methods
}

CollectorEndpointOption configures a Jaeger collector endpoint.

func WithEndpoint

func WithEndpoint(endpoint string) CollectorEndpointOption

WithEndpoint is the URL for the Jaeger collector that spans are sent to. This option overrides any value set for the OTEL_EXPORTER_JAEGER_ENDPOINT environment variable. If this option is not passed and the environment variable is not set, "http://localhost:14268/api/traces" will be used by default.

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 in the authorization header sent for all requests to the collector. This option overrides any value set for the OTEL_EXPORTER_JAEGER_PASSWORD environment variable. If this option is not passed and the environment variable is not set, no password will be set.

func WithUsername

func WithUsername(username string) CollectorEndpointOption

WithUsername sets the username to be used in the authorization header sent for all requests to the collector. This option overrides any value set for the OTEL_EXPORTER_JAEGER_USER environment variable. If this option is not passed and the environment variable is not set, no username will be set.

type EndpointOption

type EndpointOption interface {
	// contains filtered or unexported methods
}

EndpointOption configures a Jaeger endpoint.

func WithAgentEndpoint

func WithAgentEndpoint(options ...AgentEndpointOption) EndpointOption

WithAgentEndpoint configures the Jaeger exporter to send spans to a Jaeger agent over compact thrift protocol. This will use the following environment variables for configuration if no explicit option is provided:

- OTEL_EXPORTER_JAEGER_AGENT_HOST is used for the agent address host - OTEL_EXPORTER_JAEGER_AGENT_PORT is used for the agent address port

The passed options will take precedence over any environment variables and default values will be used if neither are provided.

func WithCollectorEndpoint

func WithCollectorEndpoint(options ...CollectorEndpointOption) EndpointOption

WithCollectorEndpoint defines the full URL to the Jaeger HTTP Thrift collector. This will use the following environment variables for configuration if no explicit option is provided:

- OTEL_EXPORTER_JAEGER_ENDPOINT is the HTTP endpoint for sending spans directly to a collector. - OTEL_EXPORTER_JAEGER_USER is the username to be sent as authentication to the collector endpoint. - OTEL_EXPORTER_JAEGER_PASSWORD is the password to be sent as authentication to the collector endpoint.

The passed options will take precedence over any environment variables. If neither values are provided for the endpoint, the default value of "http://localhost:14268/api/traces" will be used. If neither values are provided for the username or the password, they will not be set since there is no default.

type Exporter

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

Exporter exports OpenTelemetry spans to a Jaeger agent or collector.

func New

func New(endpointOption EndpointOption) (*Exporter, error)

New returns an OTel Exporter implementation that exports the collected spans to Jaeger.

func (*Exporter) ExportSpans

func (e *Exporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

ExportSpans transforms and exports OpenTelemetry spans to Jaeger.

func (*Exporter) MarshalLog added in v1.5.0

func (e *Exporter) MarshalLog() interface{}

MarshalLog is the marshaling function used by the logging system to represent this exporter.

func (*Exporter) Shutdown

func (e *Exporter) Shutdown(ctx context.Context) error

Shutdown stops the Exporter. This will close all connections and release all resources held by the Exporter.

Jump to

Keyboard shortcuts

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