Skip to content

Expose Prometheus to the Triangle Grafana, sharing Loki's credentials - #180

Merged
ssavutu merged 1 commit into
mainfrom
feat/expose-prometheus
Aug 4, 2026
Merged

Expose Prometheus to the Triangle Grafana, sharing Loki's credentials#180
ssavutu merged 1 commit into
mainfrom
feat/expose-prometheus

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 4, 2026

Copy link
Copy Markdown
Member

The CMS dashboard is 14 Prometheus panels to 3 Loki ones, so exposing only Loki left the Triangle Grafana rendering a mostly empty dashboard. Prometheus was reachable from inside Delta only.

What this does

Fronts Prometheus with Nginx the same way as Loki: container published to 127.0.0.1:19090, Nginx on 9090 adding basic auth.

Only the query API is reachable — that is everything a Grafana datasource needs. Everything else 404s: the web UI, /metrics, and /config, which echoes the running scrape configuration.

/api/v1/admin/ is denied outright. Those endpoints don't exist today because neither --web.enable-admin-api nor --web.enable-lifecycle is passed, but the deny means turning a flag on later for debugging can't silently expose delete-series to everything that can reach the port.

Both sites now read a single triangle-observability.htpasswd, so the Triangle Grafana uses one credential pair for both datasources instead of two.

Verified on Delta

Check Result
Unauthenticated /api/v1/labels 401
Authenticated /api/v1/labels 200
/api/v1/admin/tsdb/delete_series 403
Web UI / 404
/api/v1/status/buildinfo 200
Loki endpoint after htpasswd move 200

sum(http_requests_total) through Nginx returns 765 — real traffic.

Note

This adds a second cleartext basic-auth endpoint on a host where ufw is inactive. Same tradeoff as the Loki endpoint and acceptable while VPN-internal, but it doubles what wants folding into the TLS work.

🤖 Generated with Claude Code

The CMS dashboard is 14 Prometheus panels to 3 Loki ones, so exposing only Loki
left the Triangle Grafana rendering a mostly empty dashboard. Prometheus was
reachable from inside Delta only.

Front it with Nginx the same way as Loki: container published to
127.0.0.1:19090, Nginx on 9090 adding basic auth. The query API is all a Grafana
datasource needs, so everything else 404s -- the web UI, /metrics, and /config,
which echoes the running scrape configuration. /api/v1/admin/ is denied outright:
those endpoints do not exist today because neither --web.enable-admin-api nor
--web.enable-lifecycle is passed, but the deny means enabling a flag later for
debugging cannot silently expose destructive endpoints.

Both sites now read one htpasswd file, so the Triangle Grafana uses a single
credential pair for both datasources rather than two.

Verified on Delta: 401 unauthenticated, 200 authenticated, 403 on the admin API,
404 on the web UI, and sum(http_requests_total) returning real data through
Nginx. The Loki endpoint still answers 200 after the htpasswd move.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit 43ac1b1 into main Aug 4, 2026
6 checks passed
@ssavutu
ssavutu deleted the feat/expose-prometheus branch August 4, 2026 22:21
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