-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Show "All logs" ad-hoc data view linked to central logs setting in Discover #189166
Comments
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
cc @Kerry350 |
This should be part of the o11y root profile resolution - the method should check the state and add in the ad-hoc data view in case it doesn't exist. |
This looks like something that will need to have access to the discover @davismcphee does any extension already provide access to the internal state management of Discover? I couldn't find any exposure of it through the contextual awareness implementation, which might be a blocker for this task. Let me know your thoughts, happy do chat more on this 👌 |
@tonyghiani Originally I thought we might be able to just create an ad hoc data view in the
Yes also correct, the I'd prefer not to expose the So I think we'll need to do something to make this work in Discover. We've talked about this briefly before, but would it make sense to tie it in with the default ES|QL query work as a "default data source"? I'm thinking it could return an index pattern + time field for data view mode or a default query for ES|QL mode. We'd need to maintain the default data view logic in Discover for now, but they'd otherwise function the same I'd think. I can think of a couple ways this could work:
In any case, exposing this capability through the context awareness framework means we could generate the data view ID in Discover and ensure it gets cleaned up on profile change. WDYT? |
Regarding the exposure of
I think this approach is a bit different from the original specs, we don't want to affect the default source on data-view directly but only provide a direct access point to the log sources settings for the user to explore. If I understood correctly, your suggestion would bind this data view to both the default data view in KQL and the default query in ESQL, which is not the aim of this change. It is something we could consider incrementally if we realize it makes sense to align them, but I'd rather start simple without magically affecting the user default data view choice when the o11y profile resolves. Given these specs, I was thinking about something more of a lifecycle hook on the profile resolution, like adding an export const createObservabilityRootProfileProvider = (
services: ProfileProviderServices
): RootProfileProvider => ({
profileId: 'observability-root-profile',
profile: {},
resolve: (params) => { /* ... */ },
onMatch: async ({actions}) => {
const dataView = createLogsDataView() // Holds logic to create data view based on settings, etc..
await actions.appendAdHocDataView(dataView)
// Clean-up function when the profile switches, similarly to use effects.
return async () => {
await actions.removeAdHocDataView(dataView.id)
}
}
}); Does it makes sense? It feels a good to have control on the awareness framework, as use cases might get more complex and require this. |
I was thinking in the data view case it wouldn't set the default data view, just add a default one to the list, but I agree it makes sense to focus on this in isolation for now and align later if needed. I'd be a bit hesitant to extend the framework in the suggested way since adding lifecycle hooks that can affect state imperatively could make it harder for Discover to control the initialization flow, which is important to get right. I feel like this case still fits well into the extension point model, and could be supported with something dedicated like a We could probably still accomplish this using the lifecycle hook by storing the array separately and only applying it at the right time in Discover, but I think it would add more complexity than is needed for this. |
I don't have all the details to know in advance if that would work for any use case, but it would work for this specific one 👌 My proposal was mostly oriented to a more flexible API where the consumer has control over the lifecycle of the owned profile (by solution, I mean). This would give the chance to enhance the profile experience without the need to have a specific extension point each time, which requires more work and prioritization on the Discover side, blocking the work on the solutions' side. I'm not saying the granular extension points are a bad choice, it surely prevents leaking too much control to the consumers. If you feel the |
🛑 Blocked by #201669
As part of https://github.com/elastic/observability-dev/issues/3498 , a central setting is introduced that signifies where observability-related logs can be found. The intent is to replace the existing logs setting of the logs stream app and align across as many places as possible, so the user doesn't have to configure logs data access in multiple places.
One of these places is KQL-based Discover - Users have a flexible tool with data views to configure what data to show. To make it easy to always get back to all logs (in the sense of the central observability setting), there should be an implicit ad-hoc data view synced to the setting that's always available:
This gives the user an easy way to always look at all logs.
The text was updated successfully, but these errors were encountered: