You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cmd/planet-federator/main.go
+16-1
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ import (
19
19
"flag"
20
20
"fmt"
21
21
"os"
22
+
"time"
22
23
23
24
"planet-exporter/cmd/planet-federator/internal"
24
25
federator "planet-exporter/federator"
@@ -37,11 +38,20 @@ var (
37
38
)
38
39
39
40
funcmain() {
41
+
varerrerror
40
42
varconfig internal.Config
41
43
44
+
// cronJobTimeOffsetDuration allows federator to go back in time. For example,
45
+
// set '-10h30m' to tell federator to offset query time to 10 hours 30 minutes ago.
46
+
//
47
+
// This is useful when we want to integrate federator to existing Prometheus setup.
48
+
// TODO: Allows running multiple jobs for federator to catch up faster.
49
+
varcronJobTimeOffsetDurationstring
50
+
42
51
// Main
43
-
flag.StringVar(&config.CronJobSchedule, "cron-job-schedule", "*/30 * * * * *", "Cron jobs schedule to pre-process planet-exporter metrics into federator backend")
52
+
flag.StringVar(&config.CronJobSchedule, "cron-job-schedule", "*/30 * * * * *", "Cron jobs schedule (Quartz Scheduler format: s m h dom mo dow y) to pre-process planet-exporter metrics into federator backend")
44
53
flag.IntVar(&config.CronJobTimeoutSecond, "cron-job-timeout-second", 30, "Timeout per federator job in second")
54
+
flag.StringVar(&cronJobTimeOffsetDuration, "cron-job-time-offset", "0s", "Cron jobs time offset. (e.g. '-1h5m' to query data from 1 hour 5 minutes ago)")
0 commit comments