Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeseries to table transformation: Fix misaligned table field values if some frames are missing a label #78909

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

domasx2
Copy link
Contributor

@domasx2 domasx2 commented Nov 30, 2023

Hey!

Found a bug with converting frame labels to fields in time series table transform.

When coverting time series frames to a "table" frame, a field is created for each label and filled with label value from each frame. However if some frame in the middle is missing a particular label, transform would just skipt it and not add an empty value. Thus field values would become misaligned with other fields.

For example if all frames have name label but only some frames have namespace label, in the resulting table namespaces would become misattributed to wrong names. Names coming from frames with missing namespace would get attributed namespace from the next frame that has one.

It's probably best to look at the added test to quickly grok the issue :)

@domasx2 domasx2 requested a review from a team November 30, 2023 14:38
@domasx2 domasx2 requested a review from a team as a code owner November 30, 2023 14:38
@domasx2 domasx2 requested review from codeincarnate and oscarkilhed and removed request for a team November 30, 2023 14:38
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.3.x milestone Nov 30, 2023
Copy link
Collaborator

@codeincarnate codeincarnate left a comment

Choose a reason for hiding this comment

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

Looks good and the test makes sense to me 😄. Tested out on a dashboard too and saw the error with labels floating up and this definitely seems to fix that 👍

@domasx2 domasx2 merged commit b40e61d into main Nov 30, 2023
15 checks passed
@domasx2 domasx2 deleted the domas-fix-time-series-transform-label-alignment branch November 30, 2023 17:09
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants