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

Method Series

api/prometheus/v1/api.go:1191–1213  ·  view source on GitHub ↗
(ctx context.Context, matches []string, startTime, endTime time.Time, opts ...Option)

Source from the content-addressed store, hash-verified

1189}
1190
1191func (h *httpAPI) Series(ctx context.Context, matches []string, startTime, endTime time.Time, opts ...Option) ([]model.LabelSet, Warnings, error) {
1192 u := h.client.URL(epSeries, nil)
1193 q := addOptionalURLParams(u.Query(), opts)
1194
1195 for _, m := range matches {
1196 q.Add("match[]", m)
1197 }
1198
1199 if !startTime.IsZero() {
1200 q.Set("start", formatTime(startTime))
1201 }
1202 if !endTime.IsZero() {
1203 q.Set("end", formatTime(endTime))
1204 }
1205
1206 _, body, warnings, err := h.client.DoGetFallback(ctx, u, q)
1207 if err != nil {
1208 return nil, warnings, err
1209 }
1210
1211 var mset []model.LabelSet
1212 return mset, warnings, json.Unmarshal(body, &mset)
1213}
1214
1215func (h *httpAPI) Snapshot(ctx context.Context, skipHead bool) (SnapshotResult, error) {
1216 u := h.client.URL(epSnapshot, nil)

Callers 1

TestAPIsFunction · 0.95

Calls 7

addOptionalURLParamsFunction · 0.85
formatTimeFunction · 0.85
URLMethod · 0.65
QueryMethod · 0.65
AddMethod · 0.65
SetMethod · 0.65
DoGetFallbackMethod · 0.65

Tested by 1

TestAPIsFunction · 0.76