Expand description
Vectorโvector binary and set operations over evaluated series on one grid.
Semantics follow Prometheus VectorBinop, VectorAnd, VectorOr and VectorUnless
evaluated at every grid point. Series are processed whole, over their own grid ranges, and
the cardinality rules are checked per point: series sharing a match group only conflict at
points where both are present. Each field is matched on its own, as if the operands held
only that field; the results of all fields with one label set form one series.
Structsยง
- Binary
Matching - A vectorโvector binary operation with its modifiers.
- Budget ๐
- The live workspace a binary, set or
infooperation admits as it allocates, at three granularities. - Duplicate ๐
- Two rows of one result label set at one point.
- Duplicate
Candidate - The best duplicate candidate retained for one grid point.
- Duplicate
Evidence - A per-node, per-field reduction of duplicate evidence across output partitions.
- Duplicate
Slot ๐ - Field
Evidence ๐ - Field
Metadata ๐ - The figures one fieldโs phases are charged from, read once from its operands.
- Fill
Values - The values of
fill,fill_leftandfill_right, which stand in for a sample that has no match on the other side:lhsfor a missing left-hand sample andrhsfor a missing right-hand one, as the query writes them,group_rightincluded (prometheus/prometheus#19939). - Node
Evidence ๐ binary_vectors, handing the live workspace it holds toreserveas it allocates.- Operand ๐
- One field of one sideโs series, with verified grid axes.
- Pairs ๐
- The matched pairs of one field and the state Prometheus checks them against.
- Result
Rows ๐ - Rows in arrival order: their points, the match group each came from, and their values;
Noneis a match the operator filtered. - Result
Totals ๐ - The rows filed, the rows holding a value, the rows holding a histogram and the heap those histograms hold: counted as each row is filed, so neither later phase walks them again.
- Results ๐
- The result rows of one field by result label set.
- SetField
Metadata ๐ - The figures one set fieldโs phases are charged from, read once from its operands.
Enumsยง
- Binary
Kind - What a
BinaryOpcomputes: arithmetic over two values or a comparison of them. - Binary
Op - A PromQL binary operator between two instant vectors.
- Cardinality
- How many series of each side may share a match group.
- Matching
Labels - The labels two series are matched by.
- RowSlot ๐
- One pairingโs result row, opened by the first point the pairing files.
- SetOp
- A PromQL set operator between two instant vectors.
Constantsยง
- ERROR_
TEXT_ ๐BYTES - The fixed text of one error message, around the label set it renders.
- GROUP_
SLOT_ ๐BYTES - One entry of a match-group table, with the control byte and spare capacity it keeps.
- HISTOGRAM_
ROW_ ๐BYTES - One row of the builderโs histogram table: the scalar columns and the seven list offsets.
- KEY_
LABEL_ ๐BYTES - One label of a match key, charged twice because
group_keygrows itsVecby doubling. - MATCHING_
NAME_ ๐BYTES - One name of
MatchingLabels, whichresult_metriccollects into a reference vector. The vector is collected from an exact-size iterator, so its buffer holds one&strper name. - MATCH_
SLOT_ ๐BYTES - One entry of the one-to-one match set, charged the same way.
- MERGE_
SLOT_ ๐BYTES - One row of the mergeโs table, charged the same way.
- RESULT_
ROW_ ๐BYTES - One row of a fieldโs results: its point, its match group and its value. The three vectors grow together, so one slot of each is what a row takes, and a block of the vectors is charged a rowโs bytes per slot it grew by.
- RESULT_
SLOT_ ๐BYTES - One entry of a fieldโs result table, charged the same way.
- SORT_
ROW_ ๐BYTES - One row while a label set is sorted: the old and the new copy of its point, group and value vectors, and the row order the sort reads. The sort copies a label setโs rows when they are not already in order, so this is what one row costs while it runs.
- VEC_
MIN_ ๐CAPACITY - The capacity a fresh
Vecholds: a first push allocates four entries, and a full one doubles.
Functionsยง
- binary_
field ๐ - Matches one field of each side, collecting the first failure of each kind as
(point, rank, message). - binary_
output_ schema - The schema of
binary_vectorsoutput: fields paired by position, named after the left side. - binary_
vectors - Applies
matchingto every pair of matched series at every grid point. - binary_
vectors_ ๐inner - The one binary kernel: one walk, one lookup and one error order, whether or not a caller
accounts for the workspace. Every figure is reserved only when
budgetis held. - binary_
vectors_ ๐with_ reservation - candidate_
owned_ ๐bytes - copied_
bytes ๐ - The label text
result_metriccopies from the one side: the value of every included label it sets, and the name of a label it inserts, sinceSeriesLabels::setcopies that as well. - duplicate_
message ๐ - earliest_
error ๐ - elem_
binop ๐ - Prometheus
vectorElemBinopover present samples: the value and whether to keep it, orNonewhen Prometheus reports the pair as an annotation and skips it without counting the match: an operator the sample types do not support, or an addition or subtraction of histograms that mix exponential and custom buckets or whose counter reset hints contradict. - field_
metadata_ ๐bytes - The figures one fieldโs phases are charged from.
- group ๐
- Groups the series of
operandby their match group. - group_
key ๐ - group_
presence ๐ - The points at which each match group of
operandholds a sample, one bit per grid point. - histogram_
phase_ ๐bytes - The bytes one row of a histogram operator holds at its peak, read once from the widest histogram
of each side of a field: an owned copy of each operand, the union
+and-grow into โ both sidesโ buckets, charged twice because the union reallocates while the old buffer is alive โ the custom bounds the wider side copies, and the value the operator boxes. A phase figure, not one per row: a row that pairs two histograms is bounded by the widest of each side. - key_of ๐
- label_
text_ ๐bytes - The bytes
renderwrites for a label set built frommetric: each label asname="value", the braces and separators between them, and the metricโs name. - match_
key_ ๐bytes - The bytes one match key holds: its label pairs and, for
on(...), a copy of each value. - merge_
bytes ๐ - The bytes the merge of every fieldโs results and the builder writing them out allocate.
- merge_
fields ๐ - Joins the per-field results into series with all fields, by label set.
- merge_
multi_ ๐field - The merge of every fieldโs results into one series per label set: the
(point, field, value)triples of a label set, sorted and filled into a row the builder writes one value per point. - merge_
series_ ๐columns - The bytes one result seriesโ columns take, read from the triples the multi-field merge sorts: the points they sit at, one row per point.
- merge_
series_ ๐columns_ of - The bytes one result seriesโ columns take: the rows it writes โ one per distinct point of its samples, which is what the builder writes a row for โ times a rowโs columns. The points arrive sorted, so a distinct point is a point that differs from the one before it.
- merge_
single_ ๐field - The one-field shapeโs merge: the label setโs rows written out as they are read.
- metric_
of ๐ - The labels Prometheus gives a fill sample: the match group of the sample it pairs with.
- output_
bytes ๐ - The bytes the operationโs own descriptors cost: one result table per paired field, the field list the results and the output schema each keep, and the schema struct.
- overlap ๐
- Reports every point where two or more
membersare present. - owned_
histogram_ ๐bytes - The bytes one owned copy of a histogram view holds: its scalars inline, and on the heap the buckets of both sides, the span layout of the view and its custom bounds.
- pair_
bytes ๐ - The bytes one pairing allocates before it files a row: the result label set
result_metricrewrites, thegroup_*labels it copies in, the reference vector it collects the matching label names into, and the key its rows are looked up by. - render ๐
- result_
histogram_ ๐bytes - The bytes one boxed histogram value holds: its scalars inline and the heap its buckets, bounds and span layout own.
- result_
key_ ๐bytes - The key
key_offiles a result label set under: every label with a value and the name, each charged twice for the growth of the keyโsVec, plus the name string it copies. - result_
metric ๐ - result_
set_ ๐bytes - The bytes one result label set keeps once a row is filed under it: the label list and the
copied strings
result_metricleaves behind, its key and its entry in the result table. - same_
grid ๐ - same_
labelset ๐ - set_
field ๐ - Filters one field of the kept side by the presence of its match group on the filter side, and
appends the first point where two kept rows share a label set as
(point, rank, message). - set_
field_ ๐metadata - set_
vectors - Applies a set operator at every grid point. Series keep their labels and values; fields are paired by position.
- set_
vectors_ ๐inner - The one set kernel, whether or not a caller accounts for its workspace.
- set_
vectors_ ๐with_ reservation set_vectors, handing the live workspace it holds toreserveas it allocates.- unsupported_
histogram_ ๐arithmetic - The legacy Info applies only to unsupported histogram arithmetic, not to other reasons a supported histogram operation can decline a pair (such as incompatible bucket layouts).
- validate_
binary_ ๐operand - Validates one operand of
binary_vectors: every series must sit on the schemaโs grid, carry the schemaโs fields, and hold one sample for every row its own axis places. - widest_
metric ๐ - The series of
operandwith the most labels: the widest label set one pairing of its field can build.
Type Aliasesยง
- Group
Key - Label pairs identifying a match group or a result; empty values are absent, as in Prometheus.