Skip to content

Metrics and logs are kept for two hours #550

Closed

Description

@dan-petty

Prometheus kept 2 hours (512 MB) and Loki 2 hours, which left no history for:

The Prometheus limit (retention: 2h, retentionSize: 512MB) came from the kube-prometheus-stack values. kube-prometheus-stack was removed in #734 (fdd4d0f), and #738 (f93231b) brought Prometheus back as the plain prometheus-community/prometheus chart. Prometheus now keeps 30d on a 20Gi PV and Loki keeps 720h (retention_period) on a 2Gi PV, so the history above now exists. The stack's bundled alert rules were removed with it, so no rule for a filling volume exists now, and Alertmanager is still disabled.

Deliverables

Activity

  1. added this to the v0.2.24 milestone on Sep 24, 2026
  2. added
    type/feature
    scope/k8s
    priority/p2-medium
    on Sep 24, 2026
  3. modified the milestones: v0.2.24, v0.2.25 on Sep 30, 2026
  4. dan-petty commented on Sep 30, 2026

    @dan-petty
    OwnerAuthor

    Moved from v0.2.25 to the backlog. v0.2.25 is capped at 12 items (#740), and only the next two planned releases keep a milestone (#739), so P2 items wait in the backlog until reprioritization pulls them in.

  5. dan-petty commented on Oct 1, 2026

    @dan-petty
    OwnerAuthor

    Confirmed (2026-10-01, read-only on homelab-k3s): Loki never deletes logs by age.

    • Config. GET /config on Loki 3.6.11 (chart loki-7.3.0) shows compactor.retention_enabled: false and delete_request_store: "". limits_config.retention_period is 2h live, and 720h on the v0.2.24 release branch.
    • Retention has never run. loki_compactor_apply_retention_last_successful_run_timestamp_seconds is 0, while compaction itself runs every 10 minutes.
    • Old data is still there. index/stats still returns chunks 7 and 12 days old under the live 2h setting.
    • Origin. retention_period came in with d9c1e63 (v0.2.15, feat(k8s): centralized kubernetes logging stack and LogQL integration #96). No compactor block has ever existed (git log --all -S compactor -- k8s/ is empty).
    • Fix, checked offline with helm template against chart 7.3.0. Add under loki: in k8s/logging/loki-values.yaml:
      compactor:
        working_directory: /var/loki/compactor
        retention_enabled: true
        delete_request_store: filesystem   # Loki 3.x refuses to start with retention on and no store
      A values test belongs beside tests/test_k8s.py:1171. With the delete store set, /loki/api/v1/delete also opens while auth_enabled is false, so decide whether limits_config.deletion_mode: disabled is wanted. stack_lifecycle.py installs grafana/loki without --version, so the chart's key layout isn't pinned either.
    • Growth. About 50 MB/day compressed. The 2Gi local-path PVC doesn't enforce its size, so growth lands on the node's root filesystem, which has 41.5 GiB free.
  6. added
    type/bug
    and removed
    type/feature
    on Oct 2, 2026
  7. added this to the v0.2.25 milestone on Oct 3, 2026
  8. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Owner decision (2026-10-03): 30-day retention for homelab logs and metrics. Loki: compactor retention enforcing 30 days (retention_period: 720h with compactor.retention_enabled), and its volume sized for 30 days of pod logs plus the host journals #1080 adds (measured ingest rate × 30 d with headroom). Prometheus: 30 days by time; its size cap must not cut history earlier once #1080's host series land. Milestone v0.2.25.

  9. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Closed by #1092, merged into release/v0.2.25.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  10. added a commit that references this issue on Oct 3, 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

    priority/p2-mediumscope/k8stype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions