fix: observability stack log paths and self-hosted Supabase wiring#244
Conversation
Three bugs found while debugging an empty Grafana dashboard on a HestiaCP deployment: - RUBRICMAKER_LOG_DIR examples used a shell glob (/home/<user>/web/*/log), which Docker bind mounts don't expand — it silently created an empty literal directory instead. Now points at the parent dir; Promtail's own ** glob already recurses into each domain's logs/ folder. - HestiaCP's per-domain web/<domain>/logs/*.log files are typically symlinks to the real webserver log dir (e.g. /var/log/apache2/domains), which lives outside the RUBRICMAKER_LOG_DIR mount and so couldn't be resolved. Added RUBRICMAKER_WEBSERVER_LOG_DIR to mount that target dir at the same path. - The self-hosted-db network join example assumed this repo's combined docker-compose.yml stack (network rubricmaker_default). Documented the official self-hosted Supabase CLI stack as well (network supabase_default, container supabase-db), which is what most self-hosted deployments actually run. Also wired VITE_STRESS_TEST_LOGGING into the HestiaCP deploy workflow as an opt-in repo variable, so the client_logs diagnostic stream can be toggled for a pilot window without a manual build.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesPromtail symlink mount and log path guidance
CI build: VITE_STRESS_TEST_LOGGING
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report
File CoverageNo changed files found. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.env.observability.example:
- Around line 37-43: The observability example mixes “leave unset/blank”
guidance with an active default for RUBRICMAKER_WEBSERVER_LOG_DIR, so update the
example to model the unset state instead. In .env.observability.example, keep
the explanatory comment and comment out the RUBRICMAKER_WEBSERVER_LOG_DIR
assignment so users don’t enable it by default, especially when
RUBRICMAKER_LOG_DIR is already set. Use the existing
RUBRICMAKER_WEBSERVER_LOG_DIR example and surrounding HestiaCP notes as the
locator.
In `@docker-compose.observability.yml`:
- Around line 36-41: The bind mount in the observability compose config
conflicts with the “optional” HestiaCP guidance because the current default
still mounts /var/log/apache2/domains when RUBRICMAKER_WEBSERVER_LOG_DIR is
unset. Update the volume entry in docker-compose.observability.yml so the mount
is omitted entirely when the variable is empty/unset (for example by using the
conditional expansion pattern around RUBRICMAKER_WEBSERVER_LOG_DIR), or else
revise the nearby comment to clearly state that the default path will be
created/mounted on non-HestiaCP setups.
In `@docs/OBSERVABILITY_HESTIACP.md`:
- Around line 105-123: Add a warning in the observability docs after the
RUBRICMAKER_WEBSERVER_LOG_DIR section that overlapping mounts can cause
duplicate Promtail ingestion. Explain that setting both RUBRICMAKER_LOG_DIR and
RUBRICMAKER_WEBSERVER_LOG_DIR to related Apache paths can make the same logs
visible twice through the promtail pipeline, leading Loki to index duplicate
streams because __path__ differs. Place the note near the RUBRICMAKER_LOG_DIR
and RUBRICMAKER_WEBSERVER_LOG_DIR guidance so readers can choose non-overlapping
paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f475cd03-8696-474e-b0cd-d6246beb1ffb
📒 Files selected for processing (4)
.env.observability.example.github/workflows/deploy-hestiacp.ymldocker-compose.observability.ymldocs/OBSERVABILITY_HESTIACP.md
Address CodeRabbit review on #244: - .env.observability.example example line contradicted its own "leave unset" guidance — comment it out. - docker-compose.observability.yml defaulted the bind-mount source to /var/log/apache2/domains even when unset, which Docker would silently create as an empty directory on non-HestiaCP hosts. Default to /var/log instead, which always exists, so leaving the var unset is a true no-op. - Clarified in the HestiaCP doc that the second mount isn't independently scraped by Promtail (only one webserver job globs RUBRICMAKER_LOG_DIR), so it doesn't cause duplicate log ingestion as flagged.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.env.observability.example:
- Around line 42-43: The comment in the observability env example is misleading
about the mount behavior when the log dir is unset. Update the note near the
RUBRICMAKER_WEBSERVER_LOG_DIR setting to match the actual behavior in
docker-compose.observability.yml, or change the compose expression so the mount
is truly skipped when the variable is blank. Use the existing
RUBRICMAKER_WEBSERVER_LOG_DIR reference and the docker-compose.observability.yml
mount logic as the source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 08fff927-fa0f-40b7-8ba3-69d7476aef57
📒 Files selected for processing (3)
.env.observability.exampledocker-compose.observability.ymldocs/OBSERVABILITY_HESTIACP.md
…back The comment claimed leaving it unset adds no mount; it actually falls back to mounting /var/log read-only, which is harmless since Promtail only scrapes RUBRICMAKER_LOG_DIR. Address CodeRabbit follow-up on #244.
Summary
Fixes three bugs found while debugging an empty Grafana dashboard on a real HestiaCP/Apache deployment with self-hosted Supabase, plus wires up the
client_logsdiagnostic flag in CI.RUBRICMAKER_LOG_DIRglob bug: the doc/example used/home/<user>/web/*/log, but Docker bind mounts don't expand shell globs — Docker silently creates an empty literal directory instead of matching anything. Now points at the parent dir (/home/<user>/web); Promtail's own**glob already recurses into each domain'slogs/folder.web/<domain>/logs/*.logfiles are typically symlinks to the real webserver log dir (e.g./var/log/apache2/domains), which lives outside theRUBRICMAKER_LOG_DIRmount and couldn't resolve inside the container. AddedRUBRICMAKER_WEBSERVER_LOG_DIRto mount that target dir at the same absolute path so the symlinks work.docker-compose.ymlstack's network (rubricmaker_default). Most self-hosted deployments actually run the official Supabase CLI stack instead (networksupabase_default, containersupabase-db) — documented both.VITE_STRESS_TEST_LOGGINGtodeploy-hestiacp.ymlas an opt-in repo variable (not secret), so theclient_logsdiagnostic stream can be toggled for a pilot window via a rebuild instead of a manual local build.Test plan
docker compose logs promtailshowing no morestat failederrors, and log lines appearing in Grafana Explore)supabase_defaultand pointing atsupabase-db:5432(verified via Grafana's datasource "Save & test")client_logstable population itself (requiresVITE_STRESS_TEST_LOGGING=truerebuild + migration confirmation) — out of scope for this PR, follow-up🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
RUBRICMAKER_WEBSERVER_LOG_DIRsetting to support HestiaCP symlinked web log targets.VITE_STRESS_TEST_LOGGING).Bug Fixes
Documentation