prometheus

package
v0.0.0-...-e9e9a26 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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 MetricFamily

type MetricFamily struct {
	Name    string
	Type    string
	Samples model.Vector
}

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 Reader

type Reader struct {
	// contains filtered or unexported fields
}

A Reader implements the io.Reader interfaces by reading from a byte slice. Unlike a Buffer, a Reader is read-only and supports seeking. The zero value for Reader operates like a Reader of an empty slice.

func NewReader

func NewReader(b []byte, filters []string) *Reader

NewReader returns a new Reader reading from b.

func (*Reader) Read

func (r *Reader) Read(b []byte) (n int, err error)

Read implements the io.Reader interface.

Jump to

Keyboard shortcuts

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