diff --git a/README.md b/README.md index 02c4afa76..a88aec20b 100644 --- a/README.md +++ b/README.md @@ -1365,10 +1365,8 @@ See the example of alerting rules for VM components [here](https://github.com/Vi This prevents from ingesting metrics with too many labels. It is recommended [monitoring](#monitoring) `vm_metrics_with_dropped_labels_total` metric in order to determine whether `-maxLabelsPerTimeseries` must be adjusted for your workload. -* If you store Graphite metrics like `foo.bar.baz` in VictoriaMetrics, then `-search.treatDotsAsIsInRegexps` command-line flag could be useful. - By default `.` chars in regexps match any char. If you need matching only dots, then the `\\.` must be used in regexp filters. - When `-search.treatDotsAsIsInRegexps` option is enabled, then dots in regexps are automatically escaped in order to match only dots instead of arbitrary chars. - This may significantly increase performance when locating time series for the given label filters. +* If you store Graphite metrics like `foo.bar.baz` in VictoriaMetrics, then use `{__graphite__="foo.*.baz"}` syntax for selecting such metrics. + This expression is equivalent to `{__name__=~"foo[.][^.]*[.]baz"}`, but it works faster and it is easier to use when migrating from Graphite. * VictoriaMetrics ignores `NaN` values during data ingestion. diff --git a/app/vmselect/promql/exec.go b/app/vmselect/promql/exec.go index 086cde594..151f2dbde 100644 --- a/app/vmselect/promql/exec.go +++ b/app/vmselect/promql/exec.go @@ -22,7 +22,7 @@ var ( treatDotsAsIsInRegexps = flag.Bool("search.treatDotsAsIsInRegexps", false, "Whether to treat dots as is in regexp label filters used in queries. "+ `For example, foo{bar=~"a.b.c"} will be automatically converted to foo{bar=~"a\\.b\\.c"}, i.e. all the dots in regexp filters will be automatically escaped `+ `in order to match only dot char instead of matching any char. Dots in ".+", ".*" and ".{n}" regexps aren't escaped. `+ - `Such escaping can be useful when querying Graphite data`) + `This option is DEPRECATED in favor of {__graphite__="a.*.c"} syntax for selecting metrics matching the given Graphite metrics filter`) ) var slowQueries = metrics.NewCounter(`vm_slow_queries_total`) diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index 02c4afa76..a88aec20b 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -1365,10 +1365,8 @@ See the example of alerting rules for VM components [here](https://github.com/Vi This prevents from ingesting metrics with too many labels. It is recommended [monitoring](#monitoring) `vm_metrics_with_dropped_labels_total` metric in order to determine whether `-maxLabelsPerTimeseries` must be adjusted for your workload. -* If you store Graphite metrics like `foo.bar.baz` in VictoriaMetrics, then `-search.treatDotsAsIsInRegexps` command-line flag could be useful. - By default `.` chars in regexps match any char. If you need matching only dots, then the `\\.` must be used in regexp filters. - When `-search.treatDotsAsIsInRegexps` option is enabled, then dots in regexps are automatically escaped in order to match only dots instead of arbitrary chars. - This may significantly increase performance when locating time series for the given label filters. +* If you store Graphite metrics like `foo.bar.baz` in VictoriaMetrics, then use `{__graphite__="foo.*.baz"}` syntax for selecting such metrics. + This expression is equivalent to `{__name__=~"foo[.][^.]*[.]baz"}`, but it works faster and it is easier to use when migrating from Graphite. * VictoriaMetrics ignores `NaN` values during data ingestion.