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

UI: Unify behavior for time ranges when min / max time is not available / applicable #4908

Merged
merged 4 commits into from
Jan 3, 2022

Conversation

matej-g
Copy link
Collaborator

@matej-g matej-g commented Nov 26, 2021

Signed-off-by: Matej Gera matejgera@gmail.com

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Components which expose store API behave somewhat differently when it comes to returning store time range information, where for example:

This means that on the actual UI, we can get various results, ranging from Invalid date to 0000-01-01 00:00:00 - which all signalize the same thing: the information is not available or not known.

My suggestion here is to:

  1. For UI purposes, consider valid dates to be in range 1 - (math.MaxInt64 - 1)
  2. Use the 'infinity' icon for min time instead of the invalid or misleading value (this is already used for max time)

If people find the icon confusing, possible alternative would be to use a different icon or some default, minimum time, like 0 UNIX timestamp.

Verification

UI tests have been adjusted. I also did few manual checks with the interactive tests.

@GiedriusS
Copy link
Member

GiedriusS commented Nov 29, 2021

IMO this is a step in the right direction but we also get a lot of questions about what the infinity symbols mean so I'd like to fix it in one go :/ perhaps it would be easy to add a tooltip for those icons saying something like "This node either has no information or is unable to synchronize its state"? We could add this if both min/max times are invalid. Maybe we could add this not even on the icons but on the address itself? Something akin to https://stackoverflow.com/questions/7117073/add-a-tooltip-to-a-div. Could we add this information in the title of addresses?

@matej-g
Copy link
Collaborator Author

matej-g commented Nov 30, 2021

Maybe we could add this not even on the icons but on the address itself? Something akin to https://stackoverflow.com/questions/7117073/add-a-tooltip-to-a-div. Could we add this information in the title of addresses?

I like this idea a lot, less confusing than just having icons. I think we could distinguish all cases, i.e. if no min and max time, we can provide information that the time range is unknown; if only one of the ranges is available, we can just say that the store has no max or min time limit. I'm not much of a front-end developer 😅, but I'll try to come back with a solution.

@matej-g
Copy link
Collaborator Author

matej-g commented Dec 8, 2021

@GiedriusS I made few more changes, as suggested:

  • I changed the 'infinity' icon into a simple 'minus' icon
  • Added tooltip on store's address and min / max time cell (see screenshot)
  • Specified the times are in UTC
    tooltip

Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

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

Could you please rebase on the newest main?

Signed-off-by: Matej Gera <matejgera@gmail.com>
Signed-off-by: Matej Gera <matejgera@gmail.com>
- Change icon to 'minus' icon
- Add tooltip with information on time range
- Specify the min / max time is in UTC

Signed-off-by: Matej Gera <matejgera@gmail.com>
Copy link
Member

@GiedriusS GiedriusS 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, just one suggestion.

'Last Successful Health Check',
'Last Message',
];

export const MAX_TIME = 9223372036854775807;
export const storeTimeRangeMsg = (validMin: boolean, validMax: boolean): string => {
if (!validMin && !validMax) {
Copy link
Member

@GiedriusS GiedriusS Dec 17, 2021

Choose a reason for hiding this comment

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

I think it is important to distinguish between the cases:

  • Time range is MIN_TIME; MAX_TIME e.g. when Prometheus still hasn't uploaded any blocks. In this case, Query will always send all queries to that StoreAPI;
  • Time range is MAX_TIME; MIN_TIME e.g. when Thanos Store has no blocks. In this case, Query will not send any queries to it.

As is right now, both stores would show up with minuses in the Store page and with the same tooltip. I suggest at the minimum to change this function to distinguish between these two states so that it would be clear what's happening. Perhaps something like:
"This store's time range data is not available but we will send all queries to it"? Or maybe we could make the minuses different colors depending on the state? For example, the minuses could be green if we will still send all queries to it. Or perhaps the node's address could have a different color depending on the state e.g. green = we will send all queries to it, yellow = we will send certain queries to it depending on the labels & min/max time, red = no queries will be sent to it?

WDYT @matej-g ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, I'm wondering whether min / max time ranges and the information whether we are querying the store are two separate things. For the min / max, I would expect simply to have the information stated in the dashboard if it is available - if not, regardless of the reason (i.e. no block uploaded or no block in store), we just signal that this information cannot be showed because it is unknown.

But I think you're onto something with color coding the nodes (perhaps we could even add another column, besides Status and add details on querying?), although it feels like a separate feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ping @GiedriusS, how do you suggest to proceed? Do you agree with the suggestion and if so, should we do this in the current PR?

Copy link
Member

Choose a reason for hiding this comment

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

Mhm, I guess you are correct. Whether or not we are sending queries to a node is different information altogether and we could work on this in future pull requests. 👍

GiedriusS
GiedriusS previously approved these changes Jan 3, 2022
@GiedriusS
Copy link
Member

Could you please merge main into your branch?

@matej-g
Copy link
Collaborator Author

matej-g commented Jan 3, 2022

Done, thanks for the review! I also opened a separate issue for that color-coding idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants