Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClickHouse ¶
type ClickHouse struct {
DSN string `yaml:"dsn" validate:"uri" default:"http://127.0.0.1:8123/?async_insert=1&wait_for_async_insert=1"`
Params map[string]string `yaml:"params"`
QueryLog struct {
ConfigWhen `yaml:",inline"`
} `yaml:"query_log"`
}
type Config ¶
type Config struct {
ClickHouse ClickHouse `yaml:"clickhouse"`
Insert struct {
Enabled bool `yaml:"enabled" default:"true"`
Listen string `yaml:"listen" default:"0.0.0.0:9095" validate:"hostname_port"`
CloseConnections bool `yaml:"close-connections" default:"false"`
Table string `yaml:"table" default:"samples_null"`
IDFunc string `yaml:"id_func" default:"name_with_sha256" validate:"oneof=name_with_sha256"`
} `yaml:"insert"`
Select struct {
TableSeries string `yaml:"table_series" default:"series"`
TableSamples string `yaml:"table_samples" default:"samples"`
AutocompleteLookback time.Duration `yaml:"autocomplete_lookback" default:"168h"`
SeriesPartitionMs int64 `yaml:"series_partition_ms" default:"86400000"`
// https://clickhouse.com/docs/knowledgebase/improve-map-performance
// column names should be label_<label_name>
SeriesMaterializedLabels []string `yaml:"series_materialize_labels"`
SamplesTimestampUInt32 bool `yaml:"samples_timestamp_uint32"`
} `yaml:"select"`
Prometheus struct {
Enabled bool `yaml:"enabled" default:"true"`
Listen string `yaml:"listen" default:"0.0.0.0:9096" comment:"listen addr for prometheus ui and api"`
ExternalURL string `yaml:"external_url" default:"http://127.0.0.1:9096" comment:"allows to set URL for redirect manually"`
PageTitle string `yaml:"page_title" default:"Pluto"`
LookbackDelta time.Duration `yaml:"lookback_delta" default:"5m"`
RemoteReadConcurrencyLimit int `yaml:"remote_read_concurrency_limit" default:"10" comment:"concurrently handled remote read requests"`
} `yaml:"prometheus"`
Debug struct {
Enabled bool `yaml:"enabled" default:"true"`
Listen string `yaml:"listen" default:"0.0.0.0:9095"`
Pprof bool `yaml:"pprof" default:"true"`
Metrics bool `yaml:"metrics" default:"true"`
} `yaml:"debug"`
Logging zap.Config `yaml:"logging"`
OverrideInsert []struct {
ConfigInsert `yaml:",inline"`
ConfigWhen `yaml:",inline"`
} `yaml:"override_insert"`
OverrideSeries []struct {
ConfigSeries `yaml:",inline"`
ConfigWhen `yaml:",inline"`
} `yaml:"override_series"`
OverrideSamples []struct {
ConfigSamples `yaml:",inline"`
ConfigWhen `yaml:",inline"`
} `yaml:"override_samples"`
}
func (*Config) GetSamples ¶
func (cfg *Config) GetSamples(values *EnvSamples) (ConfigSamples, error)
type ConfigInsert ¶
type ConfigInsert struct {
Table string `yaml:"table"`
IDFunc string `yaml:"id_func" default:"" validate:"oneof='' 'name_with_sha256'"`
ClickHouse *ClickHouse `yaml:"clickhouse"`
}
type ConfigSamples ¶
type ConfigSamples struct {
Table string `yaml:"table"`
SamplesTimestampUInt32 bool `yaml:"samples_timestamp_uint32"`
ClickHouse *ClickHouse `yaml:"clickhouse"`
}
type ConfigSeries ¶
type ConfigWhen ¶
func (*ConfigWhen) Pass ¶
func (w *ConfigWhen) Pass() bool
type EnvInsert ¶
type EnvInsert struct {
GetParams map[string]string `expr:"GET"`
Headers map[string]string `expr:"HEADER"`
}
func NewEnvInsert ¶
func NewEnvInsert() *EnvInsert
type EnvQueryLog ¶
type EnvSeries ¶
type EnvSeries struct {
Start int64 `expr:"start"`
End int64 `expr:"end"`
Limit int `expr:"limit"`
Step int64 `expr:"step"`
Func string `expr:"func"`
Grouping []string `expr:"grouping"`
By bool `expr:"by"`
Range int64 `expr:"range"`
ShardCount uint64 `expr:"shard_count"`
ShardIndex uint64 `expr:"shard_index"`
DisableTrimming bool `expr:"disable_trimming"`
}
func NewEnvSeries ¶
func NewEnvSeries() *EnvSeries
Click to show internal directories.
Click to hide internal directories.