otlpconfig

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxAttempts describes how many times the driver
	// should retry the sending of the payload in case of a
	// retryable error.
	DefaultMaxAttempts int = 5
	// DefaultTracesPath is a default URL path for endpoint that
	// receives spans.
	DefaultTracesPath string = "/v1/traces"
	// DefaultMetricsPath is a default URL path for endpoint that
	// receives metrics.
	DefaultMetricsPath string = "/v1/metrics"
	// DefaultBackoff is a default base backoff time used in the
	// exponential backoff strategy.
	DefaultBackoff time.Duration = 300 * time.Millisecond
	// DefaultTimeout is a default max waiting time for the backend to process
	// each span or metrics batch.
	DefaultTimeout time.Duration = 10 * time.Second
	// DefaultServiceConfig is the gRPC service config used if none is
	// provided by the user.
	DefaultServiceConfig = `` /* 478-byte string literal not displayed */

)
View Source
const (
	WeakCertificate = `` /* 592-byte string literal not displayed */

	WeakPrivateKey = `` /* 242-byte string literal not displayed */

)

Variables

This section is empty.

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL