options

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorConfig

type CollectorConfig struct {
	Endpoint string `env:"ENDPOINT"`
}

CollectorConfig holds config values specific to the collector tracer exporter running locally / within your cluster. All the configuration values here have a prefix of SAT_TRACER_COLLECTOR_, specified in the top level Options struct, and the parent TracerConfig struct.

type ControlPlane

type ControlPlane struct {
	Address string `env:"SAT_CONTROL_PLANE"`
}

ControlPlane is a struct, so we can use a pointer, so we can check whether it's been set in config. If set, it holds address where the control plane is located so Sat can pull runnables from there.

type HoneycombConfig

type HoneycombConfig struct {
	Endpoint string `env:"ENDPOINT"`
	APIKey   string `env:"APIKEY"`
	Dataset  string `env:"DATASET"`
}

HoneycombConfig holds config values specific to the honeycomb tracer exporter. All the configuration values here have a prefix of SAT_TRACER_HONEYCOMB_, specified in the top level Options struct, and the parent TracerConfig struct.

type Ident

type Ident struct {
	Data string `env:"SAT_RUNNABLE_IDENT"`
}

Ident holds the runnable ident. It's a struct, so we can optionally have it set to nil. Config uses it.

type MetricsConfig

type MetricsConfig struct {
	Type        string             `env:"TYPE,default=none"`
	ServiceName string             `env:"SERVICENAME,default=sat"`
	OtelMetrics *OtelMetricsConfig `env:",prefix=OTEL_,noinit"`
}

type Options

type Options struct {
	EnvToken string   `env:"SAT_ENV_TOKEN"`
	Port     port     `env:"SAT_HTTP_PORT"`
	ProcUUID procUUID `env:"SAT_UUID"`

	ControlPlane *ControlPlane `env:",noinit"`
	Ident        *Ident        `env:",noinit"`
	Version      *Version      `env:",noinit"`

	TracerConfig  TracerConfig  `env:",prefix=SAT_TRACER_"`
	MetricsConfig MetricsConfig `env:",prefix=SAT_METRICS_"`

	Connections string `env:"SAT_CONNECTIONS"`
}

func Resolve

func Resolve(lookuper envconfig.Lookuper) (Options, error)

Resolve will use the passed in envconfig.Lookuper to figure out the options of the Sat instance startup. If nil is passed in, it will use the OsLookuper implementation.

type OtelMetricsConfig

type OtelMetricsConfig struct {
	Endpoint string `env:"ENDPOINT"`
}

type TracerConfig

type TracerConfig struct {
	TracerType      string           `env:"TYPE,default=none"`
	ServiceName     string           `env:"SERVICENAME,default=sat"`
	Probability     float64          `env:"PROBABILITY,default=0.5"`
	Collector       *CollectorConfig `env:",prefix=COLLECTOR_,noinit"`
	HoneycombConfig *HoneycombConfig `env:",prefix=HONEYCOMB_,noinit"`
}

TracerConfig holds values specific to setting up the tracer. It's only used in proxy mode. All configuration options have a prefix of SAT_TRACER_ specified in the parent Options struct.

type Version

type Version struct {
	Data string `env:"SAT_RUNNABLE_VERSION"`
}

Version holds the runnable version. It's a struct, so we can optionally have it set to nil. Config uses it.

Jump to

Keyboard shortcuts

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