Documentation ¶
Overview ¶
Package jaeger contains an OpenTelemetry tracing exporter for Jaeger.
Index ¶
- type AgentEndpointOption
- func WithAgentHost(host string) AgentEndpointOption
- func WithAgentPort(port string) AgentEndpointOption
- func WithAttemptReconnectingInterval(interval time.Duration) AgentEndpointOption
- func WithDisableAttemptReconnecting() AgentEndpointOption
- func WithLogger(logger *log.Logger) AgentEndpointOption
- func WithLogr(logger logr.Logger) AgentEndpointOption
- func WithMaxPacketSize(size int) AgentEndpointOption
- type CollectorEndpointOption
- type EndpointOption
- type Exporter
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 ¶
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.