prometheus

package module
v0.75.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package prometheus provides utility functions to deal with prometheus endpoints

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric added in v0.75.0

type Metric map[string]string

Metric is a set of labels for a sample.

type MetricFamily

type MetricFamily struct {
	Name    string
	Type    string
	Samples []Sample
}

MetricFamily represents a metric family that is returned by a prometheus endpoint.

func ParseMetrics

func ParseMetrics(data []byte) ([]MetricFamily, error)

ParseMetrics parses prometheus-formatted metrics from the input data.

func ParseMetricsWithFilter

func ParseMetricsWithFilter(data []byte, filter []string) ([]MetricFamily, error)

ParseMetricsWithFilter parses prometheus-formatted metrics from the input data, ignoring lines which contain text that matches the passed in filter.

type Sample added in v0.75.0

type Sample struct {
	Metric    Metric
	Value     float64
	Timestamp int64 // milliseconds since epoch, 0 if not set
}

Sample represents a single metric data point.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL