From 8c1ab58cc630454a563c7cf5fb99c7f3e1eace1e Mon Sep 17 00:00:00 2001 From: Saswata Mukherjee Date: Wed, 18 Dec 2024 18:14:31 +0000 Subject: [PATCH] Check simulated series file Signed-off-by: Saswata Mukherjee --- .../metrics/cmd/metrics-collector/main.go | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/collectors/metrics/cmd/metrics-collector/main.go b/collectors/metrics/cmd/metrics-collector/main.go index 68ebea551..4ddac29e0 100644 --- a/collectors/metrics/cmd/metrics-collector/main.go +++ b/collectors/metrics/cmd/metrics-collector/main.go @@ -38,15 +38,16 @@ import ( func main() { opt := &Options{ - From: "http://localhost:9090", - Listen: "localhost:9002", - LimitBytes: 200 * 1024, - Matchers: []string{`{__name__="up"}`}, - Interval: 4*time.Minute + 30*time.Second, - EvaluateInterval: 30 * time.Second, - WorkerNum: 1, - DisableHyperShift: false, - DisableStatusReporting: false, + From: "http://localhost:9090", + Listen: "localhost:9002", + LimitBytes: 200 * 1024, + Matchers: []string{`{__name__="up"}`}, + Interval: 4*time.Minute + 30*time.Second, + EvaluateInterval: 30 * time.Second, + WorkerNum: 1, + DisableHyperShift: false, + DisableStatusReporting: false, + SimulatedTimeseriesFile: "", } cmd := &cobra.Command{ Short: "Remote write federated metrics from prometheus", @@ -722,7 +723,7 @@ func initShardedConfigs(o *Options, agent Agent) ([]*forwarder.Config, error) { } func runMultiWorkers(o *Options, cfg *forwarder.Config) error { - if o.WorkerNum > 1 { + if o.WorkerNum > 1 && o.SimulatedTimeseriesFile == "" { return nil }