package otlptrace
import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
Package otlptrace contains abstractions for OTLP span exporters. See the official OTLP span exporter implementations:
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc,
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp.
Index ¶
- func Version() string
- type Client
- type Exporter
- func New(ctx context.Context, client Client) (*Exporter, error)
- func NewUnstarted(client Client) *Exporter
- func (e *Exporter) ExportSpans(ctx context.Context, ss []tracesdk.ReadOnlySpan) error
- func (e *Exporter) MarshalLog() any
- func (e *Exporter) Shutdown(ctx context.Context) error
- func (e *Exporter) Start(ctx context.Context) error
Functions ¶
func Version ¶
func Version() string
Version is the current release version of the OpenTelemetry OTLP trace exporter in use.
Types ¶
type Client ¶
type Client interface {
// Start should establish connection(s) to endpoint(s). It is
// called just once by the exporter, so the implementation
// does not need to worry about idempotence and locking.
Start(ctx context.Context) error
// Stop should close the connections. The function is called
// only once by the exporter, so the implementation does not
// need to worry about idempotence, but it may be called
// concurrently with UploadTraces, so proper
// locking is required. The function serves as a
// synchronization point - after the function returns, the
// process of closing connections is assumed to be finished.
Stop(ctx context.Context) error
// UploadTraces should transform the passed traces to the wire
// format and send it to the collector. May be called
// concurrently.
UploadTraces(ctx context.Context, protoSpans []*tracepb.ResourceSpans) error
}
Client manages connections to the collector, handles the transformation of data into wire format, and the transmission of that data to the collector.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter exports trace data in the OTLP wire format.
func New ¶
New constructs a new Exporter and starts it.
func NewUnstarted ¶
NewUnstarted constructs a new Exporter and does not start it.
func (*Exporter) ExportSpans ¶
ExportSpans exports a batch of spans.
func (*Exporter) MarshalLog ¶
MarshalLog is the marshaling function used by the logging system to represent this Exporter.
func (*Exporter) Shutdown ¶
Shutdown flushes all exports and closes all connections to the receiving endpoint.
func (*Exporter) Start ¶
Start establishes a connection to the receiving endpoint.
Source Files ¶
clients.go doc.go exporter.go version.go
Directories ¶
| Path | Synopsis |
|---|---|
| internal |
- Version
- v1.43.0 (latest)
- Published
- Apr 3, 2026
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- now –
Tools for package owners.