Repository navigation
feat(telemetry): Prometheus /metrics endpoint with a sample Grafana dashboard - #279
Merged
Merged
Conversation
…ashboard Off by default; turned on in Settings > Telemetry (or LENS_PROMETHEUS), /metrics answers only a scraper with the scrape token and is served where the web app is, so it follows LENS_BIND. Exposes jobs by status and pipeline, routine runs, resources and imports, the activity ledger's calls, tokens, cost and failures by model, budgets, workers and disk. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCh396xzDRUrSuH1xohcXR
6 tasks done
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 could only push OpenTelemetry to a collector; Prometheus couldn't scrape it.
After: Settings → Telemetry has a Prometheus block (or
LENS_PROMETHEUS=on+LENS_PROMETHEUS_TOKEN). Turned on,/metricson the web app's address (so it followsLENS_BIND) serves Prometheus text format to a scraper sendingAuthorization: Bearer <scrape token>: jobs by status and pipeline (queue depth), routine runs, resources by status and imports, the activity ledger's calls, tokens, cost, failures and time by kind and model over 1h/24h, budgets (caps, spent, share, over), workers, disk and data folder size. Off by default (404); on without a token answers 401 to everyone. No personal content in labels.How:
app/domain/prometheus.pyrenders from existing tables per scrape;app/api/metrics.pygates it; Next proxies/metricslike/mcp. Docs indocs/prometheus.mdwith a scrape config anddocs/grafana/lens-dashboard.json.Motivation and Context
Ask in the project thread: build a Prometheus exporter.
Types of changes
Checklist:
docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01XCh396xzDRUrSuH1xohcXR
Generated by Claude Code