Debian Codegraph @

exporters/otlp/otlptrace/clients.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
5
6 import (
7 "context"
8
9 tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
10 )
11
12 // Client manages connections to the collector, handles the
13 // transformation of data into wire format, and the transmission of that
14 // data to the collector.
15 type Client interface {
16 // DO NOT CHANGE: any modification will not be backwards compatible and
17 // must never be done outside of a new major release.
18
19 // Start should establish connection(s) to endpoint(s). It is
20 // called just once by the exporter, so the implementation
21 // does not need to worry about idempotence and locking.
22 Start(ctx context.Context) error
23 // DO NOT CHANGE: any modification will not be backwards compatible and
24 // must never be done outside of a new major release.
25
26 // Stop should close the connections. The function is called
27 // only once by the exporter, so the implementation does not
28 // need to worry about idempotence, but it may be called
29 // concurrently with UploadTraces, so proper
30 // locking is required. The function serves as a
31 // synchronization point - after the function returns, the
32 // process of closing connections is assumed to be finished.
33 Stop(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
37 // UploadTraces should transform the passed traces to the wire
38 // format and send it to the collector. May be called
39 // concurrently.
40 UploadTraces(ctx context.Context, protoSpans []*tracepb.ResourceSpans) error
41 // DO NOT CHANGE: any modification will not be backwards compatible and
42 // must never be done outside of a new major release.
43 }