Commit graph

29 commits

Author SHA1 Message Date
Achyut Jhunjhunwala
1d5603219b
[Logs Explorer] Add logic to update flyout highlights (#172193)
## Summary

Closes - https://github.com/elastic/kibana/issues/171824

## Demo


![highlights](aa56a552-03e7-4828-9ba8-d18c7305bad9)


### Updated Demo with Fixed Width PopTip (Popover + Tooltip)

![popover](3a386321-01fc-46d7-9584-913c3e483c4b)
2023-12-04 13:58:16 +01:00
Maryam Saeidi
59982bfa5c
[Custom threshold] Add viewInApp URL to the custom threshold rule type (#171985)
Closes #171613

## Summary

This PR adds the viewInApp URL to the custom threshold rule type. This
URL will send the user to the log explorer with the selected data view
and the rule's query filter. If there is only one document aggregation,
then the filter related to this aggregation will be added as shown
below:

|Rule|Discover with pre-fill data|
|---|---|

|![image](2f08b4f4-e6cc-4d25-a48a-098db63b9ce6)|

For the ad-hoc data view, you should be able to see the selected index
pattern in discover similar to this:

<img
src="046493ae-ba59-46b7-a40f-68d1836d43f1"
width=400 />

### 🧪 How to test
- Check the viewInApp URL both in action variables and the alert table
for the following scenarios:
    - A rule with a persisted data view
    - A rule with an ad-hoc data view
    - A rule with count aggregation and filter
    - A rule with an optional query filter
    - A rule with non-count aggregation

In all the above scenarios, the starting time in the Discover should be
before the alert's start time.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-01 16:44:10 +01:00
Marco Antonio Ghiani
6bdc094d79
[Logs Explorer] Increase Log details flyout size (#172045)
## 📓 Summary

Closes #171847 

This work adds a new `size` parameter to the customization extension
point for the `flyout`, enabling consumers to increase/decrease it based
on requirements.

It also set the Log Explorer size to `60%` since both `m` and `l` sizes
didn’t fit with the designed size.

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-11-29 11:08:18 +01:00
Marco Antonio Ghiani
0c5e9fdb5a
[Log Explorer] Add cloud provider and service icons on Log detail (#171642)
## 📓 Summary

Closes #170721 

These changes add icons for the cloud provider and service fields in the
Log detail flyout.

Regarding the Package Icon next to the dataset field, it should require
a remote request to determine what package is part of the current
dataset. We haven't determined this part yet, so we'll keep it for an
upcoming implementation.


fc882810-6b0f-40ee-9727-762f57ad01cc

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
2023-11-23 14:07:24 +01:00
Achyut Jhunjhunwala
5d3c1bc2bb
[Logs Explorer] Fix message field highlights due to the formatting issues (#171631)
## Summary

Fixes the issue when the message is added as a filter, discover
component surrounds the value with the <mark> tag in order to highlight
the field. Since our message field is inside a `EuiCodeBlock` it cannot
be highlighted and hence should not support adding of this tag.

### Before


![image](39a3f0f2-ed88-40d9-ae5c-bd23287e13d3)


### After


![image](f05e5168-9f73-48c4-ac9e-f68ea72f91e6)
2023-11-23 06:12:28 -05:00
Alejandro Fernández Haro
fd09c26d15
async-import plugins in the server side (#170856)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-15 00:55:56 -07:00
Julia Rechkunova
145cc8f13b
[Discover] Show "unsaved changes" label when in unsaved state of saved search (#169548)
- Resolves https://github.com/elastic/kibana/issues/135887

## Summary

This PR adds "Unsaved changes" badge to Discover for modified saved
searches. It also removes "Reset search" button from the histogram area.
Code for the badge is added to a new package
`@kbn/unsaved-changes-badge`.

<img width="600" alt="Screenshot 2023-10-23 at 18 05 34"
src="ad200a28-79e1-4cc5-8e28-6352d4b85322">

![Oct-23-2023
18-06-39](cacf4ff2-525c-4759-aba9-34ce75089ddd)


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-13 13:36:25 +01:00
Marco Antonio Ghiani
00f4ce4338
[Log Explorer] Add flyout title customization (#170933)
## 📓 Summary

Closes #170391 

This work adds a new `title` parameter for the flyout customization and
sets the `Log details` title for the customized Log Explorer flyout.

<img width="1498" alt="Screenshot 2023-11-09 at 12 04 02"
src="ba6c136c-9e3c-4d9d-993d-121cd9be1f5e">

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-11-13 12:23:37 +01:00
Achyut Jhunjhunwala
c62df52c04
[Log Explorer] Add logic to display highlights in Flyout (#170650)
## Summary

Closes https://github.com/elastic/kibana/issues/169504



![Highlights](06f21ac5-38e1-4521-843f-064c16ddd034)

## What's pending

- [ ] FTR Tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-10 11:37:34 -07:00
Paul Bianciardi
c72d4d3372
Update new codeowners for Obs team changes (#170182)
Updates new teams as codeowners for Observability team changes.

Also took the opportunity to:
- Delete some paths that no longer exist
- Split infra code ownership between teams (from #168992)
2023-11-08 14:30:17 +00:00
Marco Antonio Ghiani
43f9712dd5
[Log Explorer] Flyout details ai assistant registration (#170658)
## 📓  Summary

Closes #169506 

This PR introduces a mechanism to apply customizations on the
LogExplorer component.
The first necessary customization which is implemented is for the flyout
detail, allowing the consumer to display additional content on top of
what is already displayed.

This is a temporary solution which will be updated and embedded in a
more structured customization system as a result of the work done for
https://github.com/elastic/kibana/issues/165255.

The current solution creates already a context to allow granular
consumption of the customizations only for those subtrees where a
specific customization should apply.

The LogAIAssistant is used to customize the current LogExplorer as the
first usage of this customization.


c9e6b40e-e636-456a-9e19-1778c26142db

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-08 12:35:25 +01:00
Marco Antonio Ghiani
9b6edea13b
[Log Explorer] Implement Flyout content header (#169832)
## 📓 Summary

Closes #169501 

🛑 ~**Merge blocked by:** https://github.com/elastic/kibana/pull/169634~

This work implements the first frame for a detailed log flyout.
It adds highlight on the log level, timestamp and message details for a
log.
This first layer of customization will work as a base for all the
upcoming enhancements on the flyout detail.


a1c2997c-5fef-4899-836f-ff810de3f148

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
2023-11-03 09:05:11 +01:00
Marco Antonio Ghiani
cbb7c4983b
[Log Explorer] Set log.level as default breakdown field (#168947)
## 📓 Summary

Closes #166595 

This work set the default breakdown field for the Log Explorer to be
`log.level`.


63a75990-dafc-40d8-89cc-90c2afbdebf0

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-10-17 11:05:12 +02:00
Marco Antonio Ghiani
3d774489b6
[Log Explorer] Explicitly set Fleet API version for Datasets service (#168202)
## 📓 Summary

These changes set an explicit version of the Fleet API when consumed by
the Log Explorer to prevent API failures while developing locally due to
the missing configuration parameter `server.versioned.versionResolution:
oldest`

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-10-06 15:37:35 +02:00
Marco Antonio Ghiani
2207928e63
[Log Explorer] Update serverless tests stability (#167482)
## 📓 Summary

Update login logic, sorting and search algorithm to stabilize the flaky
tests for Log Explorer.

Closes #165915
Closes #165916 
Closes #165975  
Closes #166016 
Closes #166672 
Closes #166675 
Closes #166817 
Closes #167058
Closes #167189 
Closes #167499 
Closes #167515  
Closes #167562 
Closes #167567 
Closes #167621 
Closes #167664 
Closes #167773

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-05 12:52:41 +02:00
Yngrid Coello
eaf77786e9
[Logs Explorer] enabling redirect link to discover ESQL (#168002)
Closes https://github.com/elastic/kibana/issues/167023.

### Changes
- `EsqlSelector` was created. This component is in charge of rendering
the `Try ESQL` button.

#### Before
<img width="1905" alt="image"
src="9ffc304f-b68c-4871-8524-1239123f5826">

#### After
<img width="1900" alt="image"
src="b95e8739-b93b-47f7-884e-519b73b2ccda">

- It works as a link, so users are able to open it in a new tab if
desired
<img width="1899" alt="image"
src="d6390ba2-5010-4ed5-99cb-4c3f6e099dfe">

- It navigates to discover in `ES|QL` mode


1f083c2d-a06f-4f0b-9cbb-5958edcb9cce

##### For serverless
<img width="1896" alt="image"
src="48712921-85f7-4848-9e71-426bded04913">

- When `discover:enableESQL` is disabled
<img width="1901" alt="image"
src="4267e03b-7b46-4477-813b-65a8a04e6329">


### Missing
UI tests will come as part of a new PR.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-04 09:05:29 -07:00
Marco Antonio Ghiani
3be21c9e56
[Log Explorer] Implement Data Views tab into selector (#166938)
## 📓 Summary

Closes #166848 

This work adds a new tab to navigate Data View from the Log Explorer
selector.
In this first iteration, when the user selects a data view, we move into
discovering preselecting and loading the data view of choice.

**N.B.**: this recording is made on a setup where I have no installed
integrations, so having the no integrations panel is the expected
behaviour.


e8d1f622-86fb-4841-b4cc-4a913067d2cc

## Updated selector state machine

<img width="1492" alt="Screenshot 2023-09-22 at 12 15 44"
src="c563b765-6c6c-41e8-b8cd-769c518932c3">

## New DataViews state machine

<img width="995" alt="Screenshot 2023-09-22 at 12 39 09"
src="e4e43343-c915-42d8-8660-a2ee89f8d595">

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-28 12:21:35 +02:00
mohamedhamed-ahmed
bb5439f4e1
[Log Explorer] Show Filter controls in compressed style (#167402)
closes https://github.com/elastic/kibana/issues/166440

This PR applies compressed style to the control group container.

<img width="699" alt="Screenshot 2023-09-27 at 14 44 51"
src="7318c0aa-c00e-44e9-9d29-f2f0deb5b791">
2023-09-27 22:18:13 +02:00
Marco Antonio Ghiani
34c084d65a
[Type checks] Fix infra obs ui typecheck (#167217)
## 📓  Summary

These changes fix the type-check issues related to infra obs UI code.
It also includes some fixes for the APM plugin that were stopping the
check step from passing.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-09-26 17:05:54 +02:00
Marco Antonio Ghiani
0743a11c57
[Log Explorer] Hide hard coded flyout actions using customization extension point (#166638)
## 📓 Summary

Closes #165217 

This work implements a new extension point in the Discover customization
framework to allow customizing the flyout content. Although it enables
customizing only the actions displayed on top, it could be enhanced for
additional flyout customizations in the future.

To keep it simple and familiar to other customizations, it relies on a
similar API as the `top_nav` customization, allowing one to disable
default actions and insert additional ones.

```ts
/**
 * Hide flyout actions to prevent rendering hard-coded actions.
 */
customizations.set({
  id: 'flyout',
  actions: {
    defaultActions: {
      viewSingleDocument: { disabled: true },
      viewSurroundingDocument: { disabled: true },
    },
  },
});
```

## 🧪 Testing 
- Navigate to `/app/observability-log-explorer` and expand the flyout
for any grid entry.
The actions on top of the flyout should not be displayed, only the title
and the pagination control should appear.
- Navigate to `/app/discover` and expand the flyout for any grid entry. 
The actions for viewing a single documents or surrounding documents
should be displayed.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-09-21 13:50:41 +02:00
Marco Antonio Ghiani
b04b07ec52
[Log Explorer] Hide Discover announcement callouts (#166835)
## 📓 Summary

Closes #166056 

This PR adds a new override to the `uiSetting` service, allowing it to
override specific UI preferences.
In this case, we'll overwrite the `hideAnnouncements` preference to be
true, so that discover-specific announcements won't be displayed for the
Log Explorer app.


50dade20-1902-4f4a-8615-3e1f7a964522

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-21 12:38:31 +02:00
Marco Antonio Ghiani
3709e772b4
[Log Explorer] Refactor into new design (#165877)
## 📓 Summary

**Main task**
Closes #165309 

**Skipped tests fixes**
Closes #165839 
Closes #165520 
Closes #166494 

This work refactors the UX for browsing integrations and uncategorized
datasets.


fadbf952-5a03-4747-b68a-29ed7e864120

## 💡 Review hints

- To reflect the UI changes, the Dataset selector state machine has been
updated as described by the chart attached.
The main difference consists of new events to navigate between tabs and
a nested history state, to keep both track of the last opened tab and,
for the integration tab, of the latest panel.

<img width="1531" alt="Screenshot 2023-09-07 at 14 26 21"
src="12da24e8-8300-4788-8382-71a4cf9748c8">



## 🧪 Tests suite

With the test updates to match the new UI, the selector tests suite now
is:
```
↳ Observability Log Explorer
   ↳ Dataset Selector
     ↳ as consistent behavior
       ↳ should always display the Integrations and Uncategorized top level tabs
       ↳ should always display the "Show all logs" action
       ↳ when open on the integrations tab
         ↳ should display an error prompt if could not retrieve the integrations
         ↳ should display an empty prompt for no integrations
       ↳ when open on the uncategorized tab
         ↳ should display a loading skeleton while loading uncategorized datasets
         ↳ should display an error prompt if could not retrieve the datasets
         ↳ should display an empty prompt for no uncategorized data streams
     ↳ with installed integrations and uncategorized data streams
       ↳ when open on the integrations tab
         ↳ should display a list of installed integrations
         ↳ should sort the integrations list by the clicked sorting option
         ↳ should filter the integrations list by the typed integration name
         ↳ should display an empty prompt when the search does not match any result
         ↳ should load more integrations by scrolling to the end of the list
         ↳ clicking on integration and moving into the second navigation level
           ↳ should display a list of available datasets
           ↳ should sort the datasets list by the clicked sorting option
           ↳ should filter the datasets list by the typed dataset name
           ↳ should update the current selection with the clicked dataset
       ↳ when open on the uncategorized tab
         ↳ should display a list of available datasets
         ↳ should sort the datasets list by the clicked sorting option
         ↳ should filter the datasets list by the typed dataset name
         ↳ should update the current selection with the clicked dataset
       ↳ when open/close the selector
         ↳ should restore the latest navigation panel
         ↳ should restore the latest search results
       ↳ when switching between tabs or integration panels
         ↳ should remember the latest search and restore its results
```

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-09-21 11:26:19 +02:00
mohamedhamed-ahmed
3d58a1da64
[Log Explorer] Add Explorer app locator (#165962)
closes https://github.com/elastic/kibana/issues/164995
closes https://github.com/elastic/kibana/issues/165618
closes https://github.com/elastic/kibana/issues/166596

## 📝  Summary

### Observability Log Explorer Locators:

This PR adds 2 new customized locators to the Observability log explorer
profile. At the moment we implemented:

       1- Single dataset selector locator
       2- All dataset selector locator

With more locators to come in the future depending on the use cases.

### Log Explorer Locators:

We also added a log explorer locator that navigates to discover, this
can be used in case the **Observability Log Explorer** plugin is
disabled.

### Logs Onboarding:

The PR also replaces the temp navigation to the default discover we
implemented for[ 8.10
here](https://github.com/elastic/kibana/pull/163218) with the above new
Observability Log Explorer locators.

### APM:

After [disabling infra plugin in serverless
projects](https://github.com/elastic/kibana/pull/165289), APM links to
infra locators in serverless have been replaced to use the above
locators.

### Observability Landing Page:

The landing page now redirects to the Log Explorer if `logs-*-*` has
data in it, otherwise the flow continues as before.

### Necessary Refactoring:

To avoid the circular dependency between `ObservabilityLogExplorer` &
`ObservabilityOnboarding` after each one using the other's locator and
importing the necessary types, I moved the type definition for all
locators in the `deeplinks` package.

##   Testing

- Onboarding Wizard in Serverless and Stateful

    1. Navigate to the onboarding flow `/app/observabilityOnboarding/`
    2. Choose either System logs or Stream log files
    3. Go through the onboarding wizard
    4. Click the Explore logs button at the end
5. You should be redirected to observability log explorer with the
integration and dataset preselected.

- APM links in Serverless

1. Navigate to APM and click on the logs links as shown in the Demos
below
2. All links should navigate to Observability Log Explorer with the
queries set in the search bar.

## 🎥 Demos

- APM Serverless


7161364e-333f-4ac4-87d5-7f1ffec699b3


- APM Stateful


058c9587-b766-4d4f-a73d-50fd381be4bb


- Onboarding Serverless



ee1cab42-f91c-4558-aa5f-4fa7e8963427

- Onboarding Stateful



a376a12b-499b-4488-a75a-d06e81f8e21d

- Observability Landing Page 



c1c084ca-b1b1-4c4b-a4e6-ae8e157dcf57

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2023-09-20 19:49:57 +02:00
mohamedhamed-ahmed
27056ca66c
[Log Explorer] Show only dataset name in dataset selector (#166703)
closes https://github.com/elastic/kibana/issues/166247

## 📝  Summary

This PR changes the display of datasets in the dataset selector so that
we only show the dataset name and not the whole index pattern.

ex: 

- `logs-foo-*` ➡️ `foo`
- `logs-bar-*` ➡️ `bar`

##   Testing
1. Navigate to the observability log explorer
2. Click the dataset selector and choose Uncategorized
3. Observe how the datasets are represented

## 🎥 Demo


8a6a1212-46d5-4ceb-bf38-cf13d1b3e555
2023-09-20 15:34:53 +02:00
Felix Stürmer
84cfac7aee
[Log Explorer] Add README for contributors (#166642)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-19 11:25:42 +02:00
Marco Antonio Ghiani
d76865787e
[Log Explorer] Update DataGrid default preferences (#165718)
## 📓 Summary

Closes #165482 
Closes #165489 

This PR apply new default preferences to the DataGrid for the Log
Explorer:
- Display and resize additional columns for `service.name (240px)` and
`host.name (320px)` fields. The column's width is taken by the average
length of those specific fields.
- Display rows with single-line height by default.

<img width="3004" alt="data_grid"
src="48d69762-969a-49a5-a6b1-fc86eeaf86a7">

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-12 10:58:38 +02:00
Marco Antonio Ghiani
1c7ac5d5de
[Log Explorer] Add Discover fallback link (#165464)
## 📓 Summary

Closes #165220 

This PR introduces a new fallback link from the Log Explorer application
to Discover.

To correctly retrieve the details required to correctly navigate to
Discover with the used data view and filters, the LogExplorer component
accepts now a new `state$` behaviour subject as a property that can be
used to notify the consumers of any change from the internal state.


c8176ef2-7a3b-4c7e-860a-450ba677412a

## 🧪 Test suite

```
↳ Observability Log Explorer
  ↳ Header menu
    ↳ should inject the app header menu on the top navbar
    ↳ Discover fallback link
      ↳ should render a button link
      ↳ should navigate to discover keeping the current columns/filters/query/time/data view
```

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-06 12:30:29 +02:00
Marco Antonio Ghiani
55936a83a1
[Log Explorer] Fix broken data grid on columns update (#165679)
## 📓  Summary

Closes #165558 

The issue was caused by a particular condition caused by the overridden
`data` service that the plugin injects in the Discover App.
Reverse engineering from the blank screen when updating the columns:
1. The `DiscoverHistogramLayout` is rendered conditionally only [when a
`searchSessionId`
exists](https://github.com/elastic/kibana/blob/main/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.tsx#L47).
2. The `searchSessionId` is initialized with a default value and exists
until [the `data.search.session.clear()` function is
invoked](https://github.com/elastic/kibana/blob/main/src/plugins/discover/public/application/main/discover_main_app.tsx#L82).
3. Being this effect cleanup callback is invoked when
`data.search.session` changes in its reference, the issue is caused by
the [injected
service](https://github.com/elastic/kibana/blob/main/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx#L52-L62).
4. The root cause is that each time a property is read from the proxied
`data` service, new nested Proxies are created, triggering the useEffect
cleanup function since the new Proxy has a new reference.

The implemented solution adds an enhanced version of
`createPropertyGetProxy` that keeps the created proxy as a singleton,
storing the original value in a cache by a passed key.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-09-06 10:46:13 +02:00
Felix Stürmer
ad59308b24
[Log Explorer] Convert log explorer profile into standalone app (#164493)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2023-08-31 14:18:44 +02:00