Skip to main content

Logs Drilldown Compatibility

This track measures compatibility with the Grafana Logs Drilldown app, not generic Loki clients.

Scope​

  • Grafana datasource resource endpoints consumed by the app
  • Service selection, service-detail log volume, fields, labels, and field values
  • Log frame expectations that affect labels, level coloring, and field visibility

CI And Score​

  • Workflow: compat-drilldown.yaml
  • Score test: TestDrilldownTrackScore
  • Runtime coverage: pinned Grafana runtime plus current-family and previous-family Grafana smoke on PRs, with the fuller Grafana matrix kept for scheduled/manual runs
  • Version matrix: source-contract checks across the current Drilldown family and one family behind

The Drilldown matrix is also a moving window. We support the current app family and one family behind, with the contract list sliding forward as upstream releases move. We do not keep an open-ended tail of older app families.

Version Matrix​

Grafana runtime profiles​

Grafana versionCoverage pathVersion-specific focus
13.3.1PR/main pinned runtime + scheduled/manual runtime matrixFull Drilldown runtime score; current pinned build; runs Drilldown 3.2.0 (needs Grafana >= 13.2.0); six security fixes over 13.3.0
13.3.0Datasource contract matrixPrevious pinned build; React 19; ran Drilldown 3.1.0; Explore keeps the auto-run from the URL on Cancel (loading), also on Loki direct, see Grafana datasource compatibility
12.4.14PR/main previous-family smoke + scheduled/manual runtime matrixdatasource catalog, base Drilldown resource contracts, explicit 2.x runtime-family assertions
12.4.1Scheduled and manual runtime matrixdatasource catalog, base Drilldown resource contracts
11.6.6Scheduled and manual runtime matrixdatasource catalog, base Drilldown resource contracts, explicit 1.x runtime-family assertions

Logs Drilldown app versions​

Logs Drilldown versionCoverage pathVersion-specific focus
3.2.0PR/main pinned runtime + scheduled/manual contract matrixCurrent pinned contract; requires Grafana >= 13.2.0; same Loki HTTP calls as 3.1.0; the landing-page volume request carries a fixed request id, so Grafana cancels the previous one when the data source or time range changes (grafana/logs-drilldown#2177); filter toggles carry aria-pressed (#2182)
3.1.0Scheduled and manual contract matrixPrevious pinned contract; requires Grafana >= 13.2.0; same Loki HTTP calls as 2.6.0; the logs panel footer shows the Summary: total bytes processed stat and a "Query details" drawer built from the query_range stats object; patterns tab requires patterns-autodetect as Grafana default
3.0.0Scheduled and manual contract matrixRequires Grafana >= 13.1.0; same Loki HTTP calls as 2.6.0
2.6.0PR previous-family smoke (Grafana 12.4.x, via drilldown_plugin_version) + scheduled/manual contract matrixLast release that runs on Grafana 12.x; label/field filter inputs located by placeholder; patterns tab requires patterns-autodetect as Grafana default; volume by other fields is behind the drilldown.logs.logsVolumeByField feature flag (off by default)
2.5.2Scheduled and manual contract matrixEarlier pinned contract
2.2.0–2.5.1Scheduled and manual contract matrixMixed parser expression in MIXED_FORMAT_EXPR
2.1.0–2.1.5Scheduled and manual contract matrixdetected_level coloring, service-detail panels
2.0.4Scheduled and manual contract matrixPrevious pinned contract; patterns tab requires patterns-autodetect as Grafana default
2.0.3Scheduled and manual contract matrixdetected_level coloring, service-detail panels, patterns
2.0.2Scheduled and manual contract matrixdetected_level coloring, service-detail panels
2.0.1Scheduled and manual contract matrixdetected_level coloring, service-detail panels
2.0.0Scheduled and manual contract matrixdetected_level coloring, service-detail panels
1.0.41Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.40Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.39Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.38Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.37Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.36Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.35Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing
1.0.34Scheduled and manual contract matrixService buckets, detected-fields filtering, labels field parsing

Runtime Detection And Version Coupling​

Proxy-side Drilldown detection is based on deterministic request signals:

  • X-Query-Tags: Source=grafana-lokiexplore-app identifies Drilldown-origin resource calls
  • User-Agent: Grafana/<version> provides Grafana runtime version family

Important limit:

  • exact Drilldown app semver is not emitted on the datasource HTTP request path by default

Because of that, version-specific behavior should be gated by:

  1. explicit request source tag,
  2. Grafana runtime family (12.x, 13.x),
  3. compatibility matrix contract version bands (1.0.x, 2.x), validated in CI.

Label And Field Breakdowns​

Grafana Logs Drilldown draws its label and field breakdowns with one metric range query per label or field, for example

sum(count_over_time({env="production" ,pod != ""} [5m])) by (pod)
sum by (user_id) (count_over_time({env="production"} | json user_id="[\"user_id\"]" | drop __error__, __error_details__ | user_id!="" [5m]))

with step equal to the range ($__auto). The plugin neither caps nor samples the series it receives; it sorts them. Loki answers these queries like any other: every series with exact values, and above max_query_series a partial result with the warning maximum number of series (N) reached for a single query; returning partial results for Drilldown and a 400 for every other client (Loki v3.7.7; limits/series-limit-error and limits/drilldown-partial-with-warning record the answers).

The proxy answers them the same way, from VictoriaLogs stats_query_range buckets relabelled onto Loki's evaluation timestamps (the sample at t covers (t-range, t]):

  • Every series up to the tenant's effective max_query_series (-tenant-limits → -tenant-default-limits → -max-stats-query-series → the proxy's default of 1000, Loki's is 500), with the same values Loki returns.
  • Under the limit that is one stats_query_range call, for Drilldown and every other client alike.
  • Every other client gets Loki's 400 as soon as the response holds more series than the limit.
  • A Drilldown single-field breakdown over the limit is asked again with an in() subquery that ranks the field's values in the request's time range and keeps limit + 1 of them. VictoriaLogs reads the lines twice for that call (the ranking and the buckets), but its response holds at most limit + 1 series however many values the field has; the proxy remembers the breakdown for five minutes and ranks straight away. Drilldown gets limit series and Loki's warning, chosen by -drilldown-series-limit-mode:
    • loki (the default) answers as deployed Loki does. Loki's query frontend splits the request at the multiples of split_queries_by_interval inside it (-drilldown-series-limit-split-interval, 1h; a step on a boundary starts the later split) and each split keeps the series met first in it, every one ending at the step where the series met so far in the split pass the limit. The splits are concatenated, so an answer over several hours holds up to the limit per hour, often only the first steps of each hour. VictoriaLogs ranks the values by their first line in every split in one read (sort ... partition by (_time) limit). Loki orders the series new in one step at random, so among those the kept set can differ; every kept point is Loki's. Loki's results cache can also add the cut points of earlier requests, which the proxy cannot know. An instant answer keeps the busiest series and, when its range is longer than split_instant_metric_queries_by_interval (-drilldown-series-limit-instant-split-interval, 1h), carries no warning, as deployed Loki's split instant answer does.
    • busiest ranks by line count and keeps the busiest series over the whole range. Both intervals take Loki's per-tenant names in -tenant-limits. Every response cache (the proxy's own, the served cache and its peers) keeps the answer as sent, cut included, so a repeat is the first answer. A multi-tenant answer is cut where the merged answer passes the limit in each split. A breakdown that cannot be ranked this way (the underscore label style's dotted fields, which group by both spellings) is read whole and capped the same way.
  • Drilldown breakdowns share -stats-query-range-concurrency slots; a slot is free again after -stats-query-range-inter-query-delay-ms, which does not delay the answer.
  • A response larger than -backend-max-buffered-response-bytes returns 500 naming that flag; nothing is truncated or sampled silently.

Sliding range metrics (count_over_time, rate, bytes_over_time, bytes_rate with a range different from the step, plus topk/bottomk over them) follow Loki for every client, including Drilldown-tagged requests: a step whose window (t-range, t] holds no log line is absent, not 0. Each window is summed from stats_query_range buckets of gcd(step, range) whose edges are anchored to the request start with the offset argument and shifted by one nanosecond, so a line on a window edge counts where Loki counts it. The bucket count has no budget because VictoriaLogs returns only non-empty buckets. The raw-sample evaluator answers with the same (t-range, t] boundaries when a bucket would be below 1 ms or when the stats response exceeds its byte limit.

Routing does not depend on the client: Explore, Drilldown, dashboard panels and direct API clients reach the same exact stats path. Only the answer above the series limit differs, as it does in Loki.

Failed stats_query_range calls use the same sanitized Loki error contract for Grafana and direct clients: backend failures return HTTP 500, timeouts 504, cancellations 499, queue rejections 429, and query parse failures 400. They do not become empty successful matrices. Loki's distinct series-limit partial results still carry their warnings.

Long-Range Histograms Loaded In Pieces​

For metric ranges longer than a day, Grafana's Loki datasource loads the range in pieces: Explore, dashboard panels and Logs Drilldown send one /api/ds/query request per piece, each with its own from/to, and the browser joins the pieces' frames into one chart (observed through the stack's Grafana 13.3.0 by test/e2e-ui/tests/explore-long-range-pieces.spec.ts). The last piece of a range can be shorter than one step.

What the proxy returns per piece​

The joined chart equals Loki's when every piece's answer equals Loki's answer to the same request, whatever the pieces are and however Grafana joins them. Each piece is therefore answered like Loki: the same series, samples on Loki's step grid inside the piece's start..end window (with -align-queries-with-step, the default), the same values.

One documented exception: the proxy returns an empty Loki matrix (with response header X-Proxy-Drilldown-Path: hits-leftover-suppressed) when the request is Drilldown-tagged (X-Query-Tags: Source=grafana-lokiexplore-app) and end - start < step (isQuerySplitResidual). The check runs at the query_range entry for metric expressions (range/vector aggregations, binary, opaque metric and literal expressions; log queries are never blanked) and again at the stats entry. Joined with the other pieces, that piece's one-bucket answer showed as a spike on one edge of Logs Drilldown's charts at 24h and longer; the chart now loses less than one step of width at that edge. Explore, dashboard panels and other clients get Loki's answer for that piece too.

Do Not Regress​

These invariants fail CI when broken:

  1. Drilldown label and field breakdowns hold every series up to the tenant's series limit with Loki's values, from one stats_query_range call and no /hits call; above the limit Drilldown gets the busiest series with Loki's warning and other clients get Loki's 400 (internal/proxy/drilldown_breakdown_exact_test.go).
  2. Pieces shorter than one step (end - start < step) from Drilldown-tagged requests are suppressed and the response carries X-Proxy-Drilldown-Path: hits-leftover-suppressed; other Grafana and non-Grafana callers with the same shape get Loki's answer (TestLock_LeftoverChunkSuppressedInHits, TestE2ELock_DrilldownChunkedMerge_LeftoverChunkSuppressed).
  3. Every piece (whole ranges from 24h to 7d, day-long pieces with starts off the step grid, short first and last pieces) equals Loki's answer to the same request: against recorded Loki engine answers (TestChunkedRangeWindowsMatchLoki, internal/proxy), against the stack's Loki for Drilldown, Grafana and API clients (TestE2ELock_DrilldownChunkedMerge_PiecesMatchLoki, e2e-compat drilldown group), and through the stack's Grafana, where the proxy and Loki datasources must get the same pieces with equal frames (explore-long-range-pieces.spec.ts, e2e-ui explore-core shard).

Drilldown Capability Profiles​

Drilldown version familyCapability profileProxy handling focus
2.xdrilldown-v2detected-level defaults, modern service-detail scenes, patterns and field-value drill flows
1.0.xdrilldown-v1legacy service buckets, filtered detected-fields path, prior labels/field rendering behavior

These profiles are matrix-level compatibility profiles (contract and CI guidance). Runtime request handling must stay Loki-compatible and should not depend on guessed app build strings.

Known Issues​

Logs Drilldown 3.1 shows "Total bytes processed" under the logs panel from the query's data.stats.summary.totalBytesProcessed. With the default -query-stats-mode=loki the proxy reports what Loki would: the lines of the 1h pieces Loki reads for the logs query (from the panel's count answer when the proxy holds it, else estimated from the logs answer) times the mean size of the lines it returned; Loki adds structured-metadata bytes. A refresh answered from the proxy's response cache shows the same figure again (Loki computes log queries on every request), not 0 B. See Known Issues and the API reference for each field's source.

Drilldown 2.0.4 through 3.1.0: Patterns Tab Initialization​

Drilldown 2.0.4 through 3.1.0 contain a bug in ServiceScene.subscribeToLokiConfig() where void 0 === null (always false) prevents re-enabling the Patterns tab after it was disabled. Concretely:

  • If the Grafana default datasource has pattern_ingester_enabled=false in /loki/api/v1/drilldown-limits, $patternsData is set to null.
  • Switching to a datasource where pattern_ingester_enabled=true does NOT re-show the tab because the void 0 === null guard treats null as "already initialized".

Workaround: Configure the patterns-autodetect proxy variant as the Grafana default datasource. Since pattern_ingester_enabled=true is returned on first load, $patternsData is correctly initialized and the Patterns tab appears.

In the e2e-compat compose stack, loki-vl-proxy-patterns-autodetect is set as isDefault: true in grafana-datasources.yaml for this reason.

Release Watchlist​

Potential next family move:

  • current: 3.x (pinned: 3.2.0)
  • previous: 2.x, kept on the previous-family Grafana smoke profile (Drilldown 3.x needs Grafana >= 13.1/13.2)
  • 1.0.x stays in the contract matrix as an additional family until the owner retires it
  • next expected family to evaluate: 4.x when released

Promotion criteria for a new family:

  1. add versions to matrix manifest,
  2. verify TestDrilldownTrackScore and TestDrilldown_RuntimeFamilyContracts on pinned + smoke runtimes,
  3. confirm no regressions in patterns, labels/fields, and service detail flows.

Contracts We Enforce​

  • index/volume must expose real service_name buckets
  • index/volume_range must expose non-empty detected_level series names
  • detected_fields must show parsed fields like method, path, status, duration_ms
  • detected_fields must not leak indexed labels like app, cluster, or namespace
  • detected_fields must suppress high-cardinality terminal timestamp fields (timestamp_end, observed_timestamp_end) so Drilldown field discovery does not trigger expensive backend stats paths that can flap into intermittent no-data responses
  • In hybrid field mode, detected_fields may expose both native dotted fields and translated aliases such as service.name and service_name
  • labels and label/{name}/values should stay stream-shaped; they should prefer VictoriaLogs stream metadata endpoints and only fall back to generic field endpoints for older backend versions
  • The Loki-compatible profile discovers detected_fields from bounded raw-log samples. The default is 100 lines, and an explicit line_limit can raise it up to -detected-fields-max-scan-lines. Requests with line_limit cache the exact time window. Custom response field-count limits remain a compatibility gap. A JSON parser before a label filter stays in the sampled query. Native and hybrid profiles may enrich their discovery with the VictoriaLogs field index. detected_labels and detected_field/{name}/values use native metadata lookups where they map cleanly and sample logs for parsed and derived fields.
  • Alias resolution must keep exact native matches working, allow unique translated aliases to resolve automatically, and avoid silently choosing the wrong native field when multiple dotted names collapse to the same Loki-safe alias
  • Label-value resources for additional filters such as cluster must return real values
  • Unknown label and detected-field lookups should keep a success payload shape instead of flipping into transport errors
  • patterns must return non-empty grouped pattern payloads with sample buckets for Drilldown
  • Multi-tenant Drilldown queries with repeated var-levels=detected_level|=|... selections must stay valid and return logs instead of backend parse errors
  • (v1.17.1) When detected_level is synthesized in metric results, the raw level label is removed from those same results to prevent Drilldown from showing both labels simultaneously — the include button for detected_level values must work correctly without level duplication
  • (v1.17.1) Nested JSON objects in the log body (e.g., service={"name":"api-gateway"}) must be excluded from the detected_fields field breakdown; exposing them previously broke the field breakdown view when users clicked on such a field

Edge Cases Covered​

  • Mixed parser query path: | json ... | logfmt | drop __error__, __error_details__
  • Labels object parsing in returned log frames
  • App-level field suppression for detected_level, level, and level_extracted
  • High-cardinality terminal timestamp keys (timestamp_end, observed_timestamp_end) are excluded from Drilldown detected-field responses while regular parsed fields stay visible
  • 1.x service-selection buckets, detected-fields filtering, and labels field parsing stay explicit in the source-contract checks
  • 2.x detected-level default columns, field-values breakdown scenes, and additional label-tab wiring stay explicit in the source-contract checks
  • Grafana runtime 11.x explicitly asserts 1.x-style service buckets, filtered detected fields, and extra label values at runtime
  • Grafana runtime 12.x explicitly asserts 2.x-style detected-level series, field-value breakdowns, and extra label values at runtime
  • Grafana runtime 13.x uses the same 2.x-style contract as 12.x — added to RuntimeFamilyContracts in v1.15.0
  • Service-detail field breakdowns and additional label filters
  • Multi-tenant Drilldown log views filtered by cluster plus multiple selected detected_level values
  • Multi-tenant Grafana resource calls with __tenant_id__!~... and __tenant_id__="missing" keep the correct narrowed or empty-success behavior
  • Native field-value discovery for indexed metadata such as service.name, with parser-stage stripping before the backend lookup
  • Fallback scanning for parsed-only fields such as method when no safe native metadata path exists
  • Patterns grouping across repeated request shapes
  • (v1.17.1) detected_level/level metric deduplication: raw level label removed from metric results when detected_level is synthesized, fixing the Drilldown include button for detected_level filter selections
  • (v1.17.1) Nested JSON object field suppression: service={"name":"..."} and similar compound body fields are excluded from the field breakdown to prevent broken Drilldown field-click behavior