mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmselect: add /internl/resetRollupResultCache
handler for resetting response cache
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/312
This commit is contained in:
parent
51abc84932
commit
c70822db50
@ -33,7 +33,8 @@ var (
|
|||||||
minScrapeInterval = flag.Duration("dedup.minScrapeInterval", 0, "Remove superflouos samples from time series if they are located closer to each other than this duration. "+
|
minScrapeInterval = flag.Duration("dedup.minScrapeInterval", 0, "Remove superflouos samples from time series if they are located closer to each other than this duration. "+
|
||||||
"This may be useful for reducing overhead when multiple identically configured Prometheus instances write data to the same VictoriaMetrics. "+
|
"This may be useful for reducing overhead when multiple identically configured Prometheus instances write data to the same VictoriaMetrics. "+
|
||||||
"Deduplication is disabled if the -dedup.minScrapeInterval is 0")
|
"Deduplication is disabled if the -dedup.minScrapeInterval is 0")
|
||||||
storageNodes = flagutil.NewArray("storageNode", "Addresses of vmstorage nodes; usage: -storageNode=vmstorage-host1:8401 -storageNode=vmstorage-host2:8401")
|
resetCacheAuthKey = flag.String("search.resetCacheAuthKey", "", "Optional authKey for resetting rollup cache via /internal/resetCache call")
|
||||||
|
storageNodes = flagutil.NewArray("storageNode", "Addresses of vmstorage nodes; usage: -storageNode=vmstorage-host1:8401 -storageNode=vmstorage-host2:8401")
|
||||||
)
|
)
|
||||||
|
|
||||||
func getDefaultMaxConcurrentRequests() int {
|
func getDefaultMaxConcurrentRequests() int {
|
||||||
@ -144,8 +145,12 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path := r.URL.Path
|
path := strings.Replace(r.URL.Path, "//", "/", -1)
|
||||||
if path == "/internal/resetRollupResultCache" {
|
if path == "/internal/resetRollupResultCache" {
|
||||||
|
if len(*resetCacheAuthKey) > 0 && r.FormValue("authKey") != *resetCacheAuthKey {
|
||||||
|
sendPrometheusError(w, r, fmt.Errorf("invalid authKey=%q for %q", r.FormValue("authKey"), path))
|
||||||
|
return true
|
||||||
|
}
|
||||||
promql.ResetRollupResultCache()
|
promql.ResetRollupResultCache()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user