Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alarm ¶
type Alarm struct { Receiver string `json:"receiver"` Status vobj.AlertStatus `json:"status"` Alerts []*Alert `json:"alerts"` GroupLabels *vobj.Labels `json:"groupLabels"` CommonLabels *vobj.Labels `json:"commonLabels"` CommonAnnotations vobj.Annotations `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` Version string `json:"version"` GroupKey string `json:"groupKey"` TruncatedAlerts int32 `json:"truncatedAlerts"` }
Alarm alarm detail info
type Alert ¶
type Alert struct { Status vobj.AlertStatus `json:"status"` Labels *vobj.Labels `json:"labels"` Annotations vobj.Annotations `json:"annotations"` StartsAt *types.Time `json:"startsAt"` EndsAt *types.Time `json:"endsAt"` GeneratorURL string `json:"generatorURL"` Fingerprint string `json:"fingerprint"` Value float64 `json:"value"` }
Alert alert detail info
func NewAlertWithAlertStrInfo ¶
NewAlertWithAlertStrInfo create alert from alert string
func (*Alert) GetExternalURL ¶
GetExternalURL gen alert external url
func (*Alert) GetFingerprint ¶
GetFingerprint gen alert fingerprint
type Datasource ¶
type Datasource struct { // 数据源类型 Category vobj.DatasourceType `json:"category,omitempty"` // 存储器类型 StorageType vobj.StorageType `json:"storage_type,omitempty"` // 数据源配置 json Config map[string]string `json:"config,omitempty"` // 数据源地址 Endpoint string `json:"endpoint,omitempty"` }
Datasource 数据源明细
type GetMetricsParams ¶
type GetMetricsParams struct { Endpoint string `json:"endpoint"` Config map[string]string `json:"config"` // 存储类型 StorageType vobj.StorageType `json:"storageType"` }
GetMetricsParams 查询指标请求参数
type MetricDetail ¶
type MetricDetail struct { // 指标名称 Name string `json:"name"` // 帮助信息 Help string `json:"help"` // 类型 Type string `json:"type"` // 标签集合 Labels map[string][]string `json:"labels"` // 指标单位 Unit string `json:"unit"` }
MetricDetail 指标详情
type PushMetricParams ¶
type PushMetricParams struct { // 指标明细 *MetricDetail // 数据源ID DatasourceID uint32 `json:"datasourceId"` // 是否完成 Done bool `json:"done"` // 团队ID TeamID uint32 `json:"teamId"` }
PushMetricParams 推送指标请求参数
type QueryQLParams ¶
type QueryQLParams struct { // 查询指标请求参数 GetMetricsParams // 查询QL QueryQL string `json:"queryQL"` // 时间范围 TimeRange []string `json:"timeRange"` // 步长 Step uint32 `json:"step"` }
QueryQLParams 查询QL请求参数
type SelectOptionBo ¶
type SelectOptionBo struct { Value any `json:"value"` Label string `json:"label"` Disabled bool `json:"disabled"` }
SelectOptionBo 选项构造器明细
type Strategy ¶
type Strategy struct { // 策略ID ID uint32 `json:"id,omitempty"` // 策略等级ID LevelID uint32 `json:"levelId,omitempty"` // 策略名称 Alert string `json:"alert,omitempty"` // 策略语句 Expr string `json:"expr,omitempty"` // 策略持续时间 For *types.Duration `json:"for,omitempty"` // 持续次数 Count uint32 `json:"count,omitempty"` // 持续的类型 SustainType vobj.Sustain `json:"sustainType,omitempty"` // 多数据源持续类型 MultiDatasourceSustainType vobj.MultiDatasourceSustain `json:"multiDatasourceSustainType,omitempty"` // 策略标签 Labels *vobj.Labels `json:"labels,omitempty"` // 策略注解 Annotations vobj.Annotations `json:"annotations,omitempty"` // 执行频率 Interval *types.Duration `json:"interval,omitempty"` // 数据源 Datasource []*Datasource `json:"datasource,omitempty"` // 策略状态 Status vobj.Status `json:"status,omitempty"` // 策略采样率 Step uint32 `json:"step,omitempty"` // 判断条件 Condition vobj.Condition `json:"condition,omitempty"` // 阈值 Threshold float64 `json:"threshold,omitempty"` // 团队ID TeamID uint32 `json:"teamId,omitempty"` }
Strategy 策略明细
Click to show internal directories.
Click to hide internal directories.