diff --git a/app/vmalert/README.md b/app/vmalert/README.md index 10021afb5..9172d877e 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -114,13 +114,6 @@ name: # By default "prometheus" type is used. [ type: ] -# Warning: DEPRECATED -# Please use `params` instead: -# params: -# extra_label: ["job=nodeexporter", "env=prod"] -extra_filter_labels: - [ : ... ] - # Optional list of HTTP URL parameters # applied for all rules requests within a group # For example: diff --git a/app/vmalert/config/config.go b/app/vmalert/config/config.go index f79801025..fc50de5ee 100644 --- a/app/vmalert/config/config.go +++ b/app/vmalert/config/config.go @@ -30,11 +30,6 @@ type Group struct { Limit int `yaml:"limit,omitempty"` Rules []Rule `yaml:"rules"` Concurrency int `yaml:"concurrency"` - // ExtraFilterLabels is a list label filters applied to every rule - // request withing a group. Is compatible only with VM datasources. - // See https://docs.victoriametrics.com#prometheus-querying-api-enhancements - // DEPRECATED: use Params field instead - ExtraFilterLabels map[string]string `yaml:"extra_filter_labels"` // Labels is a set of label value pairs, that will be added to every rule. // It has priority over the external labels. Labels map[string]string `yaml:"labels"` @@ -63,22 +58,6 @@ func (g *Group) UnmarshalYAML(unmarshal func(interface{}) error) error { g.Type.Set(datasource.NewPrometheusType()) } - // backward compatibility with deprecated `ExtraFilterLabels` param - if len(g.ExtraFilterLabels) > 0 { - if g.Params == nil { - g.Params = url.Values{} - } - // Sort extraFilters for consistent order for query args across runs. - extraFilters := make([]string, 0, len(g.ExtraFilterLabels)) - for k, v := range g.ExtraFilterLabels { - extraFilters = append(extraFilters, fmt.Sprintf("%s=%s", k, v)) - } - sort.Strings(extraFilters) - for _, extraFilter := range extraFilters { - g.Params.Add("extra_label", extraFilter) - } - } - h := md5.New() h.Write(b) g.Checksum = fmt.Sprintf("%x", h.Sum(nil)) @@ -200,7 +179,6 @@ func Parse(pathPatterns []string, validateAnnotations, validateExpressions bool) fp = append(fp, matches...) } errGroup := new(utils.ErrGroup) - var isExtraFilterLabelsUsed bool var groups []Group for _, file := range fp { uniqueGroups := map[string]struct{}{} @@ -220,9 +198,6 @@ func Parse(pathPatterns []string, validateAnnotations, validateExpressions bool) } uniqueGroups[g.Name] = struct{}{} g.File = file - if len(g.ExtraFilterLabels) > 0 { - isExtraFilterLabelsUsed = true - } groups = append(groups, g) } } @@ -232,9 +207,6 @@ func Parse(pathPatterns []string, validateAnnotations, validateExpressions bool) if len(groups) < 1 { logger.Warnf("no groups found in %s", strings.Join(pathPatterns, ";")) } - if isExtraFilterLabelsUsed { - logger.Warnf("field `extra_filter_labels` is deprecated - use `params` instead") - } return groups, nil } diff --git a/app/vmalert/config/config_test.go b/app/vmalert/config/config_test.go index f63950f17..ba2d18667 100644 --- a/app/vmalert/config/config_test.go +++ b/app/vmalert/config/config_test.go @@ -545,30 +545,4 @@ rules: expr: sum by(job) (up == 1) `, url.Values{"nocache": {"1"}, "denyPartialResponse": {"true"}}) }) - - t.Run("extra labels", func(t *testing.T) { - f(t, ` -name: TestGroup -extra_filter_labels: - job: victoriametrics - env: prod -rules: - - alert: ExampleAlertAlwaysFiring - expr: sum by(job) (up == 1) -`, url.Values{"extra_label": {"env=prod", "job=victoriametrics"}}) - }) - - t.Run("extra labels and params", func(t *testing.T) { - f(t, ` -name: TestGroup -extra_filter_labels: - job: victoriametrics -params: - nocache: ["1"] - extra_label: ["env=prod"] -rules: - - alert: ExampleAlertAlwaysFiring - expr: sum by(job) (up == 1) -`, url.Values{"nocache": {"1"}, "extra_label": {"env=prod", "job=victoriametrics"}}) - }) } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b62e9965c..a05eeb030 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -21,6 +21,8 @@ The following tip changes can be tested by building VictoriaMetrics components f **Update note 3:** this release introduces backwards-incompatible changes to communication protocol between `vmselect` and `vmstorage` nodes in cluster version of VictoriaMetrics because of added ability to query `vmselect` data from other `vmselect` nodes - see [these docs](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multi-level-cluster-setup), so read requests to `vmselect` will fail until the upgrade is complete. These errors will stop after all the `vmselect` and `vmstorage` nodes are updated to the new release. It is safe to downgrade to previous releases at any time. +**Update note 4:** this release removes support of deprecated in [1.70.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.70.0) param `extra_filter_labels` from [vmalert's](https://docs.victoriametrics.com/vmalert.html) groups definition. This deprecated param was replaced with [params](https://docs.victoriametrics.com/vmalert.html#url-params). + * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add [azure_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#azure_sd_config) service discovery mechanism. It allows discovering Virtual Machines at [Azure Cloud](https://azure.microsoft.com/en-us/). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1364). * FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): deprecate alert's status link `/api/v1///status` in favour of `api/v1/alert?group_id=&alert_id="`. The old alert's status link is still supported, but will be removed in future releases. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2825). * FEATURE: [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): add support for querying lower-level `vmselect` nodes from upper-level `vmselect` nodes. This makes possible to build multi-level cluster setups for global querying view and HA purposes without the need to use [Promxy](https://github.com/jacksontj/promxy). See [these docs](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multi-level-cluster-setup) and [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2778). diff --git a/docs/vmalert.md b/docs/vmalert.md index 82bc5265d..6e3ca4fc1 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -118,13 +118,6 @@ name: # By default "prometheus" type is used. [ type: ] -# Warning: DEPRECATED -# Please use `params` instead: -# params: -# extra_label: ["job=nodeexporter", "env=prod"] -extra_filter_labels: - [ : ... ] - # Optional list of HTTP URL parameters # applied for all rules requests within a group # For example: