Expose the query metrics on a Prometheus endpoint

Aperta
#433 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
prometheus, rust

Direzione di ricerca

Start with beacon-db/beacon-core/src/metrics.rs and trace where the server consolidates each query's metrics; then locate the existing /api/query/metrics/{query_id} route and configuration handling. Check how routes are protected and how configuration and performance pages are organized. Done means /metrics exposes the listed low-cardinality metrics in Prometheus text format, uses super-user credentials, honors BEACON_METRICS_ENABLED (default true), and both pages document it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

beacon-kernel enhancement rust

Problem

Beacon measures every query. MetricsTracker counts the rows, the bytes and the time in
beacon-db/beacon-core/src/metrics.rs.
GET /api/query/metrics/{query_id} returns the result of one query. No endpoint reports the totals
of the server. An operator cannot scrape Beacon with Prometheus. The operator gets no alert on a
slow query.

Proposal

Add GET /metrics in the Prometheus text format. Update each counter at the point where the server
consolidates the metrics of a query.

Name Type Labels
beacon_queries_total counter status
beacon_query_duration_seconds histogram none
beacon_query_input_bytes_total counter none
beacon_query_result_rows_total counter none
beacon_active_queries gauge none
beacon_file_stats_files gauge state
beacon_build_info gauge version

Rules

  1. Keep the cardinality low. Add no query id label, no file path label and no username label.
  2. Protect the route with the super-user credentials. A total tells a caller what the data holds.
  3. Add BEACON_METRICS_ENABLED. The default is true.
  4. Document the endpoint on the configuration page and the performance page.
Lingua principale
Rust
Stelle
16
Fork
4
Merge medio
19h 58m
PR unite (30g)
39

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di maris-development/beacon

Tutte le issue di maris-development/beacon

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.