Documentation ¶
Index ¶
- Constants
- func MatcherToString(matchers []*labels.Matcher) (string, error)
- func MergeSampleStream(antiAffinityBuffer model.Time, a, b *model.SampleStream) (*model.SampleStream, error)
- func MergeValues(antiAffinityBuffer model.Time, a, b model.Value) (model.Value, error)
- func ValueAddLabelSet(a model.Value, l model.LabelSet) error
- func WarningsConvert(ws api.Warnings) storage.Warnings
- type ErrorType
- type Status
- type WarningSet
Constants ¶
const ( ErrorNone ErrorType = "" ErrorTimeout = "timeout" ErrorCanceled = "canceled" ErrorExec = "execution" ErrorBadData = "bad_data" ErrorInternal = "internal" )
Variables ¶
This section is empty.
Functions ¶
func MatcherToString ¶
MatcherToString converts a []*labels.Matcher into the actual matcher you would see on the wire (such as `metricname{label="value"}`)
func MergeSampleStream ¶
func MergeSampleStream(antiAffinityBuffer model.Time, a, b *model.SampleStream) (*model.SampleStream, error)
MergeSampleStream merges SampleStreams `a` and `b` with the given antiAffinityBuffer When combining series from 2 different prometheus hosts we can run into some problems with clock skew (from a variety of sources). The primary one I've run into is issues with the time that prometheus stores. Since the time associated with the datapoint is the *start* time of the scrape, there can be quite a lot of time (which can vary dramatically between hosts) for the exporter to return. In an attempt to mitigate this problem we're going to *not* merge any datapoint within antiAffinityBuffer of another point we have. This means we can tolerate antiAffinityBuffer/2 on either side (which can be used by either clock skew or from this scrape skew).
func MergeValues ¶
MergeValues merges values `a` and `b` with the given antiAffinityBuffer TODO: always make copies? Now we sometimes return one, or make a copy, or do nothing
func ValueAddLabelSet ¶
ValueAddLabelSet adds the labelset `l` to the value `a`
Types ¶
type Status ¶
type Status string
TODO: have the api.go thing export these attempted once already -- https://github.com/prometheus/prometheus/pull/3615
const ( StatusSuccess Status = "success" StatusError = "error" )
type WarningSet ¶
type WarningSet map[string]struct{}
WarningSet simply contains a set of warnings
func (WarningSet) AddWarning ¶
func (s WarningSet) AddWarning(w string)
AddWarning will add a given warning to the set
func (WarningSet) AddWarnings ¶
func (s WarningSet) AddWarnings(ws api.Warnings)
AddWarnings will add all warnings to the set
func (WarningSet) Warnings ¶
func (s WarningSet) Warnings() api.Warnings
Warnings returns all of the warnings contained in the set