In this article
Inspect ratio operands and PromQL matching keys before dividing; unmatched series, duplicate keys and a zero denominator are different conditions.
An availability ratio disappears for one model even though both request counters are visible separately. Ordinary PromQL vector division matches series by labels; it does not divide arbitrary rows that happen to appear beside each other. Inspect the operands and matching contract before interpreting the missing result as zero traffic or perfect service.
Inspect each operand independently
Evaluate the numerator and denominator at the same instant and retain their label sets. A numerator grouped by model and outcome differs from a denominator grouped only by model. Both can contain valid values while failing the intended one-to-one match. Do not diagnose the combined expression from a graph legend that hides labels present in the actual vectors.
Read the matching keys
The on modifier selects matching label names, while ignoring excludes specified names from comparison. Choose the contract that reflects the population being divided. Leaving a site or service boundary out can combine unrelated populations. A convenient match is not necessarily a meaningful ratio, so label selection must follow the event-accounting definition rather than merely produce a nonempty panel.
Establish cardinality explicitly
Many-to-one or one-to-many arithmetic requires an applicable grouping modifier and a uniquely identifiable side. A duplicated denominator can make the operation ambiguous. Inspect whether an aggregation removed the intended dimension and whether each matching key has the expected number of series. Adding group modifiers blindly can hide the design mistake or still fail uniqueness requirements without repairing the measurement population.
Separate missing from numeric zero
Without an explicitly applicable fill behavior, an unmatched series does not automatically become a zero-valued ratio. A matched denominator whose value is zero is also a different arithmetic situation from an absent denominator. Preserve those distinctions in the report. Explicit fill features in a current deployment need their own reviewed semantics; they do not justify silently treating unavailable observations as successful requests.
Verify the join with fixtures
Use offline expression fixtures containing a normal match, an extra outcome label, a missing model and duplicate denominator keys. Assert the intended output labels as well as values. This verifies how the ratio is constructed, not the service’s reliability objective. Keep the event definition and query time beside the repaired expression so that a visible line remains tied to the population it actually measures.
Primary references
PromQL Binary Operators and Vector Matching.
PromQL Evaluation Timestamps and Selectors.
Related reading: Rate metrics jump after restart: counter resets and rate before sum; Inference SLO burn rates: multi-window alerting.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.