Skip to content

chore(analytics): finish-or-remove decision for dead analytics collector/Query* surface (no-delete: needs human call) #1033

Closed

Description

@cristim

Problem. Per report 06 A1/L1/L2: NewCollector, SaveSnapshot/BulkInsertSnapshots, all Query*, and partition management have zero production callers; only RefreshMaterializedViews is wired, refreshing views over a table nothing writes to. Partitions stop being created after the seeded 3 months (M3); retention never runs. ~300 LOC + 4 mock files + an indexed FK column maintained for an unused API.

Evidence. Report 06 (A1, L1, L2, M3). Repo-wide grep confirms no live caller.

Suggested fix (explicit decision required, no-delete rule). Either (a) finish: wire the collector to an EventBridge schedule + monthly partition-maintenance job + expose Query* via the dashboard (then I-12's guards become mandatory), or (b) remove the unused surface. Do not leave the half-built scaffold.

References. Source: report 06 (A1, L1, L2, M3). Gated by I-12 (guards before wiring).


Filed from automated adversarial code review (see docs/code-review/). Source finding(s): 06-A1, 06-L1, 06-L2.

Activity

  1. added
    pr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)
    pr-mergedThe PR for this issue has been merged
    on Jun 7, 2026
  2. cristim commented on Jul 27, 2026

    @cristim
    MemberAuthor

    Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
    The analytics collector is fully wired as scheduled task TaskCollectAnalytics with partition management.
    Evidence: commit 5fc0899 (PR #1049).
    Recommending close.

  3. cristim commented on Sep 2, 2026

    @cristim
    MemberAuthor

    Verified resolved at 3c0f8ac: the finish option was implemented. The analytics collector runs as the scheduled task TaskCollectAnalytics with monthly partition provisioning and retention, and the Query* surface is consumed by the dashboard analytics handlers. Evidence: internal/server/analytics_collect.go:110 and internal/server/handler.go:44,193 (#1049, commit 5fc0899); consumers at internal/api/handler_analytics.go:171,217. Residual axes checked: partition management and retention are wired (analytics_collect.go:22-51), QueryHistory/QueryBreakdown have live callers, no remaining dead Query* entry points found. Closing as completed; reopen if the behaviour recurs.

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

    effort/mDaysimpact/internalTeam-internal onlypr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)pr-mergedThe PR for this issue has been mergedpriority/p3Polish / idea / may never shipseverity/highSignificant harmtriagedItem has been triagedtype/choreMaintenance / non-user-visibleurgency/this-quarterWithin the quarter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions