expfmt

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT, Apache-2.0 Imports: 7 Imported by: 0

README

The source code contained in this package is a modified version of the original work available from

https://github.com/prometheus/common/blob/v0.45.0/expfmt/text_create.go

The original work is distributed under the Apache License, Version 2.0 of which a copy is provided within this package's folder.

We also provide a copy of the original work's "NOTICE" text file here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Name        string
	Labels      []MetricLabelPair
	Value       float64
	TimestampMs int64
}

type MetricLabelPair

type MetricLabelPair struct {
	Name  string
	Value string
}

type ParseError

type ParseError struct {
	Line int
	Msg  string
}

ParseError signals errors while parsing the simple and flat text-based exchange format.

func (ParseError) Error

func (e ParseError) Error() string

Error implements the error interface.

type TextParser

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

TextParser is used to parse the simple and flat text-based exchange format. Its zero value is ready to use.

func (*TextParser) LineToMetric

func (p *TextParser) LineToMetric(line []byte) (*Metric, error)

TextToMetricFamilies reads 'in' as the simple and flat text-based exchange format and creates MetricFamily proto messages. It returns the MetricFamily proto messages in a map where the metric names are the keys, along with any error encountered.

Jump to

Keyboard shortcuts

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