Skip to main content

Error Compatibility Coverage

Generated by conformance/scripts/error_registry.py from the recorded answers of a real Loki, the error-layer gates and the registry. Do not edit by hand.

The answers are those of Grafana Loki 3.7.10, recorded over HTTP on 2026-11-18. Every comparable row is replayed against the proxy by TestLokiErrorAnswersReplay (status, Content-Type, X-Content-Type-Options and body, byte for byte), and a live Loki is asked one representative row of every route, error kind and message by TestCompat_ErrorAnswersLikeLoki on the end-to-end stack. Rows the proxy still answers differently are listed in conformance/registry/error-layer-known-differences.json; that list may only shrink, and the replay test holds it equal to what the proxy really answers, which is what makes the percentages below measured and not declared.

Scores​

ScoreValueMeaning
Errors that match Loki97.2% (241/248)recorded Loki answers the proxy reproduces exactly, of the rows that can be compared
Matrix coverage58.9% (73/124)route x error kind cells with a recorded or documented Loki answer, a unit gate and an end-to-end comparison
Cells that match101/124cells where every comparable row matches and no known leak remains
Messages recorded36/48typed Loki messages (internal/lokierr) with at least one recorded answer; the rest have a documented reason

141 recorded rows are not comparable (the recorded Loki ran with authentication disabled, or its answer depends on its own configuration) and are replayed but not counted.

Matrix​

Each cell shows whether the proxy matches (match or differs), the matching and comparable recorded rows, and the checks that cover it: U the proxy unit replay or error-layer gate, E the end-to-end comparison with Loki. gate means the answer is Loki's documented one for a failure that cannot be recorded for one request, held by the error-layer gate.

RouteParametersLogQL syntaxLogQL validationLimitsBackend failureMethods and routingTenantCancel and deadline
alertsmatch gate Umatch gate Ugapgapmatch gate U
detected_field_valuesmatch 4/4 UEmatch 2/2 UEmatch 2/2 UEmatch 1/1 UEmatch gate Umatch 1/1 UEgapmatch gate U
detected_fieldsmatch 7/7 UEmatch 2/2 UEmatch 2/2 UEmatch 1/1 UEmatch gate Umatch 5/5 UEgapmatch gate U
detected_labelsmatch 1/1 UEmatch 1/1 UEmatch 3/3 UEmatch 1/1 UEmatch gate Umatch 5/5 UEgapmatch gate U
format_querygapmatch 2/2 UEmatch 5/5 UE
index_statsmatch 3/3 UEmatch 2/2 UEmatch 2/2 UEmatch 1/1 UEmatch gate Umatch 5/5 UEgapmatch gate U
index_volumematch 6/6 UEmatch 2/2 UEmatch 2/2 UEmatch 1/1 UEmatch gate Umatch 5/5 UEgapmatch gate U
index_volume_rangematch 9/9 UEmatch 2/2 UEmatch 2/2 UEmatch gate UEmatch gate Umatch 1/1 UEgapmatch gate U
label_valuesmatch 4/4 UEmatch 1/1 UEmatch 3/3 UEmatch 1/1 UEmatch gate Umatch 2/2 UEnot comparable (6)match gate U
labelsmatch 4/4 UEmatch 1/1 UEmatch 3/3 UEmatch 1/1 UEmatch gate UEmatch 5/5 UEnot comparable (20)match gate UE
patternsmatch 5/5 UEmatch 2/2 UEmatch 5/5 UEmatch gate Umatch gate Umatch 5/5 UEgapmatch gate U
querymatch 4/4 UEmatch 2/2 UEmatch 8/8 UEmatch gate Umatch gate Umatch 5/5 UEnot comparable (6)match gate U
query_rangematch 16/16 UEmatch 2/2 UEdiffers 10/11 UEmatch gate UEmatch gate UEmatch 5/5 UEnot comparable (20)match gate UE
rulesmatch gate Umatch gate Ugapgapmatch gate U
seriesmatch 2/2 UEmatch 2/2 UEmatch 1/1 UEmatch 1/1 UEmatch gate Umatch 5/5 UEnot comparable (6)match gate U
tailmatch 4/4 UEmatch 2/2 UEmatch 1/1 UEmatch gate Umatch gate Umatch 5/5 UEgapmatch gate U
tail_upgradematch 4/4 UEmatch 2/2 UEgapdiffers 1/2 UEnot comparable (2)
other routes (rules views, push, delete, shards, exemplars, aliases)differs 6/11 UE
unknown pathsmatch 23/23 UE

Error kinds:

  • Parameters: A request parameter, URL or form body Loki cannot read or does not accept (start, end, since, step, limit, direction, interval, delay_for, aggregateBy, URL escapes, oversize bodies).
  • LogQL syntax: A query Loki cannot parse: empty, unterminated, bad tokens.
  • LogQL validation: A query that parses but Loki rejects while checking it: matcher rules, stage compile errors, wrong query type for the route, aggregation and function rules.
  • Limits: A request over a limit Loki enforces: query length, lookback, series, resolution.
  • Backend failure: The storage behind the proxy fails or answers something the proxy cannot use: Loki answers 500, or its queue-full 429, in its own words.
  • Methods and routing: A path Loki's router does not know, a method a route does not serve, a tail request that is no websocket upgrade.
  • Tenant: A tenant header Loki or the proxy rejects.
  • Cancel and deadline: The client goes away (499) or the request runs out of time (504).

Order of Loki's checks​

  1. request decoding: The URL and form body are decoded first. Messages: post-too-large, url-escape, url-semicolon.
  2. parameters: Parameters are read next, in the order end, start, limit, step and direction; an end not after the start and the 11,000-point resolution check come before the query is parsed. Messages: aggregate-by, delay-for, delete-end-in-future, delete-max-interval-invalid, delete-max-interval-too-long, delete-query-invalid, delete-query-not-set, delete-start-not-before-end, delete-start-not-set, delete-time-invalid, direction, end-before-start, interval-negative, limit-not-positive, number, param-duration, param-number, step-duration, step-not-positive, step-overflow, step-too-many-points.
  3. logql syntax: The query text is parsed; a syntax error is answered before the query-length limit on query_range, and on tail before the parameters. Messages: parse, parse-input-size.
  4. limits: The query-length limit follows the syntax check on query_range and comes before it on the metadata routes. Messages: limit-lookback, limit-plan-time, limit-query-complexity, limit-query-length.
  5. logql validation: Checks of a query that parsed (stage compilation, matcher rules, query type) come last. Messages: instant-log-query, only-label-matchers, only-log-selector.

The order was observed by sending 33 requests that carry two errors each to a real Loki (internal/lokierr/testdata/loki_check_order.jsonl) and is held in each message item.

Messages​

MessageStatusKindRecorded rowsMatchStateUnitEnd to end
msg-aggregate-by400param22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-backend-failed500backend_failed0-documentedTestErrorLayer_NoVictoriaLogsLeak-
msg-canceled499canceled0-documentedTestErrorLayer_NoVictoriaLogsLeak, TestErrorLayer_WindowRetryCancelDeadline-
msg-deadline504deadline0-documentedTestErrorLayer_NoVictoriaLogsLeak, TestErrorLayer_WindowRetryCancelDeadline-
msg-delay-for400param22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-delete-end-in-future400param1-recorded-not-comparable--
msg-delete-max-interval-invalid400param8-recorded-not-comparable--
msg-delete-max-interval-too-long400param1-recorded-not-comparable--
msg-delete-query-invalid400param4-recorded-not-comparable--
msg-delete-query-not-set400param2-recorded-not-comparable--
msg-delete-request-not-found404route4-recorded-not-comparable--
msg-delete-start-not-before-end400param9-recorded-not-comparable--
msg-delete-start-not-set400param1-recorded-not-comparable--
msg-delete-time-invalid400param15-recorded-not-comparable--
msg-direction400param22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-end-before-start400param55/5matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-instant-log-query400param82/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-internal500internal0-documentedTestErrorLayer_NoVictoriaLogsLeak-
msg-interval-negative400param11/1matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-limit-index-series500limit1-recorded-not-comparable--
msg-limit-lookback400limit3-recorded-not-comparable--
msg-limit-not-positive400param88/8matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-limit-plan-time400limit0-documentedTestPlanBudgetStopsValidationAndStoresNothing, TestPlanBudgetStopsTheLowering, TestPlanBudgetBeforeTheFirstBackendCall, TestPlanBudgetTripIsNotHeldAfterTheFlight-
msg-limit-query-complexity400limit0-documentedTestQueryComplexityLimitsRejectOnlyWhenLowered, TestQueryComplexityDerivedDefaultsNeverTrip-
msg-limit-query-length400limit98/8matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-limit-reached400limit0-documentedTestLimitAnswersAreLokisTextAndLogTheFlag, TestErrorLayer_NoVictoriaLogsLeak-
msg-limit-response-size500limit0-documentedTestLimitAnswersAreLokisTextAndLogTheFlag, TestErrorLayer_NoVictoriaLogsLeak-
msg-limit-series400limit0-documentedTestErrorLayer_LokiLimitTexts-
msg-method-not-allowed405route6261/61matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-no-org-id401route0-documentedTestTenantAuth_AnswersLikeLoki, TestDeleteAuth_TokenGatesTheHandler-
msg-not-found404route2121/21matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-number400param88/8matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-only-label-matchers400param1111/11matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-only-log-selector400param22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-param-duration400param99/9matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-param-number400param1414/14matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-parse400parse6158/61differsTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-parse-input-size400parse11/1matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-post-too-large400form11/1matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-queue-full429queue_full0-documentedTestErrorLayer_NoVictoriaLogsLeak-
msg-step-duration400param44/4matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-step-not-positive400param44/4matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-step-overflow400param11/1matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-step-too-many-points400param33/3matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-tail-not-websocket400route22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
unmapped-evaluator-unexpected-expr500unmapped10/1differsTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
unmapped-index-shards-target-bytes400unmapped10/1differsTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
unmapped-path-cleaning-redirect301unmapped77/7matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
unmapped-push-snappy-corrupt400unmapped10/1differsTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
unmapped-ruler-local-store400unmapped4-recorded-not-comparable--
unmapped-shard-aggregations-disabled500unmapped1-recorded-not-comparable--
unmapped-upgrade-required426unmapped10/1differsTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-url-escape400form22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-url-semicolon400form22/2matchesTestLokiErrorAnswersReplayTestCompat_ErrorAnswersLikeLoki
msg-write-not-supported405route0-documentedTestLokiPushRoute-

A message with no recorded row carries the reason in its registry item (conformance/registry/loki/errors/).

Ratchets​

  • error-layer-known-differences.json: the rows that still differ; its ceiling may only fall.
  • error-layer-known-leaks.json: the backend-failure cells that still leak; its ceiling may only fall.
  • conformance/registry/baseline.json: the two scores above may not drop, and scripts/ci/check_conformance.py fails when a message has no item, an item has neither a recorded answer nor a documented reason, or a matrix cell loses a check it had on the base branch. A re-recording that adds rows can lower a percentage without any regression: the recorder (test/errorrecord) only rewrites answers of existing rows.
  • The pull request quality report shows both scores for the base and the pull request and fails on a drop.

Regenerating​

python3 conformance/scripts/error_registry.py # items, matrix, scores and this page
LVP_LOKI_ERROR_ANSWERS_UPDATE=1 go test ./internal/proxy -run TestLokiErrorAnswersReplay # after a proxy change, the known differences
go run ./test/errorrecord -loki http://localhost:13101 # re-record Loki's answers from a running stack