Use a build tag to toggle Prometheus/metrics

Aperta
#5,179 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Start by reading the linked Go build-tags article and identify the Prometheus and API endpoint imports in the Bee codebase. Use the proposed metrics tag to assess whether those imports are excluded, then run gsa and confirm that the resulting bundle no longer includes Prometheus metrics.

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

Descrizione

Summary

Not always metrics are needed to be enabled. In certain cases, you'd want to have them disabled to decrease bundle size and gain slight performance gains. Would be very nice if all metrics (including both prometheus and API endpoints) could be disabled using a build tag

Motivation

There is no point for Prometheus metrics in WASM or low-end environments such as EFI modules. Additionally, Prometheus blocks compilation for tinygo.

Implementation

Use build tags. Here's an article explaining how they work: https://leapcell.io/blog/understanding-go-build-tags

Example name: -tag metrics

Drawbacks

Would require a bunch of manual rewriting. You can also check whether Prometheus is included or not by running gsa and observing imports: https://github.com/Zxilly/go-size-analyzer/issues

Lingua principale
Go
Stelle
1.5k
Fork
390
Merge medio
2g 22h
PR unite (30g)
24

Preparare l'ambiente

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 ethersphere/bee

Tutte le issue di ethersphere/bee

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.