observability

package
v0.0.0-...-e368295 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindlingServiceNamePrefix = "kindling"
	StdoutKindExporter        = "stdout"
	OtlpGrpcKindExporter      = "otlp"
	PrometheusKindExporter    = "prometheus"
)
View Source
const Int64BoundaryMultiplier = 1e6

Variables

View Source
var DefaultConfig = Config{
	ExportKind:  "stdout",
	PromCfg:     nil,
	OtlpGrpcCfg: nil,
	StdoutCfg:   &StdoutConfig{CollectPeriod: 10 * time.Second},
}

Functions

func InitTelemetry

func InitTelemetry(logger *zap.Logger, config *Config) (metric.MeterProvider, error)

func RegisterExtraMetrics

func RegisterExtraMetrics(selectors []string, mp metric.MeterProvider)

func StartServer

func StartServer(exporter *prometheus.Exporter, logger *zap.Logger, port string) error

Types

type Config

type Config struct {
	ExportKind  string            `mapstructure:"export_kind"`
	PromCfg     *PrometheusConfig `mapstructure:"prometheus"`
	OtlpGrpcCfg *OtlpGrpcConfig   `mapstructure:"otlp"`
	StdoutCfg   *StdoutConfig     `mapstructure:"stdout"`
}

type OtlpGrpcConfig

type OtlpGrpcConfig struct {
	CollectPeriod time.Duration `mapstructure:"collect_period,omitempty"`
	Endpoint      string        `mapstructure:"endpoint,omitempty"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Port         string   `mapstructure:"port,omitempty"`
	ExtraMetrics []string `mapstructure:"extra_metrics"`
}

type StdoutConfig

type StdoutConfig struct {
	CollectPeriod time.Duration `mapstructure:"collect_period,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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