Documentation ¶
Overview ¶
Package promclient prom client
Index ¶
- func QueryInstantVector(ctx context.Context, rawURL string, header http.Header, promql string, ...) (model.Vector, []string, error)
- func QueryLabelValues(ctx context.Context, rawURL string, header http.Header, ...) ([]string, error)
- func QueryLabels(ctx context.Context, rawURL string, header http.Header, ...) ([]string, error)
- func QueryRangeMatrix(ctx context.Context, rawURL string, header http.Header, promql string, ...) (model.Matrix, []string, error)
- type BaseResponse
- type LabelValuesResponse
- type PromStatus
- type Result
- type ResultData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryInstantVector ¶
func QueryInstantVector(ctx context.Context, rawURL string, header http.Header, promql string, t time.Time) (model.Vector, []string, error)
QueryInstantVector 查询实时数据
func QueryLabelValues ¶
func QueryLabelValues(ctx context.Context, rawURL string, header http.Header, r *storepb.LabelValuesRequest) ([]string, error)
QueryLabelValues query label values
Types ¶
type BaseResponse ¶
type BaseResponse struct { Status PromStatus `json:"status"` // Only set if status is "error". Error string `json:"error,omitempty"` ErrorType string `json:"errorType,omitempty"` Warnings []string `json:"warnings,omitempty"` // Extra field supported by Thanos Querier. }
BaseResponse prometheus api response
func (BaseResponse) IsSuccess ¶
func (r BaseResponse) IsSuccess() bool
IsSuccess check prometheus api is success
type LabelValuesResponse ¶
type LabelValuesResponse struct { Data []string `json:"data"` BaseResponse }
LabelValuesResponse label values response
type PromStatus ¶
type PromStatus string
PromStatus prometheus api status
const ( // PromSuccess prometheus api success PromSuccess PromStatus = "success" // PromError prometheus api error PromError PromStatus = "error" )
type Result ¶
type Result struct { Data ResultData `json:"data"` BaseResponse }
Result xxx Decode only ResultType and load Result only as RawJson since we don't know structure of the Result yet.
type ResultData ¶
type ResultData struct { ResultType string `json:"resultType"` Result json.RawMessage `json:"result"` }
ResultData :
Click to show internal directories.
Click to hide internal directories.