Documentation

Overview

Package observability sets up and configures observability tools.

Package observability sets up and configures observability tools.

Package observability sets up and configures observability tools.

Package observability sets up and configures observability tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ExporterType ExporterType `env:"OBSERVABILITY_EXPORTER, default=STACKDRIVER"`

	OpenCensusConfig
	StackdriverConfig
	OCAgentConfig
}

Config holds all of the configuration options for the observability exporter

type Exporter

type Exporter interface {
	InitExportOnce() error
}

Exporter defines the minimum shared functionality for an observability exporter used by this application.

func NewFromEnv

func NewFromEnv(ctx context.Context, config *Config) (Exporter, error)

NewFromEnv returns the observability exporter given the provided configuration, or an error if it failed to be created.

type ExporterType

type ExporterType string

ExporterType represents a type of observability exporter.

const (
	ExporterStackdriver ExporterType = "STACKDRIVER"
	ExporterPrometheus  ExporterType = "PROMETHEUS"
	ExporterOCAgent     ExporterType = "OCAGENT"
	ExporterNoop        ExporterType = "NOOP"
)

type GenericExporter

type GenericExporter struct {
	// contains filtered or unexported fields
}

GenericExporter is a standard implementation of an exporter that wraps the opencensus interfaces with custom configuration

func (*GenericExporter) InitExportOnce

func (g *GenericExporter) InitExportOnce() error

type NoopExporter

type NoopExporter struct{}

NoopExporter is an observability exporter that does nothing.

func (*NoopExporter) InitExportOnce

func (g *NoopExporter) InitExportOnce() error

type OCAgentConfig

type OCAgentConfig struct {
	Insecure bool   `env:"OCAGENT_INSECURE, default=true"`
	Endpoint string `env:"OCAGENT_TRACE_EXPORTER_ENDPOINT"`
}

OCAgentConfig holds the configuration options for the default opencensus exporter

type OpenCensusConfig

type OpenCensusConfig struct {
	TraceProbabilitySampleRate float64 `env:"TRACE_PROBABILITY, default=0.40"`
}

OpenCensusConfig holds the configuration options for the open census exporter

type StackdriverConfig

type StackdriverConfig struct {
	ProjectID string `env:"PROJECT_ID, default=$GOOGLE_CLOUD_PROJECT"`
}

StackdriverConfig holds the configuration options for the stackdriver exporter