feat: reach Grafana the way pgadmin is reached - #97
Merged
Merged
Conversation
A /grafana route, so it does not need an SSH tunnel. The compose already set GF_SERVER_SERVE_FROM_SUB_PATH, so proxy_pass carries no path of its own: the prefix has to survive to Grafana. Grafana Live is websockets and gets its own block. Grafana keeps binding 127.0.0.1 only. nginx stays the single way in. Also fixes the verification step in the two-instances runbook, which could not work. It counted /api/v1/health-check/ in the container logs, and that path is deliberately excluded from the access log — so it returns zero no matter how well the upstream is balancing, which reads exactly like a failed change. It now counts a path that is logged, and says why the Archivist's own traffic being evenly split proves nothing here: that goes through the network alias, with no nginx involved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EQda9NZvkbStEeNU54Tqgh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
/grafanaroute, so it is reachable the way pgadmin is rather than through an SSH tunnel.Grafana keeps binding
127.0.0.1only. nginx stays the single way in.The detail that makes it work
proxy_pass http://127.0.0.1:3001;carries no path of its own. The compose already setsGF_SERVER_SERVE_FROM_SUB_PATH=truewith a root URL ending in/grafana/, so Grafana expects the prefix to arrive intact. Adding a path toproxy_passwould strip it and Grafana would redirect in a loop.Grafana Live is websockets and gets its own block with the upgrade headers.
Before this goes live
The admin password had not actually changed, and that was worth catching before the route existed rather than after:
GF_SECURITY_ADMIN_PASSWORDin the env fileadmin/adminagainst the APITwo causes, stacked.
docker restartdoes not re-readenv_file— variables are fixed when the container is created. AndGF_SECURITY_ADMIN_PASSWORDonly applies when the admin user is first created, so even recreating the container would have left the old password in the existing volume.Now, after recreating the volume:
Datasources came back on their own — they are provisioned from files, which is why losing the volume cost nothing.
Also fixes a broken verification step
The two-instances runbook told you to count
/api/v1/health-check/in the container logs. That path is deliberately excluded from the access log, so it returns zero however well the upstream is balancing — which reads exactly like a failed change, and did.It now counts a path that is logged, and says why an even split of the Archivist's
collocation/pendingproves nothing here: that traffic goes through thegatekeepernetwork alias with no nginx involved.With the corrected check, against the route you already applied:
Applying it
Same manual steps as before —
docs/runbooks/two-instances.md, steps 2 to 5. The backup you took stays valid.One thing worth doing in the same pass: pgadmin is already public through this file, and the trap above — a password that looks set and is not — applies to it just as well.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EQda9NZvkbStEeNU54Tqgh