Documentation
¶
Overview ¶
Package otlp exports spans to an OpenTelemetry collector, or any service that takes OTLP over HTTP (Grafana Tempo, Honeycomb, Jaeger, SigNoz, Datadog, New Relic…), as OTLP/HTTP JSON:
tracing.New(tracing.Options{Exporters: []tracing.Exporter{otlp.New(otlp.Options{})}})
With no options it reads the standard environment variables: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT or OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_HEADERS or OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES, as logging/otlp does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter sends spans over OTLP/HTTP. Make one with New.
type Options ¶
type Options struct {
// Endpoint is the URL spans are posted to, ending in /v1/traces.
Endpoint string
// Headers are sent with each request, such as an API key.
Headers http.Header
// ServiceName is the service.name resource attribute.
ServiceName string
// Resource adds resource attributes.
Resource map[string]string
// NoGzip sends requests uncompressed.
NoGzip bool
// Client sends the requests. The default is http.DefaultClient.
Client *http.Client
}
Options configures the exporter. Unset fields come from the environment.
Click to show internal directories.
Click to hide internal directories.