{"record":{"id":"3449259f11cb4d32","repo":"SigNoz/signoz","slug":"errcodeinvalidinput","errorCode":"ErrCodeInvalidInput","errorMessage":"meterreporter::interval must be between 10m and 24h","messagePattern":"meterreporter::interval must be between 10m and 24h","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/meterreporter/config.go","lineNumber":43,"sourceCode":"\t// Interval the user picks.\n\tJitter time.Duration `mapstructure:\"jitter\"`\n}\n\nfunc newConfig() factory.Config {\n\treturn Config{\n\t\tInterval: 6 * time.Hour,\n\t\tBackfill: true,\n\t\tJitter:   -1, // Negative sentinel. Resolved at use time unless explicitly set.\n\t}\n}\n\nfunc NewConfigFactory() factory.ConfigFactory {\n\treturn factory.NewConfigFactory(factory.MustNewName(\"meterreporter\"), newConfig)\n}\n\nfunc (c Config) Validate() error {\n\tif c.Interval < 10*time.Minute || c.Interval > 24*time.Hour {\n\t\treturn errors.New(errors.TypeInvalidInput, ErrCodeInvalidInput, \"meterreporter::interval must be between 10m and 24h\")\n\t}\n\n\tif c.Jitter >= 0 && (c.Jitter < 10*time.Minute || c.Jitter > c.Interval) {\n\t\treturn errors.New(errors.TypeInvalidInput, ErrCodeInvalidInput, \"meterreporter::jitter must be between 10m and interval\")\n\t}\n\n\treturn nil\n}\n\n// NewJitter returns a fresh random duration sampled uniformly from\n// [0, jitter), where jitter is the configured Jitter or, if the sentinel\n// default is still in place, min(Interval, 2h).\nfunc (c Config) NewJitter() time.Duration {\n\tdefaultJitter := 2 * time.Hour\n\n\tcap := c.Jitter\n\tif cap < 0 {\n\t\tcap = min(c.Interval, defaultJitter)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/meterreporter/config.go#L25-L61","documentation":"meterreporter Config.Validate constrains the reporting interval to [10m, 24h]. Shorter intervals would hammer downstream sinks; longer ones make reports too stale, so out-of-range values are invalid input.","triggerScenarios":"Configuring meterreporter with Interval < 10*time.Minute or > 24*time.Hour (including the zero value when the field is omitted, depending on defaults applied before Validate).","commonSituations":"Setting a dev-friendly 1m interval and shipping it to prod; omitting interval so it defaults to 0; misreading units (seconds vs minutes).","solutions":["Set interval between 10m and 24h inclusive (e.g. 1h)","Ensure config unmarshalling applies a sane default before Validate if interval is optional","Use Go duration strings ('10m', '24h') to avoid unit confusion"],"exampleFix":"// before\ninterval: 1m\n// after\ninterval: 1h","handlingStrategy":"validation","validationCode":"if cfg.Interval < 10*time.Minute || cfg.Interval > 24*time.Hour { return fmt.Errorf(\"interval must be within [10m, 24h]\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use Go duration literals; default interval to 1h if unset"],"tags":["meterreporter","scheduling","config","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}