hashicorp/nomad · error
telemetry in-memory collection interval must be greater than
Error message
telemetry in-memory collection interval must be greater than zero
What it means
Telemetry in-memory metrics require a strictly positive collection interval: how often the agent samples metrics into the in-memory ring buffer. Validate() rejects values <= 0 because a non-positive interval would mean metrics are never collected (or division-by-zero style scheduling errors downstream).
Source
Thrown at command/agent/config.go:1525
blocked = append(blocked, rule[1:])
default:
return nil, nil, fmt.Errorf("Filter rule must begin with either '+' or '-': %q", rule)
}
}
return allowed, blocked, nil
}
// Validate the telemetry configuration options. These are used by the agent,
// regardless of mode, so can live here rather than a structs package. It is
// safe to call, without checking whether the config object is nil first.
func (t *Telemetry) Validate() error {
if t == nil {
return nil
}
// Ensure we have durations that are greater than zero.
if t.inMemoryCollectionInterval <= 0 {
return errors.New("telemetry in-memory collection interval must be greater than zero")
}
if t.inMemoryRetentionPeriod <= 0 {
return errors.New("telemetry in-memory retention period must be greater than zero")
}
// Ensure the in-memory durations do not conflict.
if t.inMemoryCollectionInterval > t.inMemoryRetentionPeriod {
return errors.New("telemetry in-memory collection interval cannot be greater than retention period")
}
return nil
}
// Eventlog is the configuration for the Windows Eventlog
type Eventlog struct {
// Enabled controls if Nomad agent logs are sent to the
// Windows eventlog.
Enabled bool `hcl:"enabled"`View on GitHub (pinned to 482b49bf1a)
Solutions
- Set a positive collection interval (e.g. `metrics_interval = "10s"`) in the telemetry block.
- If you want collection disabled, disable the in-memory metrics feature itself rather than setting interval 0.
- Check where the interval value originates (flags/env/templates) and guard against zero there.
Example fix
// before
telemetry {
in_memory_collection_interval = 0
}
// after
telemetry {
in_memory_collection_interval = "10s"
} Defensive patterns
Strategy: validation
Validate before calling
if t := cfg.Telemetry; t != nil && t.InMemoryCollectionInterval <= 0 {
return errors.New("telemetry collection interval must be > 0")
} Type guard
func positiveInterval(d time.Duration) bool { return d > 0 } Prevention
- Disable the in-memory sink itself rather than zeroing its interval.
- Use templated defaults (e.g. 10s) instead of computed values that can hit zero.
- Check env/flag overrides that could clobber the interval.
When it happens
Trigger: Agent telemetry config enables in-memory metrics and sets the internal inMemoryCollectionInterval (derived from e.g. `metrics_interval` or in-memory specific settings) to 0 or a negative duration, then calls the telemetry Validate().
Common situations: Setting interval to 0 to try to disable collection while leaving in-memory metrics enabled; automation computing the interval to zero; unit mixups producing a near-zero parsed duration.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- telemetry in-memory retention period must be greater than ze
- telemetry in-memory collection interval cannot be greater th
- rpc.dial_timeout must be greater than or equal to zero
- hg_timeout must be > 0
- s3_timeout must be > 0
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/0dd3194767533ca6.
Report an issue: GitHub.