Skip to content

Fix bug related to filtering of dedicated columns - #6586

Merged
stoewer merged 5 commits into
grafana:mainfrom
stoewer:fix-dedicated-col-filter
Mar 11, 2026
Merged

Fix bug related to filtering of dedicated columns#6586
stoewer merged 5 commits into
grafana:mainfrom
stoewer:fix-dedicated-col-filter

Conversation

@stoewer

@stoewer stoewer commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

What this PR does:
This bug can cause missing attributes when the tempo config or overrides contain dedicated columns that are filtered. For example when vp4 blocks contain dedicated columns that correspond to well-known attributes.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

func CreateBlock(ctx context.Context, cfg *common.BlockConfig, meta *backend.BlockMeta, i common.Iterator, r backend.Reader, to backend.Writer) (*backend.BlockMeta, error) {
s := newStreamingBlock(ctx, cfg, meta, r, to, tempo_io.NewBufferedWriter)
s, newMeta := newStreamingBlock(ctx, cfg, meta, r, to, tempo_io.NewBufferedWriter)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meta returned here is only partially populated. i.e. final stats like size aren't populated yet. But things happen to work because it's a pointer and the underlying object is continued to be updated. Might prefer to put it behind a method like .Meta() that implies it's the latest at the time of the call, thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. The main motivation behind the signature change was to make it explicit to the caller that the returned meta has been modified and needs to be respected on the caller side. Not surfacing this clearly was likely what caused the earlier bug with filtered vs. unfiltered dedicated columns. Using a .Meta() doesn’t communicate as clearly that the caller should update its local meta.

I can think of a couple of alternative ways to address this:

  1. Return a more fully populated newMeta
  2. Return the filtered dedicated columns instead, and update meta at the call site, e.g (preferred)
s, meta.DedicatedColumns = newStreamingBlock(ctx, cfg, meta, r, to, tempo_io.NewBufferedWriter)

What do you think?

@mdisibio mdisibio Mar 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok yes that it was likely the cause for the error, has convinced me. This signature is good.

@stoewer
stoewer merged commit 28cc78d into grafana:main Mar 11, 2026
24 checks passed
@stoewer
stoewer deleted the fix-dedicated-col-filter branch March 12, 2026 11:16
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
* Fix dedicated column filtering in vp4

* Fix dedicated column filtering in vp3

* Fix dedicated column filtering in vp5

* CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants