package
0.34.7
Repository: https://github.com/m3db/prometheus_common.git
Documentation: pkg.go.dev

# Functions

FingerprintFromString transforms a string representation into a Fingerprint.
IsValidMetricName returns true iff name matches the pattern of MetricNameRE.
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.

# 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
BucketLabel is used for the label that defines the upper bound of a bucket of a histogram ("le" -> "less or equal").
Earliest is the earliest Time representable.
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.
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.
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.
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

# Variables

LabelNameRE is a regular expression matching valid label names.
MetricNameRE is a regular expression matching valid metric names.
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.
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.
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.
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.
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.
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.
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.