Task · GCI-0049

Count scrape intervals passed to custom and imported Alloy components

Description

An Alloy pipeline can wrap its scrape in a custom component: a local declare block, or a module pulled in by import.git, import.http, import.file or import.string. scrape_intervals.alloy_intervals only reads interval attributes owned by built-in prometheus.* components. An invocation such as mymod.scrape “x” { scrape_interval = “15s” } is therefore ignored, and when the module comes from a remote import the pipeline reports no interval and no unparsed count: a silent miss of the exact DPM driver GCI-0046 exists to find. A local declare whose prometheus.scrape reads argument.x.value is only reported as unparsed; the value passed at the call site, or the argument default, is not followed. A read-only sweep of all 935 pipelines in a large production estate on 2026-09-29 found no imports and no declare containing a scrape, so there is no live miss today; the defect is in the parser’s coverage.

Acceptance Criteria

Definition of Done

Implementation Notes

Alloy parsing now builds a per-body block model (_Alloy). Inside a declare, scrape_interval = argument..value resolves per call site, falls back to the argument default, and is unparsed when neither is a literal; a declare nobody calls contributes nothing (CodeRabbit). Interval-named literals on invocations of import.* module components are read, expressions unparsed. summarise records opaque_modules; the pillar lists a pipeline with imports and no deviating interval as Direction ‘partly visible’ with an Imported modules column (null on older payloads). AC4 proof: old and new parser compared in memory over all 935 pipelines of a large production estate, 935 identical, parse time 0.37s to 0.62s, slowest pipeline 36ms.

View the source file on GitHub