Deprecated: Use exporters/otlp/otlptrace or exporters/otlp/otlpmetric instead.

package otlpconfig

import "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig"

Index

Constants

const (
	DefaultMaxAttempts int = 5

	DefaultTracesPath string = "/v1/traces"

	DefaultMetricsPath string = "/v1/metrics"

	DefaultBackoff time.Duration = 300 * time.Millisecond

	DefaultTimeout time.Duration = 10 * time.Second

	DefaultServiceConfig = "" /* 480 byte string literal not displayed */

)
const (
	WeakCertificate = "" /* 594 byte string literal not displayed */

	WeakPrivateKey = "" /* 244 byte string literal not displayed */

)

Functions

func ApplyGRPCEnvConfigs

func ApplyGRPCEnvConfigs(cfg *Config)

func ApplyHTTPEnvConfigs

func ApplyHTTPEnvConfigs(cfg *Config)

func CreateTLSConfig

func CreateTLSConfig(certBytes []byte) (*tls.Config, error)

CreateTLSConfig creates a tls.Config from a raw certificate bytes to verify a server certificate.

func ReadTLSConfigFromFile

func ReadTLSConfigFromFile(path string) (*tls.Config, error)

ReadTLSConfigFromFile reads a PEM certificate file and creates a tls.Config that will use this certifate to verify a server certificate.

Types

type Config

type Config struct {
	// Signal specific configurations
	Metrics SignalConfig
	Traces  SignalConfig

	// General configurations
	MaxAttempts int
	Backoff     time.Duration

	// HTTP configuration
	Marshaler otlp.Marshaler

	// gRPC configurations
	ReconnectionPeriod time.Duration
	ServiceConfig      string
	DialOptions        []grpc.DialOption
}

func NewDefaultConfig

func NewDefaultConfig() Config

type EnvOptionsReader

type EnvOptionsReader struct {
	GetEnv   func(string) string
	ReadFile func(filename string) ([]byte, error)
}

func (*EnvOptionsReader) ApplyGRPCEnvConfigs

func (e *EnvOptionsReader) ApplyGRPCEnvConfigs(cfg *Config)

func (*EnvOptionsReader) ApplyHTTPEnvConfigs

func (e *EnvOptionsReader) ApplyHTTPEnvConfigs(cfg *Config)

func (*EnvOptionsReader) GetOptionsFromEnv

func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption

type GRPCOption

type GRPCOption interface {
	ApplyGRPCOption(*Config)
	// contains filtered or unexported methods
}

GRPCOption applies an option to the gRPC driver.

func NewGRPCOption

func NewGRPCOption(fn func(cfg *Config)) GRPCOption

type GenericOption

type GenericOption interface {
	ApplyHTTPOption(*Config)
	ApplyGRPCOption(*Config)
	// contains filtered or unexported methods
}

GenericOption applies an option to the HTTP or gRPC driver.

func WithBackoff

func WithBackoff(duration time.Duration) GenericOption

func WithCompression

func WithCompression(compression otlp.Compression) GenericOption

func WithEndpoint

func WithEndpoint(endpoint string) GenericOption

func WithHeaders

func WithHeaders(headers map[string]string) GenericOption

func WithInsecure

func WithInsecure() GenericOption

func WithInsecureMetrics

func WithInsecureMetrics() GenericOption

func WithInsecureTraces

func WithInsecureTraces() GenericOption

func WithMaxAttempts

func WithMaxAttempts(maxAttempts int) GenericOption

func WithMetricsCompression

func WithMetricsCompression(compression otlp.Compression) GenericOption

func WithMetricsEndpoint

func WithMetricsEndpoint(endpoint string) GenericOption

func WithMetricsHeaders

func WithMetricsHeaders(headers map[string]string) GenericOption

func WithMetricsTLSClientConfig

func WithMetricsTLSClientConfig(tlsCfg *tls.Config) GenericOption

func WithMetricsTimeout

func WithMetricsTimeout(duration time.Duration) GenericOption

func WithMetricsURLPath

func WithMetricsURLPath(urlPath string) GenericOption

func WithTLSClientConfig

func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption

func WithTimeout

func WithTimeout(duration time.Duration) GenericOption

func WithTracesCompression

func WithTracesCompression(compression otlp.Compression) GenericOption

func WithTracesEndpoint

func WithTracesEndpoint(endpoint string) GenericOption

func WithTracesHeaders

func WithTracesHeaders(headers map[string]string) GenericOption

func WithTracesTLSClientConfig

func WithTracesTLSClientConfig(tlsCfg *tls.Config) GenericOption

func WithTracesTimeout

func WithTracesTimeout(duration time.Duration) GenericOption

func WithTracesURLPath

func WithTracesURLPath(urlPath string) GenericOption

type HTTPOption

type HTTPOption interface {
	ApplyHTTPOption(*Config)
	// contains filtered or unexported methods
}

HTTPOption applies an option to the HTTP driver.

func NewHTTPOption

func NewHTTPOption(fn func(cfg *Config)) HTTPOption

type SignalConfig

type SignalConfig struct {
	Endpoint    string
	Insecure    bool
	TLSCfg      *tls.Config
	Headers     map[string]string
	Compression otlp.Compression
	Timeout     time.Duration
	URLPath     string

	// gRPC configurations
	GRPCCredentials credentials.TransportCredentials
}

Source Files

envconfig.go options.go tls.go

Version
v0.20.1 (latest)
Published
Mar 9, 2023
Platform
linux/amd64
Imports
14 packages
Last checked
2 weeks ago

Tools for package owners.