forked from honeycombio/otel-config-go
/
common.go
32 lines (27 loc) · 882 Bytes
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package pipelines
import (
"go.opentelemetry.io/otel/sdk/resource"
"go.opentelemetry.io/otel/sdk/trace"
)
// Protocol defines the possible values of the protocol field.
type Protocol string
// These are the only possible values for Protocol.
const (
ProtocolGRPC Protocol = "grpc"
ProtocolHTTPProtobuf Protocol = "http/protobuf"
ProtocolHTTPJSON Protocol = "http/json"
)
// PipelineConfig contains config info for a Pipeline.
type PipelineConfig struct {
Protocol Protocol
Endpoint string
Insecure bool
Headers map[string]string
Resource *resource.Resource
ReportingPeriod string
Propagators []string
SpanProcessors []trace.SpanProcessor
Sampler trace.Sampler
}
// PipelineSetupFunc defines the interface for a Pipeline Setup function.
type PipelineSetupFunc func(PipelineConfig) (func() error, error)