Skip to content

[RCA] Collect bounded FODC metric windows #14225

Open

Description

@hanahmily

Umbrella: #14222

Blocked by: #14223 (implementation contracts only; see dependency contract below).

Summary

Collect bounded FODC metric windows. Deliver one usable operation, not a framework-only foundation.

Boundary

Proposed activation caller: bydbctl rca collect --source=fodc-metrics. Command names are proposed, not existing APIs.
Reporter collection runs with read-only source access; offline steps use local files only.
No source storage/wire-format changes are requested. The incident format is separately versioned.

Requirements

R1. Collect the requested incident window through the existing FODC API with explicit endpoint, node filters, deadline and byte cap.
R2. Preserve metric names, labels, timestamps and source identity; record requested versus observed time ranges and missing agents where the API provides them.
R3. Distinguish partial, unavailable, empty and complete evidence. Do not claim the recorder retained data outside its reported window; if coverage cannot be proved, record unknown.
R4. Write into the same private manifest without overwriting the native-log source status. Propagate cancellation and cap retries.

Acceptance criteria

  • A recorded API fixture has two agents, one expired interval and one unavailable agent. Independently specified samples survive unchanged and coverage names both gaps.
  • Exercise the CLI against a FODC fixture server including timeout, malformed response and an oversized response. All terminate within configured test bounds and leave an honest source status.
  • Use hand-authored or independently captured fixtures with documented provenance; do not generate expected values using the code under test.
  • Add focused behavioral tests before implementation and record the actual RED command/failure, then GREEN results.
  • Keep existing CLI/API behavior compatible. Never overwrite unrelated user files; output conflicts must be refused.

Scope and readiness audit

  • Boundary and behavior: the single operation above; independently observable output and refusal behavior.
  • Production activation: the named CLI or skill entry point above, included in the same PR.
  • Packages/callers: fodc/proxy/internal/api/server.go /metrics-windows and /metrics; existing FODC metric-window tests.
  • Dependencies: [RCA] Collect a bounded native-log incident window #14223. See the dependency contract below for the exact shared interfaces and runtime independence.
  • Classification: planned blocked leaf; revalidate prerequisite seams after merge.
  • RED evidence: not executed during this planning task; no claim of passing or failing implementation tests.
  • End-to-end proof: the real command/skill scenarios above, not source-text assertions.
  • Formats/lifecycle/fixtures: private workspace or public archive only; artifact-specific fixture family above.
  • Focused tests: CLI leaves should add TestRCA… coverage under bydbctl/internal/cmd and/or the introduced collector package;
    run go test ./bydbctl/internal/cmd -run TestRCA -count=1 plus the new package tests. Skill leaves must add a replayable evaluation harness
    with an exact command documented in the PR. Final test names/paths are fixed when the prerequisite seam merges.
  • Resource/concurrency checks: cancellation, bounded reads/output and cleanup on failure; use repository panic-aware goroutine wrappers if concurrency is introduced.
  • Decision: one proposed PR. If the named behavior requires an unimplemented server API or another lifecycle change, stop and split that prerequisite.

Required-only scope audit

Metrics are a requested diagnostic source; a new monitoring system is not.

Removed/deferred: New metric retention, new alert configuration, automatic discovery and new collection endpoints.

Out of scope

New metric retention, Prometheus deployment, alerts, changing FODC ring buffers.

Concrete verification and closure gate

These are required acceptance tests, not examples that may be skipped. Artifact filenames and unsupported format handling must follow the merged prerequisite contracts. Before queueing, fix the tested schema version, configured limits, observable statuses and independent expected values; record any necessary interface decision in this issue rather than leaving it to an agent mid-run.

Fixed acceptance scenario

For agent A, return three samples at fixed UTC timestamps with values 50, 80 and 95; agent B is unavailable and part of the requested history has expired. Assert exact retained timestamps/values and explicit unavailable/unknown coverage as supported by the API; never synthesize zero samples. Test malformed data, timeout and a response one byte over the configured cap. Each must terminate with an explicit failure/partial result rather than complete coverage.

Executable regression

Proposed named regression: TestRCAMetricWindowCollect in bydbctl/internal/cmd exercising the registered command through an existing CLI test seam.
After normal repository generation, use:

go test ./bydbctl/internal/cmd -run '^TestRCAMetricWindowCollect$' -count=1 -v
make test-ci PKG=./bydbctl/internal/cmd

The exact selector must execute at least one test, not return “no tests to run.” If repository conventions require a different test harness or location, update this section with the real command before queueing; do not claim this proposed test already exists. Also run the actual changed internal package suites.

For GraphLoom, apply only the regression tests/fixtures to the chosen base: they must compile and fail by a relevant assertion. Apply the implementation: the same test must pass. Tests that import a new production package missing from the base are not valid assertion-based RED proof; use an existing command seam. Exercise the real CLI with fixture endpoints/files. If the issue requires deployment E2E, record its separate command and result; fixture-server tests alone do not satisfy it.

Evidence required to close this issue

  • Source/base revision, exact commands, fixture provenance and independently specified expected outcomes.
  • Actual positive and negative/partial-case results; explain failures and rerun after fixes.
  • Produced artifact/manifest/report samples with no real sensitive data, and the relevant size/coverage/privacy assertions.
  • Applicable repository checks and integration/evaluation results; explicitly list checks not run. A required check not run leaves acceptance incomplete, not passed.
  • For failures/cancellation, confirm no false completion marker and no unrelated user-file overwrite.

No verification execution is claimed by adding this section. Do not close the issue merely because code or documentation was submitted.

Dependency contract: implementation order versus runtime inputs

Implementation prerequisites mean merged interfaces needed to implement/test this issue. They do not mean that those evidence collectors must run or succeed for every incident.

Runtime behavior and verification

Metrics collection must work against an authorized FODC endpoint with native logging disabled or unavailable. It must not query _monitoring_log, invoke the native-log collector or require a log artifact. Test a metrics-only workspace and assert no native-log calls.

Wait for prerequisite contracts to merge before queueing automated implementation, then revalidate the real interfaces. Do not add direct blockers for dependencies already covered transitively. No new issue or automation job is introduced by this clarification.

Activity

  1. added this to the BanyanDB - 0.13.0 milestone on Nov 16, 2026
  2. added
    enhancement
    database
    metrics
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseenhancementmetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions