Debian Codegraph @

sdk/trace/span_exporter.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package trace // import "go.opentelemetry.io/otel/sdk/trace"
5
6 import "context"
7
8 // SpanExporter handles the delivery of spans to external receivers. This is
9 // the final component in the trace export pipeline.
10 type SpanExporter interface {
11 // DO NOT CHANGE: any modification will not be backwards compatible and
12 // must never be done outside of a new major release.
13
14 // ExportSpans exports a batch of spans.
15 //
16 // This function is called synchronously, so there is no concurrency
17 // safety requirement. However, due to the synchronous calling pattern,
18 // it is critical that all timeouts and cancellations contained in the
19 // passed context must be honored.
20 //
21 // Any retry logic must be contained in this function. The SDK that
22 // calls this function will not implement any retry logic. All errors
23 // returned by this function are considered unrecoverable and will be
24 // reported to a configured error Handler.
25 ExportSpans(ctx context.Context, spans []ReadOnlySpan) error
26 // DO NOT CHANGE: any modification will not be backwards compatible and
27 // must never be done outside of a new major release.
28
29 // Shutdown notifies the exporter of a pending halt to operations. The
30 // exporter is expected to perform any cleanup or synchronization it
31 // requires while honoring all timeouts and cancellations contained in
32 // the passed context.
33 Shutdown(ctx context.Context) error
34 // DO NOT CHANGE: any modification will not be backwards compatible and
35 // must never be done outside of a new major release.
36 }