Skip to content

Log shipping on the laptop: Grafana Alloy → Loki on the phone (after the lab soak) - #148

Draft
MIERAI wants to merge 3 commits into
mainfrom
log-shipping-laptop
Draft

MIERAI wants to merge 3 commits into
mainfrom
log-shipping-laptop

Conversation

@MIERAI

@MIERAI MIERAI commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Production step. Do not merge until both conditions hold: the lab soak (≥ 1h since 09:19 UTC, evidence in a comment below) and daytime JST.

This PR ships the laptop's pod logs to Loki on the phone. It uses the same collector as the lab (#145): platform/log-shipping + the overlay platform/log-shipping-laptop (cluster=laptop). It adds one Application platform-log-shipping (namespace log-shipping, CreateNamespace) to clusters/laptop/extras.

  • Production namespaces are untouched. The change is a new namespace with one 1-replica Alloy pod (request 20m/96Mi, limit 192Mi, GOMEMLIMIT 160MiB). It reads logs through the API server (no hostPath, no root, read-only filesystem, all capabilities dropped).
  • If the phone is unreachable: loki.write retries each batch 6× with backoff (at most 30 s apart) and then drops it. The source waits and keeps its position, so workloads are not affected; only log lines are lost.
  • Rollback: revert this PR. Argo CD prunes the Application and its resources.

Render (product render.py v0.1.5, main → this branch):

  • laptop: of the 28 Applications, only extras-laptop changes (+27 lines: the new Application). The root is byte-identical, and so are all prod/staging Applications.
  • lab: unchanged.

🤖 Generated with Claude Code

…the lab soak)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Rendered diff (as Argo CD renders: kustomize / Helm, against origin/main)

No change in the rendered manifests.

@MIERAI

MIERAI commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Lab soak evidence: 1h, 09:19 → 10:19 UTC (platform-log-shipping on the lab). Nothing went wrong, so the soak condition is met. The remaining condition is daytime JST.

  • Alloy pod alloy-6547977889-vn4fx: 0 restarts. Its peak working set over the hour was 153 MiB, against a 192Mi limit. CPU averaged about 0.004 cores.
  • loki_write_sent_entries_total 250,602, loki_write_dropped_entries_total 0 (every reason).
  • Loki on the phone: about 1.6 KB/s ingested on average (after the initial catch-up). ~/loki/data is 6.7 MB. up{job="loki"} = 1 throughout.
  • From the laptop Grafana's Loki datasource, the lab's logs are queryable across all its namespaces.

Change from the lab soak: the laptop overlay now raises Alloy's memory limit to 256Mi (GOMEMLIMIT 220MiB), because the laptop has about twice the lab's pods. The lab keeps 192Mi.

Re-rendered against current main with product render.py v0.1.5:

  • laptop: of the 28 Applications, only extras-laptop changes (+1 Application). The root is byte-identical, and so are all prod/staging Applications.
  • lab: unchanged.

The branch was brought up to date with a merge from main, not a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant