Documentation
¶
Index ¶
- func HTTPGet(url string, params map[string]string) (string, error)
- func InitDB()
- func LoadConfig(version string)
- func Run(ventiVersion string)
- func RunHTTPLetheQuery(httpQuery HTTPQuery) (string, error)
- func RunHTTPLetheQueryRange(httpQueryRange HTTPQueryRange) (string, error)
- func RunHTTPPrometheusQuery(httpQuery HTTPQuery) (string, error)
- func RunHTTPPrometheusQueryRange(httpQueryRange HTTPQueryRange) (string, error)
- 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 HTTPQuery
- type HTTPQueryRange
- type LoginForm
- type Panel
- type QueryData
- type QueryResult
- 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 RunHTTPLetheQuery ¶
func RunHTTPLetheQueryRange ¶
func RunHTTPLetheQueryRange(httpQueryRange HTTPQueryRange) (string, error)
func RunHTTPPrometheusQuery ¶
func RunHTTPPrometheusQueryRange ¶
func RunHTTPPrometheusQueryRange(httpQueryRange HTTPQueryRange) (string, error)
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"`
Host string `json:"host"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
IsDiscovered bool `json:"is_discovered,omitempty" yaml:"isDiscovered,omitempty"`
}
func GetDatasources ¶
func GetDatasources() ([]Datasource, error)
type DatasourceType ¶
type DatasourceType string
datasource
const ( DatasourceTypePrometheus DatasourceType = "Prometheus" DatasourceTypeLethe DatasourceType = "Lethe" )
type DatasourcesConfig ¶
type DatasourcesConfig struct {
QueryTimeout time.Duration `json:"queryTimeout"`
Datasources []Datasource `json:"datasources"`
}
type HTTPQueryRange ¶
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 QueryResult ¶
{"data":{"result":[],"resultType":"logs"},"status":"success"} {"status":"success","data":{"resultType":"vector","result":[]}}
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.