2020-03-24 07:41:10 +02:00
|
|
|
// Copyright The OpenTelemetry Authors
|
2019-08-02 22:52:55 +02:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2021-04-07 17:03:43 +02:00
|
|
|
package trace // import "go.opentelemetry.io/otel/sdk/trace"
|
2019-08-02 22:52:55 +02:00
|
|
|
|
2021-04-07 17:03:43 +02:00
|
|
|
import "context"
|
2019-08-02 22:52:55 +02:00
|
|
|
|
2021-05-05 01:45:13 +02:00
|
|
|
// SpanExporter handles the delivery of spans to external receivers. This is
|
|
|
|
// the final component in the trace export pipeline.
|
2020-09-09 19:19:03 +02:00
|
|
|
type SpanExporter interface {
|
2021-06-18 16:56:11 +02:00
|
|
|
// DO NOT CHANGE: any modification will not be backwards compatible and
|
|
|
|
// must never be done outside of a new major release.
|
|
|
|
|
2021-05-05 01:45:13 +02:00
|
|
|
// ExportSpans exports a batch of spans.
|
2020-09-09 19:19:03 +02:00
|
|
|
//
|
|
|
|
// This function is called synchronously, so there is no concurrency
|
|
|
|
// safety requirement. However, due to the synchronous calling pattern,
|
|
|
|
// it is critical that all timeouts and cancellations contained in the
|
|
|
|
// passed context must be honored.
|
|
|
|
//
|
|
|
|
// Any retry logic must be contained in this function. The SDK that
|
|
|
|
// calls this function will not implement any retry logic. All errors
|
|
|
|
// returned by this function are considered unrecoverable and will be
|
|
|
|
// reported to a configured error Handler.
|
2021-05-05 01:45:13 +02:00
|
|
|
ExportSpans(ctx context.Context, spans []ReadOnlySpan) error
|
2021-06-18 16:56:11 +02:00
|
|
|
// DO NOT CHANGE: any modification will not be backwards compatible and
|
|
|
|
// must never be done outside of a new major release.
|
|
|
|
|
2020-09-09 19:19:03 +02:00
|
|
|
// Shutdown notifies the exporter of a pending halt to operations. The
|
2023-04-12 02:28:13 +02:00
|
|
|
// exporter is expected to perform any cleanup or synchronization it
|
2020-09-09 19:19:03 +02:00
|
|
|
// requires while honoring all timeouts and cancellations contained in
|
|
|
|
// the passed context.
|
2020-09-16 18:09:45 +02:00
|
|
|
Shutdown(ctx context.Context) error
|
2021-06-18 16:56:11 +02:00
|
|
|
// DO NOT CHANGE: any modification will not be backwards compatible and
|
|
|
|
// must never be done outside of a new major release.
|
2019-11-05 23:08:55 +02:00
|
|
|
}
|