8000 feat(monitoring): Prometheus, node-exporter and Grafana as an opt-in compose profile by adeelahmad · Pull Request #297 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(monitoring): Prometheus, node-exporter and Grafana as an opt-in compose profile - #297

Merged
adeelahmad merged 4 commits into
mainfrom
claude/project-thread-kxit86
Oct 10, 2026
Merged

adeelahmad merged 4 commits into
mainfrom
claude/project-thread-kxit86

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner < 7438 /span>

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 (plus LENS_PROMETHEUS=on, a LENS_PROMETHEUS_TOKEN and LENS_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 on LENS_BIND:3001 with anonymous view-only access; Prometheus and node-exporter stay inside the Docker network. Also passes LENS_PROMETHEUS* to the API in docker-compose.prod.yml (missing in #279), and lens_jobs now 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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests.
  • I have updated docs/ accordingly.
  • Wrote it under ## Unreleased in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XCh396xzDRUrSuH1xohcXR


Generated by Claude Code

…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
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
@adeelahmad
adeelahmad merged commit 45995c6 into main Oct 10, 2026
15 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-kxit86 branch October 10, 2026 22:36
adeelahmad added a commit that referenced this pull request Oct 10, 2026
…s as built (#332)

#322, #330, #297 and #309 merged, so the README lists them as built and keeps
only open PRs under "In progress".


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
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.

2 participants

0