Documentation
¶
Index ¶
- func HTTPGet(url string, params map[string]string) (string, error)
- func InitDB()
- func LoadConfig(version string)
- func Run(ventiVersion string)
- func StartAlertDaemon()
- func StartServer()
- func TokenRequired(c *gin.Context)
- type Alert
- type AlertRule
- type AlertRuleGroup
- type AlertRuleGroupList
- type AlertState
- type ChartOptions
- type Config
- type Dashboard
- type Datasource
- type DatasourceType
- type DatasourcesConfig
- type EtcUser
- type EtcUsersConfig
- type InstantQuery
- type Panel
- type PathQuery
- type QueryData
- type QueryResult
- type RangeQuery
- type Row
- type Sample
- type Target
- type Threshold
- type User
- type ValueType
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(version string)
func StartAlertDaemon ¶
func StartAlertDaemon()
func StartServer ¶
func StartServer()
Types ¶
type AlertRule ¶
type AlertRule struct {
Alert string `json:"alert,omitempty"`
Expr string `json:"expr"`
For time.Duration `json:"for,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
State AlertState `json:"state,omitempty"`
ActiveAt time.Time `json:"activeStartTime,omitempty"`
}
type AlertRuleGroup ¶
type AlertRuleGroup struct {
Name string `json:"name"`
Rules []AlertRule `json:"rules"`
DatasourceType DatasourceType `json:"datasource" yaml:"datasource"`
CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
}
func GetAlertRuleGroups ¶
func GetAlertRuleGroups() []AlertRuleGroup
type AlertRuleGroupList ¶
type AlertRuleGroupList struct {
Groups []AlertRuleGroup `json:"groups"`
}
type AlertState ¶
type AlertState string
const ( AlertStateInactive AlertState = "inactive" AlertStatePending AlertState = "pending" AlertStateFiring AlertState = "firing" )
type ChartOptions ¶
type ChartOptions struct {
YMax int `json:"yMax,omitempty" yaml:"yMax,omitempty"`
}
type Config ¶
type Config struct {
Version string
EtcUsersConfig EtcUsersConfig
DatasourcesConfig DatasourcesConfig
Dashboards []Dashboard
AlertRuleGroups []AlertRuleGroup
}
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"`
IsDiscovered bool `json:"is_discovered,omitempty" yaml:"is_discovered,omitempty"`
}
func GetDatasources ¶
func GetDatasources() ([]Datasource, error)
func GetDefaultDatasource ¶
func GetDefaultDatasource(dstype DatasourceType) (Datasource, error)
type DatasourceType ¶
type DatasourceType string
datasource
const ( DatasourceTypeNone DatasourceType = "" DatasourceTypePrometheus DatasourceType = "prometheus" DatasourceTypeLethe DatasourceType = "lethe" )
type DatasourcesConfig ¶
type DatasourcesConfig struct {
QueryTimeout time.Duration `json:"queryTimeout"`
Datasources []Datasource `json:"datasources"`
}
type InstantQuery ¶
type InstantQuery struct {
Datasource Datasource `form:"datasource,omitempty"`
DatasourceType DatasourceType `form:"datasourceType,omitempty"`
Expr string `form:"expr"`
Time string `form:"time,omitempty"`
}
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 PathQuery ¶
type PathQuery struct {
Datasource Datasource
DatasourceType DatasourceType
Path string
Params map[string]string
Start string
End string
Step string
}
type QueryResult ¶
{"data":{"result":[],"resultType":"logs"},"status":"success"} {"status":"success","data":{"resultType":"vector","result":[]}}
type RangeQuery ¶
type RangeQuery struct {
Datasource Datasource `form:"datasource,omitempty"`
DatasourceType DatasourceType `form:"datasourceType,omitempty"`
Expr string `form:"expr"`
Start string `form:"start,omitempty"`
End string `form:"end,omitempty"`
Step string `form:"step,omitempty"`
}
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"`
}
Click to show internal directories.
Click to hide internal directories.