Skip to content

feat(asap-planner-rs): add millisecond precision support for sub-second scrape intervals #398

Description

@milindsrivastava1997

Background

The planner currently operates entirely in seconds for all time-related values. This includes:

  • RuntimeOptions.prometheus_scrape_intervalu64 seconds
  • QueryGroup.repetition_delay, step, range_durationu64 seconds
  • InstantQueryInfo.repetition_delay / RangeQueryInfo.repetition_delay, step, range_duration — all seconds (frequency.rs)
  • IntermediateWindowConfig.window_size / slide_interval — seconds (window.rs)
  • AggregationConfig.window_size / slide_interval in asap-common — explicitly documented as seconds (aggregation_config.rs:23–24)
  • The windowSize and slideInterval fields in the generated streaming YAML — seconds

The query engine then multiplies these by 1000 at the point of use (e.g. promql.rs:484, capability_matching.rs:73).

Problem

This makes it impossible to plan configs for workloads with sub-second scrape intervals or millisecond-granularity step/range values. The minimum expressible window is 1 second. With high-frequency data sources (e.g. 100ms or 500ms scrape intervals), the planner cannot generate correct configs.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions