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

Stat: Support no value in spark line #78986

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

FOWind
Copy link
Contributor

@FOWind FOWind commented Dec 2, 2023

What is this feature?
[Add a brief description of what the feature or update does.]

  1. make stat panel support no value
  2. add storybook case for BigValue component's noValue case

Why do we need this feature?
[Add a description of the problem the feature is trying to solve.]
#52789

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #52789

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@FOWind FOWind requested a review from a team December 2, 2023 17:50
@FOWind FOWind requested review from a team as code owners December 2, 2023 17:50
@FOWind FOWind requested review from codeincarnate, mdvictor, joshhunt and L-M-K-B and removed request for a team December 2, 2023 17:50
@grafana-pr-automation grafana-pr-automation bot added area/frontend pr/external This PR is from external contributor labels Dec 2, 2023
Copy link
Contributor

github-actions bot commented Jan 6, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale Issue with no recent activity label Jan 6, 2024
@nmarrs nmarrs added area/panel/stat and removed stale Issue with no recent activity labels Jan 10, 2024
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.

Hi @FOWind! Thank you for your contribution!

On closer review it seems like the original issue seems to have a viable fix via the stat value options calculation (choosing Last vs Last*)

Given this fix above, I am not sure if we need these code changes / what exactly these code changes are doing. Maybe I am missing something though 😅 - if I am please let me know :)

#52789 Stat panel no no value-1704906273213.json.txt

Screen.Recording.2024-01-10.at.9.05.06.AM.mov

@FOWind
Copy link
Contributor Author

FOWind commented Jan 11, 2024

Hi @FOWind! Thank you for your contribution!

On closer review it seems like the original issue seems to have a viable fix via the stat value options calculation (choosing Last vs Last*)

Given this fix above, I am not sure if we need these code changes / what exactly these code changes are doing. Maybe I am missing something though 😅 - if I am please let me know :)

#52789 Stat panel no no value-1704906273213.json.txt

Screen.Recording.2024-01-10.at.9.05.06.AM.mov

As shown in the video, the sparkline in the stat panel doesn't draw the no value currently.

With this PR's patched it will draw the null value if setted as below.

image

@nmarrs nmarrs changed the title Grafana/UI:stat panel support no value Stat: Support no value in sparkline Jan 13, 2024
@nmarrs nmarrs added this to the 10.4.x milestone Jan 13, 2024
@nmarrs nmarrs added add to changelog no-backport Skip backport of PR labels Jan 13, 2024
@nmarrs nmarrs changed the title Stat: Support no value in sparkline Stat: Support no value in spark line Jan 13, 2024
@nmarrs
Copy link
Contributor

nmarrs commented Jan 13, 2024

As shown in the video, the sparkline in the stat panel doesn't draw the no value currently.
With this PR's patched it will draw the null value if setted as below.

@FOWind thank you for the response! I didn't notice the difference in the spark line on the first review 😅

@nmarrs nmarrs requested a review from leeoniya January 13, 2024 03:30
@leeoniya
Copy link
Contributor

leeoniya commented Jan 13, 2024

the original issue this PR says it fixes mentions it relating to thresholds, but this PR might only be addressing it for sparkline portion but not the Stat panel background color, which is also threshold based.

i think we need to address this more holistically and not just sparkline sub-component.

@codeincarnate
Copy link
Collaborator

@leeoniya I would agree we need to address more scenarios, but nullToValue needs to be applied in each of scenarios right? This takes us in the right direction IMO

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.

This looks fine to me overall, but may need to revise based on the conversation above 😄

@leeoniya
Copy link
Contributor

leeoniya commented Jan 16, 2024

I would agree we need to address more scenarios, but nullToValue needs to be applied in each of scenarios right?

my main question is whether this needs to be applied once (above the Sparkline component), and this data shared for stat background and sparkline, instead of being done only in sparkline and then doing it a second time for stat background threshold. feels like it should be moved up, and done in one place to accommodate both scenarios.

@nmarrs
Copy link
Contributor

nmarrs commented Jan 20, 2024

my main question is whether this needs to be applied once (above the Sparkline component), and this data shared for stat background and sparkline, instead of being done only in sparkline and then doing it a second time for stat background threshold. feels like it should be moved up, and done in one place to accommodate both scenarios.

My vote here is that we move forward and merge this PR and address this refactor in a follow-up issue. Thank you for your contribution @FOWind!

@nmarrs nmarrs merged commit d7af7d0 into grafana:main Jan 20, 2024
31 checks passed
Ukochka pushed a commit that referenced this pull request Feb 14, 2024
@aangelisc aangelisc modified the milestones: 10.4.x, 10.4.0 Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend area/panel/stat no-backport Skip backport of PR pr/external This PR is from external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stat panel does not apply "No Value" mapping
5 participants