vectordotdev/vector · error

event-time path requires AggregateConfig.event_time

Error message

event-time path requires AggregateConfig.event_time

What it means

`Aggregate::event_time()` unwraps the optional `event_time` config, asserting the caller is already on the event-time path. If `AggregateConfig.event_time` is `None` while event-time code runs, the `expect` panics. It is an internal path-invariant, not a user-facing validation error.

Solutions

  1. Set `event_time` in the aggregate transform config so the path is legitimately enabled
  2. Gate all event-time helper calls behind a `config.event_time.is_some()` check
  3. If building in tests, construct Aggregate with an EventTimeConfig
  4. Report a bug if the shipped code reaches this without event_time configured

Example fix

// before
aggregate.record(data); // with event_time: None
// after (config yaml)
transforms:
  agg:
    type: aggregate
    event_time:
      interval_ms: 60000
Defensive patterns

Strategy: validation

Validate before calling

// only call event-time APIs when configured
if config.event_time.is_some() {
    aggregate.record_event_time(series, data);
}

Type guard

fn is_event_time_enabled(cfg: &AggregateConfig) -> bool { cfg.event_time.is_some() }

Prevention

When it happens

Trigger: Event-time functions (`record_event_time`, `is_past_bucket_cutoff`, `flush_event_time_buckets`) invoked while the transform was constructed without `event_time` in its config.

Common situations: A code path or fork that reaches event-time recording without gating on `config.event_time.is_some()`; tests calling these helpers directly on a default-built Aggregate.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/705d358360cb3a00. Report an issue: GitHub.

Appendix: source

Thrown at src/transforms/aggregate/event_time.rs:25

};

use super::AggregationMode;
use super::config::{EventTimeConfig, MissingTimestamp};
use super::transform::{Aggregate, BucketKey, MetricEntry};
use crate::{
    event::{Event, EventMetadata},
    internal_events::{
        AggregateEventDropped, AggregateEventRecorded, AggregateFlushed, AggregateUpdateFailed,
    },
};

impl Aggregate {
    /// Event-time settings; only called from the event-time path.
    const fn event_time(&self) -> &EventTimeConfig {
        self.config
            .event_time
            .as_ref()
            .expect("event-time path requires AggregateConfig.event_time")
    }

    pub(crate) fn record_event_time(
        &mut self,
        series: MetricSeries,
        mut data: MetricData,
        metadata: EventMetadata,
        timestamp: Option<DateTime<Utc>>,
    ) -> Option<Event> {
        // Mirror the system-time passthrough arms before any timestamp gating.
        if Self::passes_through_unchanged(self.config.mode, &data) {
            return Some(Event::Metric(Metric::from_parts(series, data, metadata)));
        }

        // Mean/Stdev ignore absolute non-gauge values (no passthrough, no bucket).
        if Self::is_silently_ignored(self.config.mode, &data) {
            emit!(AggregateEventRecorded);
            return None;

View on GitHub (pinned to bdb87aeaa4)