MCPcopy
hub / github.com/prometheus/client_golang / TSDB

Method TSDB

api/prometheus/v1/api.go:1323–1341  ·  view source on GitHub ↗
(ctx context.Context, opts ...Option)

Source from the content-addressed store, hash-verified

1321}
1322
1323func (h *httpAPI) TSDB(ctx context.Context, opts ...Option) (TSDBResult, error) {
1324 u := h.client.URL(epTSDB, nil)
1325 q := addOptionalURLParams(u.Query(), opts)
1326 u.RawQuery = q.Encode()
1327
1328 req, err := http.NewRequest(http.MethodGet, u.String(), nil)
1329 if err != nil {
1330 return TSDBResult{}, err
1331 }
1332
1333 _, body, _, err := h.client.Do(ctx, req)
1334 if err != nil {
1335 return TSDBResult{}, err
1336 }
1337
1338 var res TSDBResult
1339 err = json.Unmarshal(body, &res)
1340 return res, err
1341}
1342
1343func (h *httpAPI) WalReplay(ctx context.Context) (WalReplayStatus, error) {
1344 u := h.client.URL(epWalReplay, nil)

Callers 1

TestAPIsFunction · 0.95

Calls 5

addOptionalURLParamsFunction · 0.85
URLMethod · 0.65
QueryMethod · 0.65
DoMethod · 0.65
StringMethod · 0.45

Tested by 1

TestAPIsFunction · 0.76