Documentation
¶
Index ¶
- type Alert
- type AlertFile
- type AlertGroup
- type Alerting
- type AlertingFile
- type AlertingType
- type ChartOptions
- type Config
- type Dashboard
- type Datasource
- type DatasourceConfig
- type DatasourceSelector
- type DatasourceSystem
- type DatasourceType
- type Discovery
- type EtcUser
- type Fire
- type Panel
- type QueryData
- type QueryResult
- type Row
- type Rule
- type RuleAlert
- type RuleFile
- type RuleGroup
- type Target
- type Threshold
- type User
- type UserConfig
- type VentiVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Datasource *Datasource `json:"datasource"`
State promRule.AlertState `json:"state"` // commonModel doesn't have pending state
ActiveAt commonModel.Time `json:"activeAt"`
}
type AlertFile ¶
type AlertFile struct {
Kind string `json:"kind,omitempty"`
CommonLabels map[string]string `json:"commonLabels,omitempty"`
DatasourceSelector DatasourceSelector `json:"datasourceSelector"`
AlertGroups []AlertGroup `json:"groups"`
}
type AlertGroup ¶
type AlertGroup struct {
Name string `json:"name"`
Interval commonModel.Duration `json:"interval,omitempty"`
Limit int `json:"limit,omitempty"`
RuleAlerts []RuleAlert `json:"ruleAlerts"`
}
type Alerting ¶
type Alerting struct {
Name string `yaml:"name"`
Type AlertingType `yaml:"type"`
URL string `yaml:"url"`
}
type AlertingFile ¶
type AlertingFile struct {
Alertings []Alerting `yaml:"alertings"`
}
type AlertingType ¶
type AlertingType string
const (
AlertingTypeAlertmanager AlertingType = "alertmanager"
)
type ChartOptions ¶
type ChartOptions struct {
YMax int `json:"yMax,omitempty" yaml:"yMax,omitempty"`
}
type Config ¶
type Config struct {
Version string
DatasourceConfig DatasourceConfig
UserConfig UserConfig
}
type Datasource ¶
type Datasource struct {
Type DatasourceType `json:"type" yaml:"type"`
Name string `json:"name" yaml:"name"`
URL string `json:"url" yaml:"url"`
BasicAuth bool `json:"basicAuth" yaml:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser" yaml:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword" yaml:"basicAuthPassword"`
IsMain bool `json:"isMain,omitempty" yaml:"isMain,omitempty"`
IsDiscovered bool `json:"isDiscovered,omitempty" yaml:"isDiscovered,omitempty"`
}
type DatasourceConfig ¶
type DatasourceConfig struct {
QueryTimeout time.Duration `json:"queryTimeout,omitempty" yaml:"queryTimeout,omitempty"`
Datasources []Datasource `json:"datasources" yaml:"datasources,omitempty"`
Discovery Discovery `json:"discovery,omitempty" yaml:"discovery,omitempty"`
}
type DatasourceSelector ¶
type DatasourceSelector struct {
System DatasourceSystem `json:"system" yaml:"system"`
Type DatasourceType `json:"type" yaml:"type"`
}
type DatasourceSystem ¶
type DatasourceSystem string
const ( DatasourceSystemNone DatasourceSystem = "" DatasourceSystemMain DatasourceSystem = "main" DatasourceSystemSub DatasourceSystem = "sub" )
type DatasourceType ¶
type DatasourceType string
const ( DatasourceTypeNone DatasourceType = "" DatasourceTypePrometheus DatasourceType = "prometheus" DatasourceTypeLethe DatasourceType = "lethe" )
type Discovery ¶
type Discovery struct {
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` // default: false
MainNamespace string `json:"mainNamespace,omitempty" yaml:"mainNamespace,omitempty"` // default: ”
AnnotationKey string `json:"annotationKey,omitempty" yaml:"annotationKey,omitempty"` // default: kuoss.org/datasource-type
ByNamePrometheus bool `json:"byNamePrometheus,omitempty" yaml:"byNamePrometheus,omitempty"` // deprecated
ByNameLethe bool `json:"byNameLethe,omitempty" yaml:"byNameLethe,omitempty"` // deprecated
}
type Panel ¶
type Panel struct {
Title string `json:"title" yaml:"title"`
Type string `json:"type" yaml:"type"`
Headers []string `json:"headers,omitempty" yaml:"headers,omitempty"`
Targets []Target `json:"targets" yaml:"targets"`
ChartOptions *ChartOptions `json:"chartOptions,omitempty" yaml:"chartOptions,omitempty"`
}
type QueryData ¶
type QueryData struct {
ResultType commonModel.ValueType `json:"resultType"`
Result []commonModel.Sample `json:"result"`
}
type QueryResult ¶
type Rule ¶
type Rule struct {
Record string `json:"record,omitempty" yaml:"record,omitempty"`
Alert string `json:"alert,omitempty" yaml:"alert,omitempty"`
Expr string `json:"expr" yaml:"expr"`
For commonModel.Duration `json:"for" yaml:"for,omitempty"`
KeepFiringFor commonModel.Duration `json:"keep_firing_for,omitempty" yaml:"keep_firing_for,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}
type RuleFile ¶
type RuleFile struct {
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
DatasourceSelector DatasourceSelector `json:"datasourceSelector" yaml:"datasourceSelector"`
RuleGroups []RuleGroup `json:"groups" yaml:"groups"`
}
type RuleGroup ¶
type RuleGroup struct {
Name string `json:"name" yaml:"name"`
Interval commonModel.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
Limit int `json:"limit,omitempty" yaml:"limit,omitempty"`
Rules []Rule `json:"rules" yaml:"rules"`
}
type Target ¶
type Target struct {
Expr string `json:"expr"`
Legend string `json:"legend,omitempty" yaml:"legend,omitempty"`
Legends []string `json:"legends,omitempty" yaml:"legends,omitempty"`
Unit string `json:"unit,omitempty" yaml:"unit,omitempty"`
Columns []string `json:"columns,omitempty" yaml:"columns,omitempty"`
Headers []string `json:"headers,omitempty" yaml:"headers,omitempty"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
Thresholds []Threshold `json:"thresholds,omitempty" yaml:"thresholds,omitempty"`
Aggregation string `json:"aggregation,omitempty" yaml:"aggregation,omitempty"`
}
TODO: what Legend, Legends is for?
type UserConfig ¶
type UserConfig struct {
EtcUsers []EtcUser `yaml:"users"`
}
type VentiVersion ¶
Click to show internal directories.
Click to hide internal directories.