master
go 21 lines 1.04 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 // Package prometheus scrapes and parses the Prometheus text exposition format.
4 //
5 // One parse pass drives three outputs from a single [New] / [NewWithSelector]
6 // instance:
7 //
8 // - [Prometheus.Scrape] assembles typed [MetricFamilies] — gauges, counters,
9 // summaries, and histograms — folding _sum/_count/_bucket and quantile series
10 // into their families.
11 // - [Prometheus.ScrapeSeries] returns the raw [Series]: one [SeriesSample] per
12 // scraped series, with labels in textparse-sorted order.
13 // - [Prometheus.ScrapeWithTransform] runs a per-sample transform — the form a
14 // Prometheus metric-relabeling step operates on — over the flat [Sample]
15 // stream before assembling the kept samples into typed [MetricFamilies]; a
16 // nil transform behaves like Scrape.
17 //
18 // Results are valid only until the next scrape on the same instance; buffers are
19 // reused across scrapes. An optional selector (see the selector subpackage)
20 // filters series during the parse.
21 package prometheus