Documentation
¶
Index ¶
- type PromClient
- func (c *PromClient) GetTargets() (*v1.TargetsResult, error)
- func (c *PromClient) InstantQuery(query string) (model.Value, error)
- func (c *PromClient) QueryLabelValues(label string) (model.LabelValues, error)
- func (c *PromClient) QuerySeries(query string, start, end time.Time) ([]model.LabelSet, error)
- func (c *PromClient) RangeQuery(query string, start, end time.Time, step time.Duration, programName string) ([]models.MetricPoint, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromClient ¶
type PromClient struct {
// contains filtered or unexported fields
}
PromClient 封装 Prometheus 客户端
func NewPromClient ¶
func NewPromClient(address string) (*PromClient, error)
NewPromClient 创建新的 Prometheus 客户端
func (*PromClient) GetTargets ¶
func (c *PromClient) GetTargets() (*v1.TargetsResult, error)
GetTargets 获取监控目标状态
func (*PromClient) InstantQuery ¶
func (c *PromClient) InstantQuery(query string) (model.Value, error)
InstantQuery 执行即时查询
func (*PromClient) QueryLabelValues ¶
func (c *PromClient) QueryLabelValues(label string) (model.LabelValues, error)
QueryLabelValues 查询标签值
func (*PromClient) QuerySeries ¶
QuerySeries 查询时间序列
func (*PromClient) RangeQuery ¶
func (c *PromClient) RangeQuery(query string, start, end time.Time, step time.Duration, programName string) ([]models.MetricPoint, error)
RangeQuery 执行范围查询
Click to show internal directories.
Click to hide internal directories.