Documentation
¶
Index ¶
- func AreIdenticalSeriesFast(s1, s2 string) bool
- func GetRowsDiff(s1, s2 string) string
- func MustParsePromMetrics(s string, offsetMsecs int64) []prompb.TimeSeries
- func UnmarshalWithMetadata(dstRows Rows, dstMeta MetadataRows, s string, errLogger func(s string)) (Rows, MetadataRows)
- type Metadata
- type MetadataRows
- type Row
- type Rows
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreIdenticalSeriesFast ¶ added in v1.66.0
AreIdenticalSeriesFast returns true if s1 and s2 contains identical Prometheus series with possible different values.
This function is optimized for speed.
func GetRowsDiff ¶ added in v1.66.0
GetRowsDiff returns rows from s1, which are missing in s2.
The returned rows have default value 0 and have no timestamps.
func MustParsePromMetrics ¶ added in v1.102.15
func MustParsePromMetrics(s string, offsetMsecs int64) []prompb.TimeSeries
MustParsePromMetrics parses metrics in Prometheus text exposition format from s and returns them.
Metrics must be delimited with newlines.
offsetMsecs is added to every timestamp in parsed metrics.
This function is for testing purposes only. Do not use it in non-test code.
func UnmarshalWithMetadata ¶ added in v1.110.16
func UnmarshalWithMetadata(dstRows Rows, dstMeta MetadataRows, s string, errLogger func(s string)) (Rows, MetadataRows)
UnmarshalWithMetadata unmarshals Prometheus exposition text into dstRows and dstMeta. See https://github.com/prometheus/docs/blob/e39897e4ee6e67d49d47204a34d120e3314e82f9/docs/instrumenting/exposition_formats.md#comments-help-text-and-type-information.
s shouldn't be modified while dstRows and dstMeta are in use.
Types ¶
type Metadata ¶ added in v1.110.16
type Metadata struct {
Metric string
Type prompb.MetricType
Help string
}
Metadata contains HELP or TYPE message in prometheus exposition format. See https://github.com/prometheus/docs/blob/e39897e4ee6e67d49d47204a34d120e3314e82f9/docs/instrumenting/exposition_formats.md#comments-help-text-and-type-information.
For example: # HELP alertmanager_alerts How many alerts by state. # TYPE alertmanager_alerts gauge
type MetadataRows ¶ added in v1.110.16
type MetadataRows struct {
Rows []Metadata
}
MetadataRows contains parsed Prometheus metadata rows.
type Rows ¶
type Rows struct {
Rows []Row
// contains filtered or unexported fields
}
Rows contains parsed Prometheus rows.
func (*Rows) UnmarshalWithErrLogger ¶ added in v1.34.0
UnmarshalWithErrLogger unmarshals only samples from Prometheus exposition text.
s shouldn't be modified while rs is in use.