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

# Functions

EscapeMetricFamily escapes the given metric names and labels with the given escaping scheme.
EscapeName escapes the incoming name according to the provided escaping scheme.
FingerprintFromString transforms a string representation into a Fingerprint.
IsValidLegacyMetricName is similar to IsValidMetricName but always uses the legacy validation scheme regardless of the value of NameValidationScheme.
IsValidMetricName returns true iff name matches the pattern of MetricNameRE for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is selected.
LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a given label set.
Now returns the current time as a Time.
ParseDuration parses a string into a time.Duration, assuming that a year always has 365d, a week always has 7d, and a day always has 24h.
ParseFingerprint parses the input string into a fingerprint.
SignatureForLabels works like LabelsToSignature but takes a Metric as parameter (rather than a label map) and only includes the labels with the specified LabelNames into the signature calculation.
SignatureWithoutLabels works like LabelsToSignature but takes a Metric as parameter (rather than a label map) and excludes the labels with any of the specified LabelNames from the signature calculation.
TimeFromUnix returns the Time equivalent to the Unix Time t provided in seconds.
TimeFromUnixNano returns the Time equivalent to the Unix Time t provided in nanoseconds.
No description provided by the author
UnescapeName unescapes the incoming name according to the provided escaping scheme if possible.

# Constants

AddressLabel is the name of the label that holds the address of a scrape target.
No description provided by the author
AlertNameLabel is the name of the label containing the an alert's name.
No description provided by the author
No escaping required.
BucketLabel is used for the label that defines the upper bound of a bucket of a histogram ("le" -> "less or equal").
DotsEscaping is similar to UnderscoreEscaping, except that dots are converted to `_dot_` and pre-existing underscores are converted to `__`.
Earliest is the earliest Time representable.
No description provided by the author
No description provided by the author
No description provided by the author
EscapingKey is the key in an Accept or Content-Type header that defines how metric and label names that do not conform to the legacy character requirements should be escaped when being scraped by a legacy prometheus system.
ExportedLabelPrefix is the prefix to prepend to the label names present in exported metrics if a label of the same name is added by the server.
InstanceLabel is the label name used for the instance label.
JobLabel is the label name indicating the job from which a timeseries was scraped.
Latest is the latest Time representable.
LegacyValidation is a setting that requirets that metric and label names conform to the original Prometheus character requirements described by MetricNameRE and LabelNameRE.
MetaLabelPrefix is a prefix for labels that provide meta information.
MetricNameLabel is the label name indicating the metric name of a timeseries.
MetricsPathLabel is the name of the label that holds the path on which to scrape a target.
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
No description provided by the author
No description provided by the author
NoEscaping indicates that a name will not be escaped.
ParamLabelPrefix is a prefix for labels that provide URL parameters used to scrape a target.
QuantileLabel is used for the label that defines the quantile in a summary.
ReservedLabelPrefix is a prefix which is not legal in user-supplied label names.
SchemeLabel is the name of the label that holds the scheme on which to scrape a target.
ScrapeIntervalLabel is the name of the label that holds the scrape interval used to scrape a target.
ScrapeTimeoutLabel is the name of the label that holds the scrape timeout used to scrape a target.
SeparatorByte is a byte that cannot occur in valid UTF-8 sequences and is used to separate label names, label values, and other strings from each other when calculating their combined hash value (aka signature aka fingerprint).
TmpLabelPrefix is a prefix for temporary labels as part of relabelling.
UnderscoreEscaping replaces all legacy-invalid characters with underscores.
UTF8Validation only requires that metric and label names be valid UTF-8 strings.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ValueEncodingEscaping prepends the name with `U__` and replaces all invalid characters with the unicode value, surrounded by underscores.
No description provided by the author

# Variables

LabelNameRE is a regular expression matching valid label names.
MetricNameRE is a regular expression matching valid metric names.
NameEscapingScheme defines the default way that names will be escaped when presented to systems that do not support UTF-8 names.
NameValidationScheme determines the method of name validation to be used by all calls to IsValidMetricName() and LabelName IsValid().
ZeroSample is the pseudo zero-value of Sample used to signal a non-existing sample.
ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a non-existing sample pair.

# Structs

Alert is a generic representation of an alert in the Prometheus eco-system.
No description provided by the author
Interval describes an interval between two timestamps.
LabelPair pairs a name with a value.
Matcher describes a matches the value of a given label.
Sample is a sample pair associated with a metric.
No description provided by the author
No description provided by the author
SamplePair pairs a SampleValue with a Timestamp.
SampleStream is a stream of Values belonging to an attached COWMetric.
Scalar is a scalar value evaluated at the set timestamp.
Silence defines the representation of a silence definition in the Prometheus eco-system.
String is a string value evaluated at the set timestamp.

# Interfaces

Value is a generic interface for values resulting from a query evaluation.

# Type aliases

Alert is a list of alerts that can be sorted in chronological order.
No description provided by the author
Duration wraps time.Duration.
No description provided by the author
Fingerprint provides a hash-capable representation of a Metric.
Fingerprints represents a collection of Fingerprint subject to a given natural sorting scheme.
FingerprintSet is a set of Fingerprints.
No description provided by the author
No description provided by the author
A LabelName is a key for a LabelSet or Metric.
LabelNames is a sortable LabelName slice.
LabelPairs is a sortable slice of LabelPair pointers.
A LabelSet is a collection of LabelName and LabelValue pairs.
A LabelValue is an associated value for a LabelName.
LabelValues is a sortable LabelValue slice.
Matrix is a list of time series.
A Metric is similar to a LabelSet, but the key difference is that a Metric is a singleton and refers to one and only one stream of samples.
MetricType represents metric type values.
Samples is a sortable Sample slice.
A SampleValue is a representation of a value for a given sample at a given time.
Time is the number of milliseconds since the epoch (1970-01-01 00:00 UTC) excluding leap seconds.
ValidationScheme is a Go enum for determining how metric and label names will be validated by this library.
No description provided by the author
Vector is basically only an alias for Samples, but the contract is that in a Vector, all Samples have the same timestamp.