From f48c3cc64f3bcbcefcf54a209ecd3cdde4d08be9 Mon Sep 17 00:00:00 2001 From: "A. Stoewer" Date: Fri, 5 Jul 2024 10:56:54 +1000 Subject: [PATCH 1/2] Avoid panic by cheking whether entry is a span in batchCollector --- tempodb/encoding/vparquet4/block_traceql.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tempodb/encoding/vparquet4/block_traceql.go b/tempodb/encoding/vparquet4/block_traceql.go index d25241e15a9..f2587930a4c 100644 --- a/tempodb/encoding/vparquet4/block_traceql.go +++ b/tempodb/encoding/vparquet4/block_traceql.go @@ -2704,7 +2704,10 @@ func (c *batchCollector) KeepGroup(res *parquetquery.IteratorResult) bool { // Second pass. Update and further filter the spans spans = res.OtherEntries[:0] for _, e := range res.OtherEntries { - span := e.Value.(*span) + span, ok := e.Value.(*span) + if !ok { + continue + } // Copy resource-level attributes to the span // If the span already has an entry for this attribute it From 5be55829a2e7eb46367f1eecf1e2bab8baf349ea Mon Sep 17 00:00:00 2001 From: "A. Stoewer" Date: Fri, 5 Jul 2024 11:16:27 +1000 Subject: [PATCH 2/2] CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9f63db406..a695ae53152 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * [ENHANCEMENT] Add caching to query range queries [#3796](https://github.com/grafana/tempo/pull/3796) (@mapno) * [ENHANCEMENT] Add data quality metric to measure traces without a root [#3812](https://github.com/grafana/tempo/pull/3812) (@mapno) * [ENHANCEMENT] Add a new helper method to allow debugging e2e tests [#3836](https://github.com/grafana/tempo/pull/3836) (@javiermolinar) +* [BUGFIX] Fix panic in certain metrics queries using `rate()` with `by` [#3847](https://github.com/grafana/tempo/pull/3847) (@stoewer) * [BUGFIX] Fix metrics queries when grouping by attributes that may not exist [#3734](https://github.com/grafana/tempo/pull/3734) (@mdisibio) * [BUGFIX] Fix frontend parsing error on cached responses [#3759](https://github.com/grafana/tempo/pull/3759) (@mdisibio) * [BUGFIX] max_global_traces_per_user: take into account ingestion.tenant_shard_size when converting to local limit [#3618](https://github.com/grafana/tempo/pull/3618) (@kvrhdn)