Compare commits

...

6 Commits

Author SHA1 Message Date
JAYICE
c248236526 Update docs/victoriametrics/changelog/CHANGELOG.md
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: JAYICE <jayice.zhou@qq.com>
2026-04-22 17:17:43 +08:00
JAYICE
095db27338 Merge branch 'master' into issue-10507 2026-04-22 16:58:11 +08:00
Jayice
a6ff705771 improve documentation 2026-04-16 14:07:01 +08:00
Jayice
0c5886012d only apply for shardByURL=true 2026-04-15 16:56:27 +08:00
Jayice
9c5fbe1a30 rollback test codes 2026-04-15 15:13:33 +08:00
Jayice
653576d8b1 introduce a new flag -remoteWrite.enableRerouting to explicitly control the rerouting behavior 2026-04-15 13:47:59 +08:00
4 changed files with 29 additions and 2 deletions

View File

@@ -102,6 +102,8 @@ var (
"cannot be pushed into the configured -remoteWrite.url systems in a timely manner. See https://docs.victoriametrics.com/victoriametrics/vmagent/#disabling-on-disk-persistence")
disableMetadataPerURL = flagutil.NewArrayBool("remoteWrite.disableMetadata", "Whether to disable sending metadata to the corresponding -remoteWrite.url. "+
"By default, metadata sending is controlled by the global -enableMetadata flag")
enableRerouting = flag.Bool("remoteWrite.enableRerouting", false, "Whether to reroute samples to available remote storage systems when there's any remote storage system and its persistent queue can not "+
"keep up with the data ingestion rate. If this flag is not set, then it will be calculated automatically based on -remoteWrite.disableOnDiskQueue. See https://docs.victoriametrics.com/victoriametrics/vmagent/#disabling-on-disk-persistence")
)
var (
@@ -215,6 +217,10 @@ func Init() {
// to the remaining -remoteWrite.url and dropping them on the blocked queue.
dropSamplesOnFailureGlobal = *dropSamplesOnOverload || disableOnDiskQueueAny && len(*remoteWriteURLs) > 1
if *shardByURL && !flagutil.IsSet("remoteWrite.enableRerouting") {
*enableRerouting = disableOnDiskQueueAny
}
dropDanglingQueues()
// Start config reloader.
@@ -498,11 +504,13 @@ func tryPush(at *auth.Token, wr *prompb.WriteRequest, forceDropSamplesOnFailure
//
// calculateHealthyRwctxIdx will rely on the order of rwctx to be in ascending order.
func getEligibleRemoteWriteCtxs(tss []prompb.TimeSeries, forceDropSamplesOnFailure bool) ([]*remoteWriteCtx, bool) {
if !disableOnDiskQueueAny {
if (*shardByURL && !*enableRerouting) || !disableOnDiskQueueAny {
return rwctxsGlobal, true
}
// This code is applicable if at least a single remote storage has -disableOnDiskQueue
// This code is applicable when:
// 1. remoteWrite.shardByUrl is disabled and at least a single remote storage has -disableOnDiskQueue.
// 2. remoteWrite.shardByUrl is enabled and remoteWrite.enableRerouting is set to true.
rwctxs := make([]*remoteWriteCtx, 0, len(rwctxsGlobal))
for _, rwctx := range rwctxsGlobal {
if !rwctx.fq.IsWriteBlocked() {

View File

@@ -25,6 +25,7 @@ The sandbox cluster installation runs under the constant load generated by
See also [LTS releases](https://docs.victoriametrics.com/victoriametrics/lts-releases/).
## tip
* FEATURE: [vmagent](https://docs.victoriametrics.com/victoriametrics/vmagent/): introduce a new flag `-remoteWrite.enableRerouting` to explicitly control rerouting behavior when `vmagent` is started with `-remoteWrite.shardByUrl` and any remote storage system cannot keep up with the ingestion rate. Previously, this behavior was defined internally based on the value of `-remoteWrite.disableOnDiskQueue`. See [#10507](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10507).
* FEATURE: all VictoriaMetrics components: add support for reading cpu/memory limits configured via [systemd slices](https://www.freedesktop.org/software/systemd/man/latest/systemd.slice.html). Previously, only limits set directly on the process's own cgroup were detected. See [#10635](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10635). Thanks to @andriibeee for the contribution.
* FEATURE: [vmui](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#vmui): now `Run query` link on the Alerting Rules page correctly propagates the alerts interval and evaluation time. See [#10366](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/10366).

View File

@@ -900,6 +900,10 @@ When `-remoteWrite.disableOnDiskQueue` command-line flag is set, `vmagent` may s
if it cannot keep up with the data ingestion rate. In this case [deduplication](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#deduplication)
must be enabled on all the configured remote storage systems.
If `-remoteWrite.shardByUrl` command-line flag is set and `-remoteWrite.disableOnDiskQueue` is set for at least one `-remoteWrite.url`, then if any remote storage systems
and its corresponding persistent queue can not keep up with the ingestion rate, `vmagent` will reroute samples to other available remote storage systems.
If on-disk persistence is enabled for all `-remoteWrite.url`, then `vmagent` will not perform rerouting. But the rerouting behavior can be controlled by explicitly setting `-remoteWrite.enableRerouting`.
## Cardinality limiter
By default, `vmagent` doesn't limit the number of time series each scrape target can expose.

View File

@@ -18,3 +18,17 @@ func WriteFlags(w io.Writer) {
fmt.Fprintf(w, "-%s=%q\n", f.Name, value)
})
}
func IsSet(flagName string) bool {
isSet := false
flag.Visit(func(f *flag.Flag) {
if isSet {
return
}
lname := strings.ToLower(f.Name)
if flagName = strings.ToLower(flagName); lname == flagName {
isSet = true
}
})
return isSet
}