prometheus

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package prometheus provides Prometheus format support for metrics.

Index

Constants

View Source
const (
	TypeCounter = "counter"
	TypeGauge   = "gauge"
)

Metric types

Variables

This section is empty.

Functions

func Format added in v0.4.0

func Format(metrics []Metric) string

Format takes multiple metrics and returns them formatted in Prometheus exposition format.

Types

type Metric

type Metric struct {
	Comment string
	Name    string
	Help    string
	Type    string
	Samples []Sample
}

Metric represents a single Prometheus metric with its metadata.

func (Metric) String

func (m Metric) String() string

String formats the metric in Prometheus exposition format.

type Sample added in v0.4.0

type Sample struct {
	Name   string
	Labels map[string]string
	Value  float64
}

Sample represents a single sample of a Prometheus metric.

Jump to

Keyboard shortcuts

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