mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-21 10:46:35 +03:00
Compare commits
6 Commits
master
...
issue-1050
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c248236526 | ||
|
|
095db27338 | ||
|
|
a6ff705771 | ||
|
|
0c5886012d | ||
|
|
9c5fbe1a30 | ||
|
|
653576d8b1 |
@@ -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() {
|
||||
|
||||
@@ -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 alert’s interval and evaluation time. See [#10366](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/10366).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user