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

Method DeleteSeries

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

Source from the content-addressed store, hash-verified

945}
946
947func (h *httpAPI) DeleteSeries(ctx context.Context, matches []string, startTime, endTime time.Time) error {
948 u := h.client.URL(epDeleteSeries, nil)
949 q := u.Query()
950
951 for _, m := range matches {
952 q.Add("match[]", m)
953 }
954
955 if !startTime.IsZero() {
956 q.Set("start", formatTime(startTime))
957 }
958 if !endTime.IsZero() {
959 q.Set("end", formatTime(endTime))
960 }
961
962 u.RawQuery = q.Encode()
963
964 req, err := http.NewRequest(http.MethodPost, u.String(), nil)
965 if err != nil {
966 return err
967 }
968
969 _, _, _, err = h.client.Do(ctx, req)
970 return err
971}
972
973func (h *httpAPI) Flags(ctx context.Context) (FlagsResult, error) {
974 u := h.client.URL(epFlags, nil)

Callers 1

TestAPIsFunction · 0.95

Calls 7

formatTimeFunction · 0.85
URLMethod · 0.65
QueryMethod · 0.65
AddMethod · 0.65
SetMethod · 0.65
DoMethod · 0.65
StringMethod · 0.45

Tested by 1

TestAPIsFunction · 0.76