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

[Discover] Add log level badge cell renderer for logs profile #188281

Merged
merged 5 commits into from
Jul 17, 2024

Conversation

davismcphee
Copy link
Contributor

@davismcphee davismcphee commented Jul 13, 2024

Summary

This PR adds a log level badge cell render for log.level and log_level fields when the logs data source profile is active in Discover:
log_level_badge

Resolves #186567.

Checklist

For maintainers

@davismcphee davismcphee added release_note:enhancement Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Project:OneDiscover Enrich Discover with contextual awareness labels Jul 13, 2024
@davismcphee davismcphee self-assigned this Jul 13, 2024
@davismcphee
Copy link
Contributor Author

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 14, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #3 / telemetry tasks telemetry-prebuilt-rule-alerts should manage runtime errors searching endpoint metrics
  • [job] [logs] Jest Integration Tests #3 / telemetry tasks telemetry-prebuilt-rule-alerts should manage runtime errors searching endpoint metrics

History

cc @davismcphee

@davismcphee davismcphee force-pushed the one-discover-log-level-renderer branch from bbfacef to 8e62303 Compare July 16, 2024 01:31
@davismcphee
Copy link
Contributor Author

/ci

@davismcphee
Copy link
Contributor Author

/ci

@davismcphee davismcphee marked this pull request as ready for review July 16, 2024 13:02
@davismcphee davismcphee requested review from a team as code owners July 16, 2024 13:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Investigations code owner changes! 👍🏾

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Awesome! More colors on Discover page 🙂

data-test-subj={`logLevelBadgeCell-${coalescedValue ?? 'unknown'}`}
css={badgeCss}
>
{value}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think for some badges we might want to use white text instead of dark. For example for emerg badge here:

Screenshot 2024-07-16 at 16 18 35

Or is it fine with the default dark color text regardless of current badge background color?

cc @MichaelMarcialis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the same thing, although it currently matches the mockups and it seems EUI's util that is supposed to do this automatically determined the text should be dark (I tested with an extra dark colour to confirm it renders white in that case). If we want to do this, we'll need to manually decide which ones should have white text, so I'll leave it to @MichaelMarcialis to determine if we should.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I merged this PR to get the feature in, but we can make followup changes around this if needed based on @MichaelMarcialis' feedback.

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis Jul 22, 2024

Choose a reason for hiding this comment

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

Thanks for the ping, @jughosta and @davismcphee! Yes, the badges' black text color used in the mockups is correct and passes the AA WCAG accessibility standard for normal text. Switching to white will actually cause the text within the badge to fail this contrast check, even in the emerg badge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for confirming @MichaelMarcialis!

@@ -7,3 +7,4 @@
*/

export { getRowIndicatorProvider } from './get_row_indicator_provider';
export { getCellRenderers } from './get_cell_renderers';
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to use the same renders also for the badge in Log Overview tab?

Screenshot 2024-07-16 at 16 23 49

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely doable, although I'd prefer to save it for a followup if we do since it'll require some refactoring of the current log level chip component. @elastic/obs-ux-logs-team WDYT about this suggestion to update the log level chip to use the new log badge component for consistency? If we all agree, I'll create a separate issue to implement this as a followup.

Copy link
Contributor

Choose a reason for hiding this comment

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

Always in favour of visual consistency, +1 for updating it and make them look the same 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! I created a followup issue to take care of it here: #188553.

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@davismcphee davismcphee merged commit ab8bfda into elastic:main Jul 17, 2024
39 checks passed
@davismcphee davismcphee deleted the one-discover-log-level-renderer branch July 17, 2024 15:46
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Project:OneDiscover Enrich Discover with contextual awareness release_note:enhancement Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OneDiscover] DataTable log.level colored badge cell renderer
7 participants