config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilParamProvided = errors.New("nil value provided")
	ErrInvalidParam     = errors.New("invalid value provided")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Metrics Metrics
	Tracing Tracing
	// contains filtered or unexported fields
}

func NewDefault

func NewDefault() *Config

func (*Config) Apply

func (c *Config) Apply(opts ...OptionFunc) (err error)

func (*Config) GetErrorHandler

func (c *Config) GetErrorHandler() otel.ErrorHandler

func (*Config) GetResource

func (c *Config) GetResource() *resource.Resource

type Export added in v0.2.0

type Export struct {
	AllowInsecure  bool
	UseCompression bool
	Named          string
	Endpoint       string
	Headers        map[string]string
}

type ExportOption added in v0.2.0

type ExportOption func(*Export) error

Method types to programatically validate additions to the existing config

func WithExporterEndpoint added in v0.2.0

func WithExporterEndpoint(endpoint string) ExportOption

WithPipelineEndpoint will validate that the provided endpoint has a valid schema and that the hostname can be resolved

func WithExporterHeaders added in v0.2.0

func WithExporterHeaders(headers map[string]string) ExportOption

func WithExporterInsecureConnection added in v0.2.0

func WithExporterInsecureConnection() ExportOption

func WithExporterNamed added in v0.2.0

func WithExporterNamed(named string) ExportOption

func WithExporterUseCompression added in v0.2.0

func WithExporterUseCompression() ExportOption

type Metrics added in v0.2.0

type Metrics struct {
	Enable bool

	Export Export

	CollectPeriod time.Duration
}

type MetricsOption added in v0.2.0

type MetricsOption func(*Metrics) error

Method types to programatically validate additions to the existing config

func WithMetricsCollectionPeriod added in v0.2.0

func WithMetricsCollectionPeriod(t time.Duration) MetricsOption

func WithMetricsExporterOptions added in v0.2.0

func WithMetricsExporterOptions(opts ...ExportOption) MetricsOption

type OptionFunc

type OptionFunc func(*Config) error

Method types to programatically validate additions to the existing config

func WithMetricsPipeline

func WithMetricsPipeline(pipeOpts ...MetricsOption) OptionFunc

func WithOtelErrorHandler

func WithOtelErrorHandler(handler otel.ErrorHandler) OptionFunc

func WithResource

func WithResource(ctx context.Context, detector resource.Detector) OptionFunc

func WithServiceName added in v0.1.0

func WithServiceName(name string) OptionFunc

func WithTracesPipeline

func WithTracesPipeline(pipeOpts ...TracingOption) OptionFunc

type Tracing added in v0.2.0

type Tracing struct {
	Enable bool

	Export Export

	Sample      bool
	Propagators []string
}

type TracingOption added in v0.2.0

type TracingOption func(*Tracing) error

Method types to programatically validate additions to the existing config

func WithTracingExporterOptions added in v0.2.0

func WithTracingExporterOptions(opts ...ExportOption) TracingOption

func WithTracingPropagators added in v0.2.0

func WithTracingPropagators(use ...string) TracingOption

func WithTracingSampled added in v0.2.0

func WithTracingSampled() TracingOption

Jump to

Keyboard shortcuts

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