From ed2933ca60603c0f2eacb03726090493d641c695 Mon Sep 17 00:00:00 2001 From: Danny Kopping Date: Wed, 25 Oct 2023 23:05:01 +0200 Subject: [PATCH] Add feature flag Signed-off-by: Danny Kopping --- cmd/prometheus/main.go | 4 ++++ docs/feature_flags.md | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index b8b90ffbe..beb9e3b0a 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -158,6 +158,7 @@ type flagConfig struct { enablePerStepStats bool enableAutoGOMAXPROCS bool enableAutoGOMEMLIMIT bool + enableConcurrentRuleEval bool prometheusURL string corsRegexString string @@ -204,6 +205,9 @@ func (c *flagConfig) setFeatureListOptions(logger log.Logger) error { case "auto-gomemlimit": c.enableAutoGOMEMLIMIT = true level.Info(logger).Log("msg", "Automatically set GOMEMLIMIT to match Linux container or system memory limit") + case "concurrent-rule-eval": + c.enableConcurrentRuleEval = true + level.Info(logger).Log("msg", "Experimental concurrent rule evaluation enabled.") case "no-default-scrape-port": c.scrape.NoDefaultPort = true level.Info(logger).Log("msg", "No default port will be appended to scrape targets' addresses.") diff --git a/docs/feature_flags.md b/docs/feature_flags.md index adefaad4b..5517018df 100644 --- a/docs/feature_flags.md +++ b/docs/feature_flags.md @@ -212,3 +212,13 @@ Enables ingestion of created timestamp. Created timestamps are injected as 0 val Currently Prometheus supports created timestamps only on the traditional Prometheus Protobuf protocol (WIP for other protocols). As a result, when enabling this feature, the Prometheus protobuf scrape protocol will be prioritized (See `scrape_config.scrape_protocols` settings for more details). Besides enabling this feature in Prometheus, created timestamps need to be exposed by the application being scraped. + +## Concurrent evaluation of independent rules + +`--enable-feature=concurrent-rule-eval` + +Rule groups execute concurrently, but the rules within a group execute sequentially; this is because rules can use the +output of a preceding rule as its input. However, if there is no detectable relationship between rules then there is no +reason to run them sequentially. This can improve rule reliability at the expense of adding more concurrent query +load. The number of concurrent rule evaluations can be configured with `--rules.max-concurrent-rule-evals` which is set +to `4` by default.