diff --git a/app/vmselect/prometheus/prometheus.go b/app/vmselect/prometheus/prometheus.go index 5a296b2bf..a897bdf7b 100644 --- a/app/vmselect/prometheus/prometheus.go +++ b/app/vmselect/prometheus/prometheus.go @@ -59,8 +59,8 @@ var ( "This option doesn't limit the number of scanned raw samples in the database. The main purpose of this option is to limit the number of per-series points "+ "returned to graphing UI such as VMUI or Grafana. There is no sense in setting this limit to values bigger than the horizontal resolution of the graph. "+ "See also -search.maxResponseSeries") - ignoreExtraFiltersAtLabelsAPI = flag.Bool("search.ignoreExtraFiltersAtLabelsAPI", false, "Whether to ignore extra_filters and extra_label query args at "+ - "/api/v1/labels, /api/v1/label/.../values and /api/v1/series . This may be useful for decreasing load on VictoriaMetrics when extra filters "+ + ignoreExtraFiltersAtLabelsAPI = flag.Bool("search.ignoreExtraFiltersAtLabelsAPI", false, "Whether to ignore match[], extra_filters[] and extra_label query args at "+ + "/api/v1/labels and /api/v1/label/.../values . This may be useful for decreasing load on VictoriaMetrics when extra filters "+ "match too many time series. The downside is that suprflouos labels or series could be returned, which do not match the extra filters. "+ "See also -search.maxLabelsAPISeries and -search.maxLabelsAPIDuration") ) @@ -1181,18 +1181,18 @@ func getCommonParamsInternal(r *http.Request, startTime time.Time, requireNonEmp if requireNonEmptyMatch && len(matches) == 0 { return nil, fmt.Errorf("missing `match[]` arg") } - tagFilterss, err := getTagFilterssFromMatches(matches) - if err != nil { - return nil, err - } - filterss := tagFilterss + var filterss [][]storage.TagFilter if !isLabelsAPI || !*ignoreExtraFiltersAtLabelsAPI { + tagFilterss, err := getTagFilterssFromMatches(matches) + if err != nil { + return nil, err + } etfs, err := searchutils.GetExtraTagFilters(r) if err != nil { return nil, err } - filterss = searchutils.JoinTagFilterss(filterss, etfs) + filterss = searchutils.JoinTagFilterss(tagFilterss, etfs) } cp := &commonParams{