Skip to main content

Module metrics

Module metrics 

Source
Expand description

Per-node metric handles for native PromQL execution and their DataFusion registration.

Node metrics retain no names or tree topology: NodeMetrics::register names the handles for one registration, and the set holds them from there. What outlives an execution is therefore its counters and gauges, not the nodes that recorded them.

The name carries the nodeโ€™s position in the runtime tree: the whole native tree registers into the one [ExecutionPlanMetricsSet] the enclosing physical operator (FusedSeriesExec) owns, and the reader aggregates by name, so two nodes of a kind sharing a name would be summed into a single figure. What a consumer can rely on is the grammar native.<path>.<metric> with the suffixes of NodeMetric::ALL: splitting off the final component leaves the metric, and the path before it keys the node within that operator. That key is promised only inside the topology that produced it:

  • the path names a node of one runtime topology;
  • queries, plan rewrites, and versions move it, so it is neither a persisted nor a public identifier;
  • peak_reserved_bytes alone carries p<partition>, because the reader sums gauges by name and a sum of peaks is not a peak.

Structsยง

NodeMetric
The metric names one node reports.
NodeMetrics
The metric handles one node updates as it runs.
NodeMetricsSnapshot
The figures every node of one execution left, keyed by the path it was registered under.

Constantsยง

NATIVE_PREFIX ๐Ÿ”’
The reserved first segment of every native metric name.

Functionsยง

is_node_metric
Whether name is a figure a node of a native tree reports, rather than one of an operator.
named ๐Ÿ”’
The full metric name for metric reported by the node called name.
node_metric_order ๐Ÿ”’
Where metric sits in the declared order, so a nodeโ€™s figures read the same on every node and on every run.
partitioned ๐Ÿ”’
The full metric name for metric in partition of the node called name.
split_name ๐Ÿ”’
Splits a registered metric name into the node path and the figure it reports.