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

HeatMap: Sort y buckets when all bucket names are numeric #65322

Merged
merged 6 commits into from
Mar 28, 2023

Conversation

leeoniya
Copy link
Contributor

Fixes #60545
Fixes #65314

i don't think this is the proper solution, but it is an easy one that works.

i think we need to move away from handling every format at every level:

  1. datasources (frontend bits)
  2. transformers
  3. panels

ideally panels have a single, pre-defined shape that they accept, and we auto-suggest and explicitly add the necessary transformers that get data into this shape. related: #64092, cc @grafana/data-plane-wg.

@github-advanced-security
Copy link

You have successfully added a new CodeQL configuration .github/workflows/pr-codeql-analysis-javascript.yml:analyze. As part of the setup process, we have scanned this repository and found 29 existing alerts. Please check the repository Security tab to see all alerts.

Copy link
Contributor

@nmarrs nmarrs left a comment

Choose a reason for hiding this comment

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

This solution appears to resolve this issue with correct sorting - though I am not confident on the direction in which we are displaying the sorted list (seems to make more sense to show low -> high along the y axis)
Screenshot 2023-03-27 at 8 17 05 AM

Testing this issue's dashboard locally it appears that this solution is not working. Are there additional query settings / transforms that need to be set in order for this solution to work in more cases?
Screenshot 2023-03-27 at 8 17 33 AM

@leeoniya
Copy link
Contributor Author

leeoniya commented Mar 28, 2023

though I am not confident on the direction in which we are displaying the sorted list (seems to make more sense to show low -> high along the y axis)

that debug panel has an explicit reverse configured:

image

Testing #60545 dashboard locally it appears that this solution is not working. Are there additional query settings / transforms that need to be set in order for this solution to work in more cases?

you're right. that dashboard has a response with multiple nameless frames that have time+value fields. i added more magic to make it work :(

@leeoniya leeoniya modified the milestones: 9.5.0, 9.4.x Mar 28, 2023
@leeoniya leeoniya merged commit 6f4232b into main Mar 28, 2023
@leeoniya leeoniya deleted the leeoniya/heatmap-bucket-sort branch March 28, 2023 22:16
@grafanabot
Copy link
Contributor

The backport to v9.4.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-65322-to-v9.4.x origin/v9.4.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 6f4232bee383a7782ebbdcd31624f11a2d2bdfab
# Push it to GitHub
git push --set-upstream origin backport-65322-to-v9.4.x
git switch main
# Remove the local backport branch
git branch -D backport-65322-to-v9.4.x

Then, create a pull request where the base branch is v9.4.x and the compare/head branch is backport-65322-to-v9.4.x.

@grafanabot grafanabot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label Mar 28, 2023
leeoniya added a commit that referenced this pull request Mar 28, 2023
@leeoniya leeoniya removed datasource/Prometheus backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. backport v9.4.x Mark PR for automatic backport to v9.4.x labels Mar 28, 2023
@leeoniya leeoniya modified the milestones: 9.4.x, 9.5.0 Mar 28, 2023
@npc203
Copy link

npc203 commented Apr 16, 2023

I'm still facing this issue, with the current main branch on my local instance
image

Just to be super sure, also checked whether I really have the commit in my history
image

Here's the paste from "get help"
debug-IO Size - async_write_ind-2023-04-17 00_51_23.json.txt

@leeoniya
Copy link
Contributor Author

leeoniya commented Apr 16, 2023

we expect either frame.name or frame.fields[1].name to be the bucket name. in your case, you only have frame.fields[1].labels.le set to the bucket name.

maybe take a look at the the influx queries in #60545 to see how to make sure the columns/fields contain the bucket names.

if you open a new issue with your previous comment/snapshot, we can discuss whether it makes sense for us to also probe frame.fields[1].labels.le.

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.

Heatmap: data/units on Y-axis are in wrong order precalculated heatmap buckets are ordered alphabetically
5 participants