fix: VectorSinkFailing alert never fires for sinks with transport-only or 5xx-only failures - #269
Merged
Conversation
…y or 5xx-only failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The VectorSinkFailing expression adds two independent aggregations: transport failures from vector_http_client_errors_total and error responses from vector_http_client_responses_total{status=~"5..|429"}. Vector registers counters lazily, so a sink that fails only at the transport level (connection refused, DNS, timeout) has no responses series for the 5xx matcher, and a sink that only receives 5xx/429 has no errors series. In PromQL, adding a vector to an empty vector produces an empty result, so in both cases the sink drops out of the expression and the alert never fires, even at a 100% failure rate. A dead endpoint that refuses connections is exactly the transport-only case.
The fix pads each addend with
or 0 * sum by (pod, component_id) (rate(vector_http_client_requests_sent_total[...])), so both sides of the addition always carry the full set of (pod, component_id) present in the denominator. A failing sink now yields its true failure ratio, a healthy sink yields 0, and an idle sink evaluates to 0/0 = NaN and is filtered by the threshold.