config

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPrometheusSelectorValid added in v1.16.0

func IsPrometheusSelectorValid(selector string) bool

func ReadFromFile added in v1.12.3

func ReadFromFile() ([]byte, error)

Types

type AlertingRule added in v1.18.0

type AlertingRule struct {
	Id                   string                     `yaml:"id"`
	Name                 *string                    `yaml:"name,omitempty"`
	Source               *model.AlertSource         `yaml:"source,omitempty"`
	Selector             *model.AppSelector         `yaml:"selector,omitempty"`
	Severity             *string                    `yaml:"severity,omitempty"`
	For                  *timeseries.Duration       `yaml:"for,omitempty"`
	KeepFiringFor        *timeseries.Duration       `yaml:"keepFiringFor,omitempty"`
	Templates            *model.AlertTemplates      `yaml:"templates,omitempty"`
	NotificationCategory *model.ApplicationCategory `yaml:"notificationCategory,omitempty"`
	Enabled              *bool                      `yaml:"enabled,omitempty"`
}

func (*AlertingRule) Validate added in v1.18.0

func (ar *AlertingRule) Validate() error

type ApplicationCategory added in v1.12.3

type ApplicationCategory struct {
	Name                           model.ApplicationCategory `yaml:"name"`
	db.ApplicationCategorySettings `yaml:",inline"`
}

func (*ApplicationCategory) Validate added in v1.12.3

func (c *ApplicationCategory) Validate() error

type Auth

type Auth struct {
	AnonymousRole          string `yaml:"anonymous_role"`
	BootstrapAdminPassword string `yaml:"bootstrap_admin_password"`
}

type Cache

type Cache struct {
	TTL        timeseries.Duration `yaml:"ttl"`
	GCInterval timeseries.Duration `yaml:"gc_interval"`
}

type ClickHouseSpaceManager added in v1.13.0

type ClickHouseSpaceManager struct {
	Enabled               bool `yaml:"enabled"`
	UsageThresholdPercent int  `yaml:"usage_threshold_percent"`
	MinPartitions         int  `yaml:"min_partitions"`
}

type Clickhouse

type Clickhouse struct {
	Address       string `yaml:"address"`
	User          string `yaml:"user"`
	Password      string `yaml:"password"`
	Database      string `yaml:"database"`
	TlsEnable     bool   `yaml:"tls_enable"`
	TlsSkipVerify bool   `yaml:"tls_skip_verify"`
}

func (*Clickhouse) Validate

func (c *Clickhouse) Validate() error

type CollectorConfig added in v1.16.0

type CollectorConfig struct {
	TracesTTL   timeseries.Duration
	LogsTTL     timeseries.Duration
	ProfilesTTL timeseries.Duration
	MetricsTTL  timeseries.Duration
}

type Config

type Config struct {
	ListenAddress string `yaml:"listen_address"`
	UrlBasePath   string `yaml:"url_base_path"`
	DataDir       string `yaml:"data_dir"`

	GRPC GRPC `yaml:"grpc"`
	TLS  *TLS `yaml:"tls"`

	Cache    Cache    `yaml:"cache"`
	Traces   Traces   `yaml:"traces"`
	Logs     Logs     `yaml:"logs"`
	Profiles Profiles `yaml:"profiles"`
	Metrics  Metrics  `yaml:"metrics"`

	Postgres         *Postgres   `yaml:"postgres"`
	GlobalPrometheus *Prometheus `yaml:"global_prometheus"`
	GlobalClickhouse *Clickhouse `yaml:"global_clickhouse"`

	Auth Auth `yaml:"auth"`

	Projects []Project `yaml:"projects"`

	DoNotCheckForDeployments bool `yaml:"do_not_check_for_deployments"`
	DoNotCheckForUpdates     bool `yaml:"do_not_check_for_updates"`
	DisableUsageStatistics   bool `yaml:"disable_usage_statistics"`
	DisableBuiltinAlerts     bool `yaml:"disableBuiltinAlerts"`

	DeveloperMode bool `yaml:"developer_mode"`

	ClickHouseSpaceManager ClickHouseSpaceManager `yaml:"clickhouse_space_manager"`

	CorootCloud *cloud.Settings `yaml:"corootCloud"`

	BootstrapClickhouse *Clickhouse `yaml:"-"`
	BootstrapPrometheus *Prometheus `yaml:"-"`
}

func Load

func Load() (*Config, error)

func NewConfig added in v1.12.3

func NewConfig() *Config

func (*Config) ApplyFlags added in v1.12.3

func (cfg *Config) ApplyFlags()

func (*Config) Bootstrap

func (cfg *Config) Bootstrap(database *db.DB) error

func (*Config) GetBootstrapClickhouse

func (cfg *Config) GetBootstrapClickhouse() *db.IntegrationClickhouse

func (*Config) GetBootstrapPrometheus

func (cfg *Config) GetBootstrapPrometheus() *db.IntegrationPrometheus

func (*Config) GetGlobalClickhouse

func (cfg *Config) GetGlobalClickhouse() *db.IntegrationClickhouse

func (*Config) GetGlobalPrometheus

func (cfg *Config) GetGlobalPrometheus() *db.IntegrationPrometheus

func (*Config) Validate added in v1.12.3

func (cfg *Config) Validate() error

type CustomApplication added in v1.12.3

type CustomApplication struct {
	Name                    string `yaml:"name"`
	model.CustomApplication `yaml:",inline"`
}

func (*CustomApplication) Validate added in v1.12.3

func (c *CustomApplication) Validate() error

type GRPC added in v1.14.3

type GRPC struct {
	Disabled      bool   `yaml:"disabled"`
	ListenAddress string `yaml:"listenAddress"`
}

type InspectionOverrides added in v1.13.4

type InspectionOverrides struct {
	SLOAvailability []SLOAvailabilityOverride `yaml:"sloAvailability"`
	SLOLatency      []SLOLatencyOverride      `yaml:"sloLatency"`
}

func (*InspectionOverrides) Validate added in v1.13.4

func (io *InspectionOverrides) Validate() error

type Logs added in v1.8.9

type Logs struct {
	TTL timeseries.Duration `yaml:"ttl"`
}

type Metrics added in v1.16.0

type Metrics struct {
	TTL timeseries.Duration `yaml:"ttl"`
}

type Postgres

type Postgres struct {
	ConnectionString string `yaml:"connection_string"`
}

type Profiles added in v1.8.9

type Profiles struct {
	TTL timeseries.Duration `yaml:"ttl"`
}

type Project

type Project struct {
	Name string `yaml:"name"`

	MemberProjects []string `yaml:"memberProjects"`

	RemoteCoroot *RemoteCoroot `yaml:"remoteCoroot"`

	ApiKeys      []db.ApiKey `yaml:"apiKeys"`
	ApiKeysSnake []db.ApiKey `yaml:"api_keys"` // TODO: remove

	NotificationIntegrations *db.NotificationIntegrations `yaml:"notificationIntegrations"`
	ApplicationCategories    []ApplicationCategory        `yaml:"applicationCategories"`
	CustomApplications       []CustomApplication          `yaml:"customApplications"`

	AlertingRules []AlertingRule `yaml:"alertingRules"`

	InspectionOverrides *InspectionOverrides `yaml:"inspectionOverrides"`
}

func (*Project) Validate added in v1.12.3

func (p *Project) Validate() error

type Prometheus

type Prometheus struct {
	Url             string              `yaml:"url"`
	RefreshInterval timeseries.Duration `yaml:"refresh_interval"`
	TlsSkipVerify   bool                `yaml:"tls_skip_verify"`
	User            string              `yaml:"user"`
	Password        string              `yaml:"password"`
	ExtraSelector   string              `yaml:"extra_selector"`
	CustomHeaders   map[string]string   `yaml:"custom_headers"`
	RemoteWriteUrl  string              `yaml:"remote_write_url"`
	UseClickHouse   bool                `yaml:"use_clickhouse"`
}

func (*Prometheus) Validate

func (p *Prometheus) Validate() error

type RemoteCoroot added in v1.17.7

type RemoteCoroot struct {
	Url              string        `yaml:"url"`
	TlsSkipVerify    bool          `yaml:"tlsSkipVerify"`
	ApiKey           string        `yaml:"apiKey"`
	MetricResolution time.Duration `yaml:"metricResolution"`
}

func (*RemoteCoroot) ClickHouseConfig added in v1.17.7

func (rc *RemoteCoroot) ClickHouseConfig() *db.IntegrationClickhouse

func (*RemoteCoroot) PrometheusConfig added in v1.17.7

func (rc *RemoteCoroot) PrometheusConfig() *db.IntegrationPrometheus

func (*RemoteCoroot) Validate added in v1.17.7

func (rc *RemoteCoroot) Validate() error

type SLOAvailabilityOverride added in v1.13.4

type SLOAvailabilityOverride struct {
	ApplicationId    model.ApplicationId `yaml:"applicationId"`
	ObjectivePercent float32             `yaml:"objectivePercent"`
}

func (*SLOAvailabilityOverride) Validate added in v1.13.4

func (o *SLOAvailabilityOverride) Validate() error

type SLOLatencyOverride added in v1.13.4

type SLOLatencyOverride struct {
	ApplicationId      model.ApplicationId `yaml:"applicationId"`
	ObjectivePercent   float32             `yaml:"objectivePercent"`
	ObjectiveThreshold time.Duration       `yaml:"objectiveThreshold"`
}

func (*SLOLatencyOverride) Validate added in v1.13.4

func (o *SLOLatencyOverride) Validate() error

type TLS added in v1.14.3

type TLS struct {
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`
}

func (*TLS) Validate added in v1.14.3

func (c *TLS) Validate() error

type Traces added in v1.8.9

type Traces struct {
	TTL timeseries.Duration `yaml:"ttl"`
}

Jump to

Keyboard shortcuts

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