Skip to content

claude-ops observability: make OTEL retention visible and size-bounded #5236

Closed

Description

@kyle-sexton

Problem

The claude-ops OTEL store prune depends on an operator-registered scheduled task, and nothing in the plugin shows whether it is running or whether the store is growing. See provisioning issue melodic-software/provisioning#661 for registering the task.

Evidence on melo-lap-001 (2026-09-28): no prune task existed. Hot cc-logs.json reached 2.8 GB and cc-metrics.json 361 MB.

ADR-0009's cold-tier estimate ("tens of MB/month") is stale against measurements: cold held 72 MB for about 5 weeks (1.38M log rows, 2026-08-16 to 2026-09-22), and the hot tier held 790 MB of logs for 7 days because log lines carry inline API bodies.

The collector's fileexporter rotation cannot be combined with append: true (collector-contrib fileexporter README), so an external prune stays necessary.

Proposed change

  • The status action reports hot store size, cold store size, and last-prune time and age.
  • Add a size-cap fallback to prune-otel-store.sh: prune when a hot file exceeds N MB regardless of age (N configurable, with a documented default).
  • Refresh ADR-0009's cold-size estimate and the hot-tier sizing with the measurements above.
  • Note the fileexporter rotation/append constraint in the docs so nobody re-opens it.

Acceptance criteria

  • status prints hot size, cold size, and last-prune time/age.
  • prune-otel-store.test.sh covers the size-cap path (a hot file over the cap is pruned even when younger than the age limit).
  • ADR-0009 and the retention docs match the measured numbers.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Sep 29, 2026
  2. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    ContributorAuthor

    Additional bug found while running the prune manually on melo-lap-001 (2026-09-28): prune-otel-store.sh fails under Git Bash when CC_OTEL_STORE holds the machine value as a backslash Windows path (C:\ProgramData\local-otel\cc-store). awk reports "cannot redirect to C:ProgramDatalocal-otel..." because the backslashes are consumed. Nothing was mutated and the service kept running. Re-running with CC_OTEL_STORE=C:/ProgramData/local-otel/cc-store succeeded. The script should normalize the path (for example cygpath -m or replacing backslashes) before using it. Any scheduled task that calls it with the provisioned machine variable will hit this, so it blocks provisioning#661.

  3. kyle-sexton commented on Oct 1, 2026

    @kyle-sexton
    ContributorAuthor

    Owner decision (2026-10-01): approved the recommendation ("go with recommended", the owner's reply to the batch decision page that listed this question and its recommendation).

    Question: the only open criterion on #5236 is the ADR-0009 sizing refresh, which lives in melodic-software/medley. Chosen option A: an agent opens a draft PR in medley that appends a dated amendment (2026-10-01) to docs/adr/0009-local-claude-code-observability-backend.md. It records cold at 72 MB over about 5 weeks (1.38M log rows), hot logs at 790 MB per 7 days, the CC_OTEL_HOT_MAX_MB cap (default 1024), and that fileexporter rotation cannot be combined with append.

    Next: an agent opens the draft medley PR and links it here; #5236 closes when that PR merges. Relabeled agent-ready.

  4. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 1, 2026
  5. kyle-sexton commented on Oct 1, 2026

    @kyle-sexton
    ContributorAuthor

    Draft medley PR for the ADR-0009 amendment: https://github.com/melodic-software/medley/pull/2079. #5236 closes when it merges; the merge is the owner's call. Issue stays open.

  6. kyle-sexton commented on Oct 1, 2026

    @kyle-sexton
    ContributorAuthor

    All three acceptance criteria hold on main; closing.

    Merged:

    • claude-code-plugins#5425 (7708cba, 2026-09-30): CC_OTEL_HOT_MAX_MB size cap in prune-otel-store.sh (default 1024 MiB), probe-observability-state.sh --otel-store prints hot size, cold size and last-prune:<time> (<age>), retention docs carry the measured sizes and the fileexporter rotation/append constraint.
    • claude-code-plugins#5237 (aebb9bb): the prune handles backslash Windows CC_OTEL_STORE paths.
    • melodic-software/medley#2079 (b6c92aeaa0c8ccf6043041ad43af96e935842d0c, 2026-10-01, squash): ADR-0009 gains the ## Amendment (2026-10-01) section with cold 72 MB over about 5 weeks (1.38M log rows), hot logs 790 MB per 7 days, the CC_OTEL_HOT_MAX_MB cap, and the fileexporter v0.153.0 rotation/append constraint.

    Criteria:

    • status prints hot size, cold size and last-prune time/age: met (probe-observability-state.sh lines 230-247).
    • prune-otel-store.test.sh covers the size-cap path: met (case 26, a hot file over the cap is pruned though every line is young).
    • ADR-0009 and the retention docs match the measured numbers: met.

    Not claimed: the ADR amendment does not re-measure the 2026-06-09 "~2.6 GB to ~1 GB steady-state hot store" estimate; it states only the measured 7-day volume.

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

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.needs-triageNot yet classified. Floor until a type and one priority tier are set.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions