config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string like "24h", "7d", "30d"

Types

type AppStorageConfig

type AppStorageConfig struct {
	Type string `yaml:"type"`
	Path string `yaml:"path"`
}

AppStorageConfig contains app storage configuration

type Config

type Config struct {
	Server    ServerConfig    `yaml:"server"`
	OTLP      OTLPConfig      `yaml:"otlp"`
	Storage   StorageConfig   `yaml:"storage"`
	Retention RetentionConfig `yaml:"retention"`
	Rollups   RollupsConfig   `yaml:"rollups"`
	Logging   LoggingConfig   `yaml:"logging"`
	Worker    WorkerConfig    `yaml:"worker"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads configuration from a YAML file

type LoggingConfig

type LoggingConfig struct {
	Level  string `yaml:"level"`
	Format string `yaml:"format"`
}

LoggingConfig contains logging configuration

type OTLPConfig

type OTLPConfig struct {
	GRPCEndpoint      string `yaml:"grpc_endpoint"`
	HTTPEndpoint      string `yaml:"http_endpoint"`
	AgentGRPCEndpoint string `yaml:"agent_grpc_endpoint"` // Endpoint to offer to agents (if different from grpc_endpoint)
	AgentHTTPEndpoint string `yaml:"agent_http_endpoint"` // Endpoint to offer to agents (if different from http_endpoint)
}

OTLPConfig contains OTLP receiver configuration

type RetentionConfig

type RetentionConfig struct {
	RawMetrics string `yaml:"raw_metrics"`
	RawLogs    string `yaml:"raw_logs"`
	Rollups1m  string `yaml:"rollups_1m"`
	Rollups5m  string `yaml:"rollups_5m"`
}

RetentionConfig contains data retention configuration

type RollupsConfig

type RollupsConfig struct {
	Enabled    bool   `yaml:"enabled"`
	Interval1m string `yaml:"interval_1m"`
	Interval5m string `yaml:"interval_5m"`
}

RollupsConfig contains rollup configuration

type ServerConfig

type ServerConfig struct {
	HTTPPort  int `yaml:"http_port"`
	OpAMPPort int `yaml:"opamp_port"`
}

ServerConfig contains server configuration

type StorageConfig

type StorageConfig struct {
	App       AppStorageConfig       `yaml:"app"`
	Telemetry TelemetryStorageConfig `yaml:"telemetry"`
}

StorageConfig contains storage configuration

type TelemetryStorageConfig

type TelemetryStorageConfig struct {
	Type string `yaml:"type"`
	Path string `yaml:"path"`
}

TelemetryStorageConfig contains telemetry storage configuration

type WorkerConfig added in v0.1.2

type WorkerConfig struct {
	QueueSize int    `yaml:"queue_size"`
	Workers   int    `yaml:"workers"`
	Timeout   string `yaml:"timeout"` // Duration string like "5s", "1m"
}

WorkerConfig contains worker pool configuration

Jump to

Keyboard shortcuts

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