Skip to content

fix: observability stack log paths and self-hosted Supabase wiring#244

Merged
NesiciCoding merged 3 commits into
mainfrom
claude/interesting-feynman-5fdb52
Jun 30, 2026
Merged

fix: observability stack log paths and self-hosted Supabase wiring#244
NesiciCoding merged 3 commits into
mainfrom
claude/interesting-feynman-5fdb52

Conversation

@NesiciCoding

@NesiciCoding NesiciCoding commented Jun 30, 2026

Copy link
Copy Markdown
Owner

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_logs diagnostic flag in CI.

  • RUBRICMAKER_LOG_DIR glob 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's logs/ folder.
  • Broken symlinks: 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 couldn't resolve inside the container. Added RUBRICMAKER_WEBSERVER_LOG_DIR to mount that target dir at the same absolute path so the symlinks work.
  • Self-hosted DB network docs: the example only covered joining this repo's combined docker-compose.yml stack's network (rubricmaker_default). Most self-hosted deployments actually run the official Supabase CLI stack instead (network supabase_default, container supabase-db) — documented both.
  • CI: added VITE_STRESS_TEST_LOGGING to deploy-hestiacp.yml as an opt-in repo variable (not secret), so the client_logs diagnostic stream can be toggled for a pilot window via a rebuild instead of a manual local build.

Test plan

  • Reproduced and fixed live on a HestiaCP host: Promtail now tails real Apache log files via the corrected mounts (verified via docker compose logs promtail showing no more stat failed errors, and log lines appearing in Grafana Explore)
  • Reproduced and fixed the self-hosted Postgres datasource connection by joining supabase_default and pointing at supabase-db:5432 (verified via Grafana's datasource "Save & test")
  • client_logs table population itself (requires VITE_STRESS_TEST_LOGGING=true rebuild + migration confirmation) — out of scope for this PR, follow-up

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added an optional RUBRICMAKER_WEBSERVER_LOG_DIR setting to support HestiaCP symlinked web log targets.
    • Introduced an optional build flag for stress-test logging (VITE_STRESS_TEST_LOGGING).
  • Bug Fixes

    • Improved Promtail log scanning by clarifying that bind-mount sources must be literal directories (no glob patterns), preventing missing-log errors with per-domain symlinks.
  • Documentation

    • Updated HestiaCP observability instructions and examples for correctly mounting aggregated vs per-domain log paths, including single-domain targeting guidance.

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.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4e266dae-a421-44b9-9068-c652b712f32d

📥 Commits

Reviewing files that changed from the base of the PR and between af102ca and 5902714.

📒 Files selected for processing (1)
  • .env.observability.example

📝 Walkthrough

Walkthrough

Adds RUBRICMAKER_WEBSERVER_LOG_DIR for Promtail HestiaCP symlink resolution, updates observability docs for literal bind-mount paths, expands Supabase compose comments, and passes VITE_STRESS_TEST_LOGGING into the deploy workflow build.

Changes

Promtail symlink mount and log path guidance

Layer / File(s) Summary
Promtail webserver log bind mount and env variable
docker-compose.observability.yml, .env.observability.example
Adds the optional RUBRICMAKER_WEBSERVER_LOG_DIR mount for promtail and documents the variable alongside literal-directory bind-mount requirements.
HestiaCP log path and symlink documentation
docs/OBSERVABILITY_HESTIACP.md
Revises the HestiaCP observability guide to use literal mount sources, explain bind-mount constraints, and clarify symlink target handling and single-domain narrowing.
Supabase networking comments in compose file
docker-compose.observability.yml
Expands the commented Supabase networking guidance to describe multiple Docker network and host naming setups.

CI build: VITE_STRESS_TEST_LOGGING

Layer / File(s) Summary
Add VITE_STRESS_TEST_LOGGING to CI build
.github/workflows/deploy-hestiacp.yml
Adds VITE_STRESS_TEST_LOGGING to the build environment in the deploy workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through logs both near and far,
A literal path became the star.
The symlinks point where they should go,
And build flags bloom in the workflow glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes to observability log paths and self-hosted Supabase wiring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/interesting-feynman-5fdb52

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 59.96% (🎯 52%) 5910 / 9856
🔵 Statements 58.65% (🎯 51%) 6757 / 11520
🔵 Functions 48.12% (🎯 42%) 1923 / 3996
🔵 Branches 50.42% (🎯 43%) 4761 / 9441
File CoverageNo changed files found.
Generated in workflow #701 for commit 5902714 by the Vitest Coverage Report Action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 07bb6cd and 5c5ce53.

📒 Files selected for processing (4)
  • .env.observability.example
  • .github/workflows/deploy-hestiacp.yml
  • docker-compose.observability.yml
  • docs/OBSERVABILITY_HESTIACP.md

Comment thread .env.observability.example Outdated
Comment thread docker-compose.observability.yml Outdated
Comment thread docs/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5c5ce53 and af102ca.

📒 Files selected for processing (3)
  • .env.observability.example
  • docker-compose.observability.yml
  • docs/OBSERVABILITY_HESTIACP.md

Comment thread .env.observability.example Outdated
…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.
@NesiciCoding NesiciCoding merged commit cac58f8 into main Jun 30, 2026
8 checks passed
@NesiciCoding NesiciCoding deleted the claude/interesting-feynman-5fdb52 branch June 30, 2026 17:18
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