Documentation ¶
Index ¶
- type Bucket
- type Counter
- type Gauge
- type Histogram
- type Metric
- type MetricFamilies
- func (mfs MetricFamilies) Get(name string) *MetricFamily
- func (mfs MetricFamilies) GetCounter(name string) *MetricFamily
- func (mfs MetricFamilies) GetGauge(name string) *MetricFamily
- func (mfs MetricFamilies) GetHistogram(name string) *MetricFamily
- func (mfs MetricFamilies) GetSummary(name string) *MetricFamily
- func (mfs MetricFamilies) Len() int
- type MetricFamily
- type Prometheus
- type Quantile
- type Series
- func (s *Series) Add(kv SeriesSample)
- func (s Series) FindByName(name string) Series
- func (s Series) FindByNames(names ...string) Series
- func (s Series) Len() int
- func (s Series) Less(i, j int) bool
- func (s Series) Max() float64
- func (s *Series) Reset()
- func (s Series) Sort()
- func (s Series) Swap(i, j int)
- type SeriesSample
- type Summary
- type Untyped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶ added in v0.46.0
type Bucket struct {
// contains filtered or unexported fields
}
func (Bucket) CumulativeCount ¶ added in v0.46.0
func (Bucket) UpperBound ¶ added in v0.46.0
type Histogram ¶ added in v0.46.0
type Histogram struct {
// contains filtered or unexported fields
}
type MetricFamilies ¶ added in v0.46.0
type MetricFamilies map[string]*MetricFamily
func (MetricFamilies) Get ¶ added in v0.46.0
func (mfs MetricFamilies) Get(name string) *MetricFamily
func (MetricFamilies) GetCounter ¶ added in v0.46.0
func (mfs MetricFamilies) GetCounter(name string) *MetricFamily
func (MetricFamilies) GetGauge ¶ added in v0.46.0
func (mfs MetricFamilies) GetGauge(name string) *MetricFamily
func (MetricFamilies) GetHistogram ¶ added in v0.46.0
func (mfs MetricFamilies) GetHistogram(name string) *MetricFamily
func (MetricFamilies) GetSummary ¶ added in v0.46.0
func (mfs MetricFamilies) GetSummary(name string) *MetricFamily
func (MetricFamilies) Len ¶ added in v0.46.0
func (mfs MetricFamilies) Len() int
type MetricFamily ¶ added in v0.46.0
type MetricFamily struct {
// contains filtered or unexported fields
}
func (*MetricFamily) Help ¶ added in v0.46.0
func (mf *MetricFamily) Help() string
func (*MetricFamily) Metrics ¶ added in v0.46.0
func (mf *MetricFamily) Metrics() []Metric
func (*MetricFamily) Name ¶ added in v0.46.0
func (mf *MetricFamily) Name() string
func (*MetricFamily) Type ¶ added in v0.46.0
func (mf *MetricFamily) Type() textparse.MetricType
type Prometheus ¶
type Prometheus interface { // ScrapeSeries and parse prometheus format metrics ScrapeSeries() (Series, error) Scrape() (MetricFamilies, error) }
Prometheus is a helper for scrape and parse prometheus format metrics.
func New ¶
func New(client *http.Client, request web.Request) Prometheus
New creates a Prometheus instance.
func NewWithSelector ¶ added in v0.21.0
NewWithSelector creates a Prometheus instance with the selector.
type Series ¶ added in v0.46.0
type Series []SeriesSample
Series is a list of SeriesSample
func (Series) FindByName ¶ added in v0.46.0
FindByName finds metrics where it's __name__ label matches given name. It expects the metrics is sorted. Complexity: O(log(N))
func (Series) FindByNames ¶ added in v0.46.0
FindByNames finds metrics where it's __name__ label matches given any of names. It expects the metrics is sorted. Complexity: O(log(N))
func (Series) Less ¶ added in v0.46.0
Less reports whether the element with index i should sort before the element with index j.
func (Series) Max ¶ added in v0.46.0
Max returns the max value. It does NOT expect the metrics is sorted. Complexity: O(N)
type SeriesSample ¶ added in v0.46.0
SeriesSample is a pair of label set and value
func (SeriesSample) Name ¶ added in v0.46.0
func (s SeriesSample) Name() string
Name the __name__ label value