expfmt: Implement OpenMetrics generation

Aperta
#214 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Inizia leggendo il package expfmt e metrics.proto, quindi esamina i TODOs rimanenti in questa issue per determinare quali funzionalità OpenMetrics e decisioni di compatibilità rientrano ancora nell’ambito. Verifica l’eventuale presenza del supporto esistente alla generazione OpenMetrics e dei relativi test. Il lavoro è completo quando l’insieme di funzionalità concordato è implementato, gli input non supportati vengono gestiti e la negoziazione legacy rimane utilizzabile.

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

Descrizione

To support OpenMetrics in v1 of prometheus/client_golang, we need to add OpenMetrics generation to the expfmt package, effectively a proto-to-OpenMetrics converter.

For this to work, we need to add the needed additional fields to metrics.proto. This should be backwards compatible for still existing protobuf consumers, while it provides an "inofficial" protobuf representation for OpenMetrics as a byproduct. This has the potential of creating confusion. However, the prometheus/client_model repo is anyway mostly deprecated, so we might as well abuse it for this "hack".

Update: Basic support is done. Here are the remaining TODOs (some of them will require more or less breaking changes, so we might consider bundling them and perhaps even starting to use major version numbers for this repo):

  • Feature support:
    • # UNIT.
    • _created.
    • info type.
    • stateset type.
    • gaugehistogram type.
  • Figure out how to deal with the _total suffix. (Currently, we require it to be in the metric name and truncate it for TYPE/HELP, which is arguably the opposite of what would be expected but which simplifies the transition from current Prom text format usage.)
  • Reject exemplars that are too long.
  • Reject counters with NaN
  • More sophisticated timestamp rendering for both samples and exemplars (to not run into precision and overflow issues with float64 and time.UnixNano).
  • Get rid of NegotiateIncludingOpenMetrics (but we have to make sure there remains some way of letting users opt out of OpenMetrics to support legacy setups – which could be on the Prometheus server side by making the Accept header configurable).
  • Add the Close method directly to the Encoder interface.
Lingua principale
Go
Stelle
297
Fork
380
Merge medio
3g 15h
PR unite (30g)
13

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 prometheus/common

Tutte le issue di prometheus/common

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.