bo

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 6 Imported by: 0

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

func (*Alarm) Index

func (a *Alarm) Index() string

Index gen alarm index

func (*Alarm) Message

func (a *Alarm) Message() *watch.Message

Message gen alarm message

func (*Alarm) String

func (a *Alarm) String() string

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

func NewAlertWithAlertStrInfo(info string) (*Alert, error)

NewAlertWithAlertStrInfo create alert from alert string

func (*Alert) GetExternalURL

func (a *Alert) GetExternalURL() string

GetExternalURL gen alert external url

func (*Alert) GetFingerprint

func (a *Alert) GetFingerprint() string

GetFingerprint gen alert fingerprint

func (*Alert) Index

func (a *Alert) Index() string

Index gen alert index

func (*Alert) Message

func (a *Alert) Message() *watch.Message

Message gen alert message

func (*Alert) String

func (a *Alert) String() string

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 策略明细

func (*Strategy) Index

func (s *Strategy) Index() string

Index 策略唯一索引

func (*Strategy) Message

func (s *Strategy) Message() *watch.Message

Message 策略转消息

func (*Strategy) String

func (s *Strategy) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL