package
0.62.0
Repository: https://github.com/prometheus/common.git
Documentation: pkg.go.dev

# Functions

ExtractSamples builds a slice of samples from the provided metric families.
FinalizeOpenMetrics writes the final `# EOF\n` line required by OpenMetrics.
MetricFamilyToOpenMetrics converts a MetricFamily proto message into the OpenMetrics text format and writes the resulting lines to 'out'.
MetricFamilyToText converts a MetricFamily proto message into text format and writes the resulting lines to 'out'.
Negotiate returns the Content-Type based on the given Accept header.
NegotiateIncludingOpenMetrics works like Negotiate but includes FmtOpenMetrics as an option for the result.
NewDecoder returns a new decoder based on the given input format.
NewEncoder returns a new encoder based on content type negotiation.
NewFormat generates a new Format from the type provided.
NewOpenMetricsFormat generates a new OpenMetrics format matching the specified version number.
ResponseFormat extracts the correct format from a HTTP response header.
WithCreatedLines is an EncoderOption that configures the OpenMetrics encoder to include _created lines (See https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#counter-1).
WithUnit is an EncoderOption enabling a set unit to be written to the output and to be added to the metric name, if it's not there already, as a suffix.

# Constants

Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoDelim) instead.
Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoText) instead.
Deprecated: Use expfmt.NewFormat(expfmt.TypeTextPlain) instead.
The Content-Type values for the different wire protocols.
Constants to assemble the Content-Type values for the different wire protocols.
Constants to assemble the Content-Type values for the different wire protocols.
Constants to assemble the Content-Type values for the different wire protocols.
Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
Constants to assemble the Content-Type values for the different wire protocols.
Constants to assemble the Content-Type values for the different wire protocols.
Constants to assemble the Content-Type values for the different wire protocols.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

DecodeOptions contains options used by the Decoder and in sample extraction.
ParseError signals errors while parsing the simple and flat text-based exchange format.
SampleDecoder wraps a Decoder to extract samples from the metric families decoded by the wrapped Decoder.
TextParser is used to parse the simple and flat text-based exchange format.

# Interfaces

Closer is implemented by Encoders that need to be closed to finalize encoding.
Decoder types decode an input stream into metric families.
Encoder types encode metric families into an underlying wire protocol.

# Type aliases

No description provided by the author
Format specifies the HTTP content type of the different wire protocols.
FormatType is a Go enum representing the overall category for the given Format.