Skip to content

Add a tooltip for unix times (ISO strings) - #10376

Merged
juliusv merged 3 commits into
prometheus:mainfrom
kokes:unix_tooltip
Mar 9, 2022
Merged

juliusv merged 3 commits into
prometheus:mainfrom
kokes:unix_tooltip

Conversation

@kokes

@kokes kokes commented Mar 1, 2022

Copy link
Copy Markdown
Contributor

I find unix times in the UI quite hard to read, so I'm proposing adding a tooltip with an ISO string.

  • Changed the layout logic a tiny bit (newlines -> <br>, because I now have React Fragments instead of plain textNodes)
  • Formatted with Prettier
  • Built and tested locally (Chrome, Firefox, Safari, all on macOS, though the HTML used is very basic)
  • I have no prior React experience, so apologies if I misused some concepts
  • Can create an issue/proposal if needed

cc @juliusv

Signed-off-by: Ondrej Kokes [email protected]

Screenshot 2022-03-01 at 12 25 32

@kokes
kokes requested a review from juliusv as a code owner March 1, 2022 11:50
@kokes

kokes commented Mar 1, 2022

Copy link
Copy Markdown
Contributor Author

@roidelapluie

Copy link
Copy Markdown
Member

It would be great to respect the "use local time" checkbox.

@kokes

kokes commented Mar 2, 2022 •

Copy link
Copy Markdown
Contributor Author

I've added a bit of code to reflect that. Though not knowing much about React, I'm not sure I'm passing the boolean correctly - seems a bit out of place to put it in the QueryResult struct.

Edit: the force push is there just to sign off the second commit, no changes to the original commit.

@juliusv juliusv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's awesome, thanks! Just one small thing to fix.

Btw. this dumb display of <value> @<timestamp> for range vectors has never changed since the very earliest days of Prometheus. There's probably even still way better ways of displaying this, but on the other hand, it's not used that often :)

Signed-off-by: Ondrej Kokes <[email protected]>
@kokes
kokes requested a review from juliusv March 6, 2022 13:29
@juliusv

juliusv commented Mar 9, 2022

Copy link
Copy Markdown
Member

👍 Thanks :)

@juliusv
juliusv merged commit 16e610e into prometheus:main Mar 9, 2022
juliusv added a commit that referenced this pull request Mar 9, 2022
Fixes issues introduced in #10376

Signed-off-by: Julius Volz <[email protected]>
juliusv added a commit that referenced this pull request Mar 9, 2022
* Fix DataTable tests and missing value key warning

Fixes issues introduced in #10376

Signed-off-by: Julius Volz <[email protected]>

* Fix more DataTable brokenness

Signed-off-by: Julius Volz <[email protected]>
IzhakJakov pushed a commit to IzhakJakov/prometheus that referenced this pull request Mar 23, 2022
* Add a tooltip for unix times (ISO strings)

Signed-off-by: Ondrej Kokes <[email protected]>

* Leverage useLocalTime to adjust ISO string tooltips

Signed-off-by: Ondrej Kokes <[email protected]>

* revert pre styling removal

Signed-off-by: Ondrej Kokes <[email protected]>
IzhakJakov pushed a commit to IzhakJakov/prometheus that referenced this pull request Mar 23, 2022
* Fix DataTable tests and missing value key warning

Fixes issues introduced in prometheus#10376

Signed-off-by: Julius Volz <[email protected]>

* Fix more DataTable brokenness

Signed-off-by: Julius Volz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants