Repository navigation
feat(monitoring): Prometheus, node-exporter and Grafana as an opt-in compose profile - #297
Merged
Merged
Conversation
…compose profile The monitoring profile runs Prometheus scraping Lens's /metrics with the scrape token and node-exporter for the machine, and Grafana with the Lens dashboard (now with machine panels) as its home. System health shows CPU, memory, load and uptime now and links to Grafana (telemetry.grafana_url / LENS_GRAFANA_URL) for history. The compose file passes LENS_PROMETHEUS and LENS_PROMETHEUS_TOKEN to the API, and lens_jobs reports 0 for statuses with no jobs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCh396xzDRUrSuH1xohcXR
…-kxit86 # Conflicts: # CHANGELOG.md
…-kxit86 # Conflicts: # CHANGELOG.md
…-kxit86 # Conflicts: # CHANGELOG.md
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.
Requested by Adeel · project thread
Description
Before: Lens served
/metrics(#279) but you had to bring and wire your own Prometheus and Grafana, and System health showed no CPU, memory or uptime.After:
COMPOSE_PROFILES=monitoring(plusLENS_PROMETHEUS=on, aLENS_PROMETHEUS_TOKENandLENS_GRAFANA_URL) runs stock Prometheus, node-exporter and Grafana OSS next to Lens, already connected, with the Lens dashboard as Grafana's home. The dashboard now has a Machine row (CPU, memory, disk, load, network, uptime from node-exporter). Admin → System health shows a thin "Server now" row (CPU, memory, load, uptime) and links to Grafana for charts and history; Settings → Telemetry has the Grafana address.How:
monitoring/holds the Prometheus config and Grafana provisioning; Prometheus writes the scrape token from env into a credentials file at start. Grafana listens onLENS_BIND:3001 with anonymous view-only access; Prometheus and node-exporter stay inside the Docker network. Also passesLENS_PROMETHEUS*to the API in docker-compose.prod.yml (missing in #279), andlens_jobsnow reports 0 for empty statuses so Grafana stats don't show "No data". Checked locally: Prometheus 3.5.0 scraped a running Lens API with the token (up{job="lens"} = 1).Motivation and Context
Adeel asked for a server health and stats page captured via Prometheus, and not to reinvent the wheel: use existing open tools rather than custom charts.
Types of changes
Checklist:
docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01XCh396xzDRUrSuH1xohcXR
Generated by Claude Code