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 support for log overview tab to Discover log profile #186680

Merged

Conversation

davismcphee
Copy link
Contributor

@davismcphee davismcphee commented Jun 22, 2024

Summary

This PR adds the log overview tab from Logs Explorer to the Discover log document profile. The only difference between the tab in Logs Explorer and Discover is that the one in Logs Explorer includes the O11y AI assistant while the Discover one doesn't (for now at least):
log_overview

Resolves #187096.

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 Jun 22, 2024
@davismcphee davismcphee self-assigned this Jun 22, 2024
@weltenwort
Copy link
Member

weltenwort commented Jul 8, 2024

Hi @davismcphee, could you help us understand the intended scope of this effort? Is the goal to support the tab exactly as it exists in the Logs Explorer or does it deviate somehow?

@davismcphee
Copy link
Contributor Author

@weltenwort The intent is to support it exactly as it exists in Logs Explorer, except for the O11y AI assistant, which should not yet be shown in Discover.

component: (props) => (
<UnifiedDocViewerLogsOverview
{...props}
renderAIAssistant={plugins.logsShared.renderLogsAIAssistant}
Copy link
Contributor

Choose a reason for hiding this comment

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

Note

What if, instead of exporting a new logsShared.renderLogsAIAssistant renderer and introducing the dependency on logsShared, we directly consume this from the discoverShared registered feature as it was doing directly in the UnifiedDocViewer? It should be fine to introduce the dependency on discover-shared and consume the registered feature, also avoiding to update the signature of the logsShared plugin at all, wdyt?

const logsAIAssistantFeature = discoverShared.features.registry.getById(
  'observability-logs-ai-assistant'
);
registry.add({
  id: 'doc_view_logs_overview',
  title: i18n.translate('xpack.logsExplorer.docViews.logsOverview.title', {
    defaultMessage: 'Overview',
  }),
  order: 0,
  component: (props) => (
    <UnifiedDocViewerLogsOverview
      {...props}
      renderAIAssistant={logsAIAssistantFeature.render}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, thanks! I like that better and I suppose that's why we introduced discoverShared in the first place 🙂 Updated here: 97ba3c1.

import { LogsOverviewHeader } from './logs_overview_header';
import { LogsOverviewHighlights } from './logs_overview_highlights';
import { FieldActionsProvider } from '../../hooks/use_field_actions';
import { getUnifiedDocViewerServices } from '../../plugin';
import { LogsOverviewAIAssistant } from './logs_overview_ai_assistant';
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

This file could be removed right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it can, removed here: 97ba3c1.

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

Hey @davismcphee, the taken approach LGTM, I just left a note on the introduced dependency and suggested a change to minimize changes to the plugin API, let me know your thoughts! The rest looks clean and doesn't need changes from the logs team 👌

@davismcphee davismcphee force-pushed the one-discover-log-profile-doc-viewer branch from 104fd90 to 8884ab3 Compare July 11, 2024 20:26
@davismcphee
Copy link
Contributor Author

/ci

3 similar comments
@davismcphee
Copy link
Contributor Author

/ci

@davismcphee
Copy link
Contributor Author

/ci

@davismcphee
Copy link
Contributor Author

/ci

@davismcphee davismcphee force-pushed the one-discover-log-profile-doc-viewer branch from e178e78 to 0251167 Compare July 12, 2024 20:16
@davismcphee
Copy link
Contributor Author

/ci

@davismcphee
Copy link
Contributor Author

/ci

Copy link
Contributor Author

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback @tonyghiani! Updated with your suggestions.

component: (props) => (
<UnifiedDocViewerLogsOverview
{...props}
renderAIAssistant={plugins.logsShared.renderLogsAIAssistant}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, thanks! I like that better and I suppose that's why we introduced discoverShared in the first place 🙂 Updated here: 97ba3c1.

import { LogsOverviewHeader } from './logs_overview_header';
import { LogsOverviewHighlights } from './logs_overview_highlights';
import { FieldActionsProvider } from '../../hooks/use_field_actions';
import { getUnifiedDocViewerServices } from '../../plugin';
import { LogsOverviewAIAssistant } from './logs_overview_ai_assistant';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it can, removed here: 97ba3c1.

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

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

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-presentation changes LGTM
code review only

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 14, 2024
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.

Code changes LGTM 👍

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes!

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Did not test, but kibana JSONC changes LGTM!

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 15, 2024

⏳ Build in-progress

History

cc @davismcphee

@davismcphee davismcphee merged commit 10c27a9 into elastic:main Jul 15, 2024
22 checks passed
@davismcphee davismcphee deleted the one-discover-log-profile-doc-viewer branch July 15, 2024 22:09
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Jul 15, 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 ci:project-deploy-observability Create an Observability project 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] Add support for log overview tab to Discover document log profile
8 participants