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

[Logs Explorer] Add locators support for data views #175770

Closed
tonyghiani opened this issue Jan 29, 2024 · 6 comments · Fixed by #176904
Closed

[Logs Explorer] Add locators support for data views #175770

tonyghiani opened this issue Jan 29, 2024 · 6 comments · Fixed by #176904
Assignees
Labels
Feature:LogsExplorer Logs Explorer feature Team:obs-ux-logs Observability Logs User Experience Team

Comments

@tonyghiani
Copy link
Contributor

tonyghiani commented Jan 29, 2024

📓 Summary

🛑 Blocked by: #175767

Based on the initial work done with #164995 to add Logs Explorer locators, we now want to add support for other apps to land on Logs Explorer using a data view as a data source.

✔️ Acceptance criteria

There is a locator in the plugin x-pack/plugins/observability_log_explorer, that navigates to the observability log explorer app, which...

  • accepts the same DiscoverLocator options for navigating to a specific data view.
    • id to load an existing data view
  • the data view should satisfy the requirement to be considered a logs-backed data view. If the target Data view is not supported by Logs Explorer, the user will be redirected to Discover.
  • optionally accepts a sub-set of properties of the Discover locator:
    • timeRange
    • refreshInterval
    • filters
    • query
    • columns
    • sort
@tonyghiani tonyghiani added Team:obs-ux-logs Observability Logs User Experience Team Feature:LogsExplorer Logs Explorer feature labels Jan 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@gbamparop
Copy link
Contributor

Will the updates to the other apps be done as part of another issue? Do we have an existing issue that captures this?

@tonyghiani
Copy link
Contributor Author

Will the updates to the other apps be done as part of another issue?

Correct, this issue is only to make the LogsExplorer locator support data views as a consequence of the work in progress with #175767.

There is not yet a list of links that should point to the LogsExplorer once data views are supported.

@gbamparop
Copy link
Contributor

Thanks, I think it makes sense to prioritise this along with plans to update the links in some apps. Can we make it part of the issue to update some of those links? Or we could create another issue for that that we prioritise next which can contain a small list for start and be updated when we're closer to implementation.

@tonyghiani
Copy link
Contributor Author

@gbamparop I'd rather keep the two issues separated, mostly to have a more granular work for implementation and consumption, which makes it easier to revert any change for links pointing to Logs Explorer if we don't need those anymore.

Do you have any specific case in mind for touchpoints were this locator could be used with data views?

@gbamparop
Copy link
Contributor

Do you have any specific case in mind for touchpoints were this locator could be used with data views?

We now have https://github.com/elastic/logs-dev/issues/116, we can make a start once the locator updates are completed.

@tonyghiani tonyghiani self-assigned this Feb 7, 2024
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
## 📓 Summary

Closes elastic#175770 

This PR introduces support for a data view locator which allows reaching
the Observability Logs Explorer app and accessing an existing data view.

To make this possible, it was required to introduce a look-up step on
our state machine that, whenever a data view selection is not resolved
yet, tries to retrieve it by the passed `id`.

In case the data view we try to access does not exist, we'll fall back
to the default `All logs` selection. The look-up step also considers
whether the pointed data view is of logs type or not, redirecting to
Discover in case the data view does not match our criteria.

## Usage

As we do for the existing locators for the Observability Logs Explorer
app, this new locator also supports the default parameters to set the
`timeRange`, `refreshInterval`, `query`, `columns`, `filters` and
`filterControls` options.

```ts
const obsLogsExplorerDataViewLocator = share.url.locators.get<ObsLogsExplorerDataViewLocatorParams>(OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR_ID);

const urlToLogsExplorer = obsLogsExplorerDataViewLocator?.getRedirectUrl({
  id: 'data-view-unique-id',
  timeRange: {
    from: 'now-1d',
    to: 'now',
  },
  integration: dataStreamStat.integration?.name,
  filterControls: {
    namespace: {
      mode: 'include',
      values: [dataStreamStat.namespace],
    },
  },
});
```

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:LogsExplorer Logs Explorer feature Team:obs-ux-logs Observability Logs User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants