cli

package
v0.0.0-...-de09c22 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func (c *PromClient) QuerySeries(query string, start, end time.Time) ([]model.LabelSet, error)

QuerySeries 查询时间序列

func (*PromClient) RangeQuery

func (c *PromClient) RangeQuery(query string, start, end time.Time, step time.Duration, programName string) ([]models.MetricPoint, error)

RangeQuery 执行范围查询

Jump to

Keyboard shortcuts

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