Commit graph

73487 commits

Author SHA1 Message Date
Elena Stoeva
8cc0bb6629
[DOCS] Adding a known issue for 8.13 and 8.12 (#180971)
## Summary

This PR adds a known issue to the 8.13 and 8.12 release notes regarding
the `allow_auto_create` field incorrectly set to `false` in the Index
Templates form.

<img width="769" alt="Screenshot 2024-04-17 at 08 14 02"
src="4bba4879-3522-4fb4-81de-8da34b8794fd">


Original issue: https://github.com/elastic/kibana/issues/177938
PR with a fix: https://github.com/elastic/kibana/pull/178321 (The PR was
backported to 8.13 but unfortunately the build failed on the backport PR
and we missed that. So the fix should come out in the next scheduled
release, which is 8.14).


<!--
### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
-->
2024-04-17 13:31:10 +01:00
Panagiota Mitsopoulou
3922bccfc0
[SLO] Add group by remote in SLO Overview embeddable (#181006)
Fixes https://github.com/elastic/kibana/issues/181005
Fixes https://github.com/elastic/kibana/issues/181014

This PR adds the group by remote option in the SLO Overview embeddable.
It also fixes a bug with filtering in a grouped view, which would return
no results (both in SLO Overview page and SLO Overview embeddable).

## How to test

**Scenario**: User wants to have an embeddable in their Dashboard with
all SLOs grouped by remote

**Given** user has enabled Remote cluster under SLO Settings in SLO
Overview page
**And** in the Dashboard app they add an SLO Overview Embeddable
**And** they select to group by `Remote` without any extra filtering

**When** they click Save

**Then** They should see all the remote clusters
**And** when they click on the remote cluster they should see the
respective SLOs in the expanded accordion


41162e27-2901-40e1-b704-11c89a6c0fd2



**Scenario**: User wants to have an embeddable in their Dashboard with
all SLOs grouped by a **specific** remote

**Given** user has enabled Remote cluster under SLO Settings in SLO
Overview page
**And** in the Dashboard app they add an SLO Overview Embeddable
**And** they select to group by `Remote`
**And** they select a specific remote cluster from the list of remote
clusters

**When** they click Save

**Then** They should see all the remote clusters
**And** when they click on the remote cluster they should see the
respective SLOs in the expanded accordion

**Before**


b900f8d9-f414-4550-ac65-a1d7bbf9e7b4


**After**


f887342b-9afe-43e9-9795-6c2ae42f413e


**Scenario**: User wants to apply extra filtering to the Grouped
Overview page

**Given** user has grouped by Tags in the SLO Overview page
**And** they want to see only the healthy SLOs

**When** they type `slo.tags: "production"`

**Then** They should see only the production group
**And** when they click on the production group they should see the
respective SLOs in the expanded accordion



bf010cad-42da-476d-9f63-b7a1d6f4295f
2024-04-17 05:14:57 -07:00
Tomasz Ciecierski
1d88277120
[EDR Workflows] Unskip tests failing due to new alerts popover (#180870) 2024-04-17 13:54:48 +02:00
Jean-Louis Leysens
29fb11b358
[HTTP/OAS] @kbn/router-to-openapispec (#180683)
## Summary

Introduces a new package for generating OAS from Kibana's routers. This
first iteration includes:

* E2E conversion of Core's `Router` and `CoreVersionedRouter` routes
into a single OAS document (not written to disk or shared anywhere
yet...)
* Support for
[`$ref`](https://swagger.io/docs/specification/using-ref/?sbsearch=%24ref)
by introducing the `meta.id` field `@kbn/config-schema`'s base type.
This is intended to be used only response/request schemas initially.

## TODO

- [x] More unit tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-17 04:03:16 -07:00
Cristina Amico
05512f43ca
[Fleet] Fix cancel action in log level select (#181007)
## Summary
Part of https://github.com/elastic/kibana/issues/158861
https://github.com/elastic/kibana/pull/180607 added a new log level
selector in Agent Policy settings. However there were some small bugs
with it. This PR addresses all of them:

- Extra dot in copy text
- A broken link was displayed - Made this link optional
- When clicking "Cancel", all the other fields on the page reset back to
their original values but the log level doesn't. The reason is the no
default was set for the select

### Before
![image
(19)](bc310642-5425-4413-8cfa-aff03557f2eb)

### After
![Screenshot 2024-04-17 at 10 50
04](30fc6797-7297-496e-9ec7-209e04a44bba)


### Testing 
- Enable `hidden: false`
[here](bc9cd862f0/x-pack/plugins/fleet/common/settings/agent_policy_settings.ts (L133))
- Change the log level and then click "cancel" on the bottom of the
page, it should reset back to the default value ("info" if the policy is
new, the previous saved value if the policy already had this value set)
- No extra dot and link should be visible
2024-04-17 03:55:54 -07:00
Carlos Crespo
bbc77a857c
[Infra] Fix esArchiver calls in before and after functions (#180928)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5696
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5697
2024-04-17 12:35:44 +02:00
Julia Bardi
b4afac91c7
[Fleet] use lowercase dataset in template names (#180887)
## Summary

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

See repro steps in linked issue. Using lowercase dataset name in
template/pipeline names solves the issue with the upgrade.
Will do more testing to make sure the lowercase naming doesn't cause any
issue with agent ingesting.

Verification:
- Tested locally by using a custom log path `/var/tmp/test.log` with a
few lines of logs on a multipass vm.
- Enrolled an agent and verified that the data is going to the
`logs-test` data stream.
- The integration policy is created on Custom Logs version 1.1.2 with
`dataset:Test` and upgraded to 2.3.1.
- The component, index template and ingest pipeline is using a lowercase
`logs-test` prefix.

<img width="1787" alt="image"
src="979d77d3-ba11-4d96-9870-5488c57d7aaf">

<img width="1033" alt="image"
src="3c871462-0498-4b2f-836f-d4b84ac4cf46">

<img width="915" alt="image"
src="e5d34264-650c-4313-b5f6-ff44b0af171d">



### Checklist

- [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
2024-04-17 12:34:59 +02:00
Yan Savitski
c9c0444ac9
[Search][Playground] Support Bedrock LLM (#180527)
- [x] Add bedrock models to FE
- [x] Add playground feature flag to bedrock connectors feature
- [x] Support bedrock models on server side using ActionClientLlm

<img width="343" alt="image"
src="207101ca-d6b0-448a-b3c4-d894195ccb1c">

---------

Co-authored-by: Joseph McElroy <joseph.mcelroy@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-17 03:28:10 -07:00
Alexey Antonov
b7b0cb2263
fix: [Alerts > Landing][AXE-CORE]: Form elements must have labels (#180798)
Closes: https://github.com/elastic/security-team/issues/8577

### Description
The [axe browser plugin](https://deque.com/axe) is reporting the Alert
landing data grid checkboxes do not have accessible labels. Screenshot
attached below.

### Steps to recreate

1. Open the [Alerts landing
page](https://kibana.endpoint.elastic.dev/app/security/alerts?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27,%27filebeat-*%27,%27logs-*%27,%27packetbeat-*%27,%27winlogbeat-*%27)))&filters=!((%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,key:kibana.alert.rule.execution.uuid,negate:!f,params:(query:%2750cd1424-87b7-42ae-ab3e-b4b111c0504e%27),type:phrase),query:(match_phrase:(kibana.alert.rule.execution.uuid:%2750cd1424-87b7-42ae-ab3e-b4b111c0504e%27))))&timerange=(global:(linkTo:!(),timerange:(from:%272024-02-05T18:05:33.666Z%27,kind:absolute,to:%272024-02-07T18:05:33.666Z%27)),timeline:(linkTo:!(),timerange:(from:%272024-02-05T17:39:36.717Z%27,kind:absolute,to:%272024-02-06T17:39:36.717Z%27)))&timeline=(activeTab:query,graphEventId:%27%27,isOpen:!f)&pageFilters=!((exclude:!f,existsSelected:!f,fieldName:kibana.alert.workflow_status,selectedOptions:!(),title:Status),(exclude:!f,existsSelected:!f,fieldName:kibana.alert.severity,selectedOptions:!(),title:Severity),(exclude:!f,existsSelected:!f,fieldName:user.name,selectedOptions:!(),title:User),(exclude:!f,existsSelected:!f,fieldName:host.name,selectedOptions:!(),title:Host)))
2. Run the axe scan from Chrome or Firefox dev tools to verify the data
grid checkboxes need accessible labels

### What was done?: 

1. `aria-label` attribute was added for `BulkActionsRowCellComponent`

### Screen: 

<img width="846" alt="image"
src="d67d3189-7dea-4ab0-9e3e-caaa2c7d00f7">
2024-04-17 13:11:53 +03:00
Anton Dosov
b15f3925dc
[Reporting] Fix soft disable reporting error (#180950)
## Summary

fix https://github.com/elastic/kibana/issues/179524

I think we got this regression when we moved reporting code around
packages.
I assume the `error instanceof
errors.InsufficientMemoryAvailableOnCloudError` check doesn't work
because the error was thrown in screenshoting plugin using its instance
of `errors.InsufficientMemoryAvailableOnCloudError` but the check
happens in reporting plugins using a different instance of
`errors.InsufficientMemoryAvailableOnCloudError`. The fix is to check
the error type by `name`, interesting that for other type of errors we
already had `name` check in place
2024-04-17 12:06:33 +02:00
Dzmitry Lemechko
5942fb9fef
[chore] bump chromedriver to 123 (#181002)
## Summary

Updating chromedriver to support running tests on Chrome v124
2024-04-17 11:28:37 +02:00
jennypavlova
8458ab513f
[Infra] Add second-level navigation items to Kibana's global search (#180968)
Closes #176994

## Summary

This PR adds Hosts and Inventory to the global search (now not only in
serverless)


![image](1829b975-fcba-40c9-b7b2-4f03acf4d4b5)
2024-04-17 11:23:00 +02:00
Alex Szabo
507986e9db
[BK] Migrate buildkite batch 5 (unsupported ftr / flaky test runner) (#180403)
## Summary

Validation:
 - [x] RREs checked locally
 - [x] Pipelines staged
- [x] Unsupported FTRs:
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/30
(expecting similar errors with the same parameterization of
[this](https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/14597#018ec7ff-2ab8-4cd2-a533-00aec6287e88))
- [x] Flaky test runner:
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/35
 - [x] Considerations for 
- [x] 7.17:
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/46
(PR: https://github.com/elastic/kibana/pull/180575)
- [x] 8.13:
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/43
(PR: https://github.com/elastic/kibana/pull/180602)

Backporting should be done manually, as the auto-backports will easily
fail.

Part of: https://github.com/elastic/kibana-operations/issues/79
Migrates: 
- kibana / on merge unsupported ftrs
[kibana-on-merge-unsupported-ftrs.yml](https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs)
- kibana / flaky-test-suite-runner
[kibana-flaky.yml](https://buildkite.com/elastic/kibana-flaky-test-suite-runner)
2024-04-17 11:13:15 +02:00
Pablo Machado
0840c64d67
[SecuritySolution] Fix global timerange test on serverless (#180919)
## Summary

Fix and enable entity analytic cypress tests


flaky test run
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5694
🟢
2024-04-17 10:04:35 +01:00
Wafaa Nasr
d01a5c4fe0
[Detection Engine][Rule Suppression] Add Suppression to EQL Non-sequence based queries (#176422)
# Summary

- Address adding suppression to EQL rules
https://github.com/elastic/security-team/issues/7773
- Milestone details https://github.com/elastic/security-team/issues/8432

## Checklist
- [x] Functional changes are hidden behind a feature flag. If not
hidden, the PR explains why these changes are being implemented in a
long-living feature branch.
- [x] Functional changes are covered with a test plan and automated
tests. [Test plan](https://github.com/elastic/security-team/pull/9155)
- [ ] Stability of new and changed tests is verified using the [Flaky
Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner) in
both ESS and Serverless. By default, use 200 runs for ESS and 200 runs
for Serverless.
* Cypress ESS:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5686
* Cypress Serverless:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5687
* FTR ESS:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5688
* FTR Serverless:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5689
- [x] Comprehensive manual testing is done by two engineers: the PR
author and one of the PR reviewers. Changes are tested in both ESS and
Serverless.
- [x] Mapping changes are accompanied by a technical design document. It
can be a GitHub issue or an RFC explaining the changes. The design
document is shared with and approved by the appropriate teams and
individual stakeholders.
- [ ] (OPTIONAL) OpenAPI specs changes include detailed descriptions and
examples of usage and are ready to be released on
https://docs.elastic.co/api-reference. NOTE: This is optional because at
the moment we don't have yet any OpenAPI specs that would be fully
"documented" and "GA-ready" for publishing on
https://docs.elastic.co/api-reference.
- [x] Functional changes are communicated to the Docs team. A ticket is
opened in https://github.com/elastic/security-docs using the [`Internal
documentation request (Elastic
employees)`](https://github.com/elastic/security-docs/issues/new?assignees=&labels=&projects=&template=docs-request-internal.yaml&title=%5BRequest%5D+)
template. The following information is included: feature flags used,
target ESS version, planned timing for ESS and Serverless releases.
- [x] Check if in timeline we can show the suppression count column when
the user clicks on investigate on timeline for Eql suppressed Alerts
(https://github.com/elastic/kibana/issues/180976)

## Related Issues
* Sub-PRs
- Address EQL schema changes PR
https://github.com/elastic/kibana/pull/176391
- Adding Feature flag PR and updating the Frontend Part in Rule
Create/Edit https://github.com/elastic/kibana/pull/176398
- Adding Backend changes and FTR tests
https://github.com/elastic/kibana/pull/176597
- Fix Investigate in Timeline for the Suppressed Alerts
https://github.com/elastic/kibana/pull/177839
- Add Cypress e2e tests https://github.com/elastic/kibana/pull/177870
- Disable EQL sequence suppression in the UI and fix Cypress `after`
esArchive path https://github.com/elastic/kibana/pull/178531
- Docs Issue https://github.com/elastic/security-docs/issues/4977
- Test plan https://github.com/elastic/security-team/pull/9155

## Screenshots/recordings

### Non-Sequence Suppression

1. Rule creation, Suppression based on a single value


8d168bce-15d3-45c2-a5dc-238b3ac01626

2. Rule creation, Suppression based on an array of values
  

0e3312a9-4eae-476b-9c1e-c68189bbaf95

3. Investigate In Timeline


e10c8668-4d5b-4748-b8a1-678603b4a8a5


### Disabled Sequence Suppression

1. UI


01faa649-ca8b-43e4-a398-42ab242e7a72

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2024-04-17 10:38:25 +02:00
Antonio
434919ea5c
[Cases] Fix failing test: useActionTypes should show a toast error message if failed to fetch. (#180882)
Fixes #178760

## Summary

- `useQuery` expects `fetchActionTypes` to return a promise so I changed
an instance of `mockImplementation` in the tests to `mockRejectedValue`.
- Increased the `waitForNextUpdate` timeout value.
2024-04-17 10:34:11 +02:00
Antonio
828dd55398
[Cases] Fix failing test: Severity form field renders (#180909)
Fixes #176336

## Summary

The only thing I could find in the test was a bunch of unnecessary DOM
searches. This is one of the most expensive operations in tests so I:
1. Converted the 3 redundant
`findByTestId('options-filter-popover-button-severity')` into just 1.
2. Did a single `findAllByRole('option')` instead of a search for every
single value + a search for all to guarantee length was 4.

Locally the test duration was reduced from 300ms to 150+-. Let's see how
it behaves in the pipeline.
2024-04-17 10:33:49 +02:00
Julia Rechkunova
80e14ce769
[Discover] Unskip serverless alerts tests (#180913)
- Closes https://github.com/elastic/kibana/issues/180311
- Closes https://github.com/elastic/kibana/issues/180305

25x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5693
25x more
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5698

Also going to close other tickets as these tests are a part of the same
test suit and the flaky test runner finished green with all of them:
- Closes https://github.com/elastic/kibana/issues/172365
- Closes https://github.com/elastic/kibana/issues/172366
- Closes https://github.com/elastic/kibana/issues/180100
- Closes https://github.com/elastic/kibana/issues/180101
2024-04-17 10:03:57 +02:00
Yngrid Coello
7ff00882a0
[Dataset quality] Split integration request from dataStreamStats (#180560)
Relates to https://github.com/elastic/kibana/issues/179638.

## 📝 Summary

This PR is all about decoupling `integrations` from `DataStreamStats`
request.
This change is needed in order to render dataset quality table from only
`DegradedDocsStats` or `DataStreamStats`, this will allow us to show the
users the information as soon as it arrives, also will help us to
introduce soonish states according to user privileges.

### Changes

- New internal endpoint `GET /internal/dataset_quality/integrations`
that will return all the installed integrations that are of a specific
type, e.g. `logs`.
- Generating datasets when integrations request has finished, so we
render the integration information correctly and show the information
available: dataStreamStats and/or degradedDocs.

### App statechart

<img width="949" alt="image"
src="3548d3e8-f99c-4d79-86af-4926dfec7b5e">

### Demos
#### dataStreamStats taking longer to resolve


c1127ec2-2cfe-4796-a331-47a3ef718e98

#### degradedDocs taking longer to resolve


b6f9954f-8e2b-445f-89a5-b6d213abe4b1

#### dataStreamStats and degradedDocs loading


e7987657-41cd-4cfc-b24e-6ad47aed0df1

#### Integration request failed but we still show information related to
datasets


965558f3-4660-47e9-a7a1-068491e08a8a
2024-04-17 09:52:41 +02:00
Kibana Machine
07706fd8e5
[api-docs] 2024-04-17 Daily api_docs build (#180991)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/676
2024-04-17 05:51:23 +00:00
Ignacio Rivas
806c717e38
[Ingest pipelines] Group processors by category (#180767) 2024-04-17 07:16:48 +02:00
Drew Tate
3c1a22a3e4
[ES|QL] always run query validation unless there are errors from server (#180977)
## Summary

Fixes https://github.com/elastic/kibana/issues/179966
2024-04-17 06:00:49 +01:00
Drew Tate
3551b2b200
[ES|QL] max and min accept date fields (#180945)
## Summary

`max` and `min` accept date fields. This updates the validator and
autocomplete to reflect this!

<img width="500" alt="Screenshot 2024-04-16 at 8 53 18 AM"
src="1c363b1a-c390-4eda-a4fc-615bea66c0a2">

_`min` gets date fields_

<img width="500" alt="Screenshot 2024-04-16 at 8 53 08 AM"
src="4ed09a71-d84c-4a2f-a8e0-d2fcc362ee94">

_`avg` does not_

### Checklist

- [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
2024-04-17 05:54:00 +01:00
Tiago Costa
c780bc4066
skip flaky suite (#180982) 2024-04-17 00:07:29 +01:00
Tiago Costa
b773680f67
skip flaky suite (#180641) 2024-04-17 00:05:57 +01:00
Rachel Shen
9579635c25
[Share Modal Redesign] Reporting Refactor Modals (#180009)
## Summary

This PR refactors https://github.com/elastic/kibana/pull/179206 to have
each export type be registered in Reporting and then passed into the
share plugin.

This PR is focused on the redesign in terms of the export modals. Test
refactoring will be done in a separate PR.
Partially closes https://github.com/elastic/kibana-team/issues/753

- [x] Need to refactor this PR to include @eokoneyo's general modal
component
- [x] Lens needs to have Export with all three report type options - to
avoid circular dependencies move the Lens CSV stuff into the reporting
plugin vs having it in Lens
- [x] Canvas should not be affected by these changes (so the old
share/reporting code has to stay for canvas)
https://github.com/elastic/kibana/issues/151523 to keep in mind for the
redesign

Failed tests will be covered in this PR
https://github.com/elastic/kibana/pull/180406


### TO TEST 

Mark `share.new_version.enabled: true` in your kibana.dev.yml


### 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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Eyo Okon Eyo <eyo.eyo@elastic.co>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
2024-04-16 15:01:44 -07:00
Alejandro Fernández Haro
e661eea406
Fetch Snapshot telemetry on UI nodes only (#180833)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-16 23:25:07 +02:00
Samiul Monir
89321dc0ab
[Playground] Handle Error Message (#180857)
## Summary

This PR includes
- Returns error message as `bad request`
- Display the error message as chat messages
- Disable question box and `send` button when `regenerating` responses.
- Invalid form if prompt is empty
- Fix an issue with `no source fields found`

![Screenshot 2024-04-15 at 6 03
23 PM](05c0473b-a8fb-4a0c-bc5c-a5e08cd29143)


### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-16 17:22:35 -04:00
Tiago Costa
bbe704dfa9
skip flaky suite (#180981) 2024-04-16 21:57:27 +01:00
Shahzad
09cc4ac9a7
[Uptime alerts] Add monitor config id to context (#180921)
## Summary

This is needed where users want to generate links to synthetics monitors
using uptime alerts !!

### Example usage 

<img width="625" alt="image"
src="4f2f7833-9313-4c3a-8ea0-a383cb2ec857">


<img width="956" alt="image"
src="10541a9c-987b-427c-a55e-4e0ba01891cf">
2024-04-16 16:54:05 -04:00
Melissa Alvarez
fa90d2fcdd
[ML] Single Metric Viewer embeddable: show error message when insufficient permissions (#180858)
## Summary

When the user does not have enough permissions, ensures that the single
metric viewer panel in dashboards shows an error message (similar to the
other ML dashboard panels) instead of just being blank.

Before:

![Screenshot 2024-04-15 at 09 45
44](b0c6d180-4a0b-42dd-89e3-52206759d98e)


After:

<img width="1201" alt="image"
src="3a38dab9-da9a-48d0-8479-515f28b92329">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2024-04-16 14:39:50 -06:00
Cauê Marcondes
b900b86c1b
[ProfilingxAPM] Link APM from Profiling UI (#180677)
closes https://github.com/elastic/kibana/issues/178719

A new ES API has been created to support linking APM from the Profiling
UI. It's called `topN/functions`. The new API allows grouping fields. So
we first fetch functions grouping by `service.name` and when the user
opens the APM Transactions we make another request grouping by
`transaction.name`.

A new Advanced setting was created to toggle the old API on (fetch
functions from Stacktraces API): It's turned off by default.
<img width="1235" alt="Screenshot 2024-04-12 at 10 39 36"
src="ee6e7731-2f44-43ca-9793-23ba87e22e6e">

When there are services on the selected function:
*If we cannot find the transaction, we show `N/A`.
<img width="933" alt="Screenshot 2024-04-12 at 10 16 34"
src="2c5dbf60-3a47-4f4c-a46d-8a0984e0e482">

When there are **no** services on the selected function:
*hide the APM transactions section
<img width="921" alt="Screenshot 2024-04-12 at 10 59 14"
src="3fc4c5b1-da62-47c8-97a8-8bcbd1ae1b75">

--
Performance boost:
The new API is faster than the Stacktraces API, especially because
there's no logic on the Kibana side.
Stacktraces API:
<img width="1210" alt="Screenshot 2024-04-12 at 10 50 26"
src="158d73d1-ed91-4652-97c1-c7c3328d5e3d">

TopN/Functions API:
<img width="1195" alt="Screenshot 2024-04-12 at 10 51 20"
src="2de4ef46-eb8a-4557-b7b8-a1c2fed6fd8a">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-16 13:28:14 -07:00
Julia Rechkunova
d769242c37
[Discover] Fix customization flaky test (#180940)
- Closes https://github.com/elastic/kibana/issues/177401

25x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5695
2024-04-16 15:09:08 -05:00
Julia Rechkunova
61841294b6
[Discover] Update sidebar flaky tests (#180724)
- Closes https://github.com/elastic/kibana/issues/180564
- Closes https://github.com/elastic/kibana/issues/180693

25x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5671
2024-04-16 15:05:03 -05:00
Abdul Wahab Zahid
09155fa299
[Dataset quality] Add Breakdown field on Degraded Docs visualization (#180652)
Adds the Breakdown field to Degraded Docs Visualization. 

The PR exposes the `BreakdownFieldSelector` from
**@kbn/unified-histogram-plugin** as a similar visualization behaviors
and actions are needed on the Dataset Quality flyout as with Logs
Explorer.

<img width="1242" alt="Screenshot 2024-04-12 at 04 00 06"
src="0e34397a-ac56-4a2b-8483-94c96dcbf3c2">
2024-04-16 21:40:49 +02:00
Umberto Pepato
7b281d813e
[RAM] Stack alerts page fixes and improvements (#180368)
## Summary

- Renames `GlobalAlertsPage` to `StackAlertsPage` to better account for
the change in scope
- Renames the `triggerActionsUi.globalAlertsPage` flag to
`triggerActionsUi.stackAlertsPage`
- Toggles the flag on by default
- Updates the tech preview badge to match the other badges used across
triggers_actions_ui
- Fixes the feature cell rendering logic not displaying Observability
alerts correctly
- Other small fixes and improvements

## To verify

1. Navigate to the `Stack management > Alerts` page (the page should now
be visible without a the feature flag turned on manually)
2. Check that the tech preview badge appears correctly and shows the
tooltip on hover
3. Check that Observability alerts show an `Observability` badge in the
`Feature` column
2024-04-16 12:37:33 -07:00
Steph Milovic
7bd8815301
[GenAI Connectors] Fix AbortSignal implementation (#180855)
## Bugs Fixed

1. The OpenAI `invokeAI` method did not properly handle `signal`
2. Bedrock did not have a `signal` implementation at all 😳

## Summary

In my [LangChain streaming
PR](https://github.com/elastic/kibana/pull/174126), I poorly implemented
a fix to stop the stream on the server when "Stop generating..." was hit
on the client. I did this by piping through an `AbortSignal` to
`invokeStream`/`invokeAsyncIterator` subactions. However, in the
`invokeAI` subaction I did not properly remove `signal` before
`JSON.strinigfy`ing the body, so the below error was happening in the
security non-streaming implementation. Additionally, for Bedrock I
somehow only implemented `signal` in part of the type and nothing else,
so token tracking would be off when Stop generating button is hit 🤦

<img width="1376" alt="Screenshot 2024-04-15 at 2 00 38 PM"
src="e57241d9-9fd2-4dd3-bb3a-72a7c61a3d4b">


## To test

1. Turn off streaming in the Security AI Assistant and select an OpenAI
connector (LangChain off)
3. Send a message
4. Ensure expected results (prior the above error would occur)

The test of the Bedrock connector will be harder to confirm. Where the
issue would show up would be subtle, in the token counter. Before I
implemented the signal in the Bedrock connector, if you ask Bedrock to
repeat a word 100 times with streaming enabled, and then hit "Stop
generating..." after 10 words, you would see a token count for
`completion_tokens` be equivalent to ~100 tokens as the full response
would have "streamed" on the server. After this bug fix, if you hit
"Stop generating..." after 10 words, you will see a token count for
`completion_tokens` be equivalent to ~15 tokens as it takes a second for
the `abort()` to reach the server. To be clear, this bug would not have
shown in persistent storage because we call abort in
`handleStreamStorage` ASAP instead of relying on axios to complete its
abort.
2024-04-16 13:23:14 -06:00
Patryk Kopyciński
b53624d472
Add Security AI assistant settings to the Stack management (#176656)
## Summary

<img width="3005" alt="Zrzut ekranu 2024-04-2 o 22 58 37"
src="f7814891-d018-45e6-96a2-3da3321d56fd">

<img width="3006" alt="Zrzut ekranu 2024-04-2 o 22 58 45"
src="a1ec8d96-b48e-4f57-9a6c-3f1823d164f1">

<img width="3007" alt="Zrzut ekranu 2024-04-2 o 22 58 54"
src="f67fc0f0-b28c-40c8-8b25-5a180c115610">

<img width="3005" alt="Zrzut ekranu 2024-04-2 o 23 38 32"
src="e79631ea-c87c-4dd1-8fe6-c5d257cf2fe7">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
Co-authored-by: Tomasz Ciecierski <tomasz.ciecierski@elastic.co>
2024-04-16 12:15:11 -07:00
Quynh Nguyen (Quinn)
4546d274e8
[ML] Adds query history and improves performance for ES|QL Data visualizer (#179098)
## Summary

This PR adds query history (see
https://github.com/elastic/kibana/issues/179672) and improves
performance for ES|QL Data visualizer

![Screenshot 2024-04-15 at 11 53
27](eed6cc9b-c7be-4bfd-bc2c-b0241d8f34ac)



It:
- Adds drop_null_column=true to reduce making aggregations on empty
fields
- Adds better support for geo point/geo shape maps where time field is
not defined in the data view, but '@timestamp' does exist
- Adds a new Top sampled values to match with the unified field list
popover in Discover
- Removes ES|QL link from search bar if not enabled
![Screenshot 2024-04-15 at 11 57
29](23df6ac0-f584-4491-a57e-59812b195b45)
- Closes https://github.com/elastic/kibana/issues/180072

[Flaky test suite
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5699#018ee80e-3ebf-4d9b-ab79-c8013f3f4c1d)...
25/25 successful runs 

### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-16 14:04:38 -05:00
Matthew Kime
20af76f331
[data views] move exclude tiers logic to a more central location (#180741)
## Summary

Exclude tiers function wasn't working for alerting and other server side
data view usage. This PR moves the tier exclusion code to a more central
location so it will apply in ALL circumstances, not just REST API
requests for fields.

There are three places that call the IndexPatternsFetcher - the
fields_for_wildcard API, the fields API, and the IndexPatternsApiServer
for server side field loading.

Oh, `x-pack/plugins/alerting/server/routes/suggestions/fields_rules.ts`
calls IndexPatternFetcher too. And some rules, which don't need this
functionality. IndexPatternsFetcher is used in more places than I knew /
intended.

Closes https://github.com/elastic/kibana/issues/180675
2024-04-16 13:53:05 -05:00
Paul Tavares
28d71486ab
[Connectors] Add support to SentinelOne connector for Security Solution get-file response action (#180637)
## Summary

Changes done in SentinelOne connector in support of Security Solution
`get-file` response action (forthcoming):

- Added `fetchAgentFiles()` sub-action
- Added `downloadAgentFile()` sub-action
- Added `getActivities()` sub-action
- Improved error messages for SentinelOne API failures
- Added `logger.debug()` to Sub-Actions connector `validateResponse()`
to output data that failed validation
2024-04-16 14:43:46 -04:00
Steph Milovic
f002b8f1ac
[OpenAI connector] Fix OpenAI node package url (#180955)
## Summary

Fixes a bug with OpenAI (not azure) connectors when used with
`invokeAsyncIterator`:

```
ActionsClientChatOpenAI: an error occurred while running the action - Unexpected API Error: - 404 Invalid URL (POST /v1/chat/completions/chat/completions)
```

Our current default url for OpenAI connectors is
`https://api.openai.com/v1/chat/completions`

When using the `invokeAsyncIterator` subaction, we use the OpenAI node
package. This takes the url as an argument to instatiate. It wants the
URL of OpenAI, not the completions endpoint which is our default.

Looking back, I wish we had made the default url
`https://api.openai.com/v1`. However, because we want to support
existing connectors I think we should keep this the default and remove
the endpoint from the url when it is passed to the OpenAI node package.

### To test

Send a message in Security Assistant with an OpenAI (not azure)
connector with streaming enabled. Observe a successful response.

### Note to docs team

@elastic/security-docs We should call this out. If a user has an open
source OpenAI connector with a chat completions endpoint that does not
have the same structure as OpenAI's ending in `/chat/completions`, their
full endpoint url will be used with LangChain OpenAI Streaming
implementations. For example, if a user had a url like
`https://mycustomllm.com/execute/completions` and tries to use the the
Security Assistant with Knowledge Base on and Streaming on, they may get
this error:

```
ActionsClientChatOpenAI: an error occurred while running the action - Unexpected API Error: - 404 Invalid URL (POST /execute/completions/chat/completions)
```

We should instruct them to follow the same route structure as OpenAI.
Their endpoint needs to end in `/chat/completions`
2024-04-16 12:28:30 -06:00
Umberto Pepato
448d42bc34
[RAM] Move alerts filter controls to @kbn/alerts-ui-shared package (#179243)
## Summary

Moves Security's alerts filter controls bar implementation to the
`@kbn/alerts-ui-shared` package for re-use in the Stack alerts (unified)
page and Observability solution (separate PR).

<img width="1339" alt="image"
src="986e984a-0290-4980-859b-9d6e02ef335f">

## To verify

1. Enable the Stack alerts page feature flag:

    ```yaml
    # config/kibana.dev.yml
    
    xpack.trigger_actions_ui.enableExperimental:
      - globalAlertsPage
    ```
2. Create some Stack/O11y rules that fire some alerts
3. Navigate to `Management > Stack management > Alerts`, you should see
the new controls below the KQL bar.
4. Check that the filters apply correctly and reflect on the table
results
5. Check that the filter controls can be customized (`••• > Edit
controls`, add/remove controls, save)
6. Check that the customized configuration persists across reloads
7. Check that the filter controls can be temporarily overridden through
the URL param `filterControls`
8. Check that when the filters are overridden through the URL, a notice
is shown to the user with CTAs to discard/save the temporary filter
configuration
---
1. Navigate to `Security > Alerts > Manage rules`
2. Create one or more security rule that fire alerts
3. Go back to the security alerts page
4. Repeat steps 4-8

Closes #176711

---------

Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jatin Kathuria <jtn.kathuria@gmail.com>
2024-04-16 18:39:30 +01:00
Tim Sullivan
6d1a347b0c
[ResponseOps] Remove usage of deprecated React rendering utilities (#180521)
## Summary

Partially addresses https://github.com/elastic/kibana-team/issues/805

Follows https://github.com/elastic/kibana/pull/180098

These changes come up from searching in the code and finding where
certain kinds of deprecated AppEx-SharedUX modules are imported.
**Reviewers: Please interact with critical paths through the UI
components touched in this PR, ESPECIALLY in terms of testing dark mode
and i18n.**

This focuses on code within Response Ops.

<img width="1107" alt="image"
src="c0d2ce08-ac35-45a7-8192-0b2256fceb0e">

### Checklist

Delete any items that are not applicable to this PR.

- [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
- [ ] 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))
- [ ] 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>
2024-04-16 10:28:58 -07:00
Tim Sullivan
119e110d7c
[Stack Management] Remove usage of deprecated React rendering utilities (#180331)
## Summary

Partially addresses https://github.com/elastic/kibana-team/issues/805

Follows https://github.com/elastic/kibana/pull/180003

These changes come up from searching in the code and finding where
certain kinds of deprecated AppEx-SharedUX modules are imported.
**Reviewers: Please interact with critical paths through the UI
components touched in this PR, ESPECIALLY in terms of testing dark mode
and i18n.**

This focuses on code within Stack Management.

<img width="1107" alt="image"
src="c0d2ce08-ac35-45a7-8192-0b2256fceb0e">

### Checklist

Delete any items that are not applicable to this PR.

- [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
- [ ] 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))
- [ ] 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>
2024-04-16 10:23:05 -07:00
Søren Louv-Jansen
abec38e337
[Obs AI Assistant] Improve context for contextual insights components on alert details page (#180766)
This adds an API call to the contextual insights component which should
improve the relevance of the responses by providing more context to the
LLM.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
2024-04-16 19:09:04 +02:00
Kevin Qualters
91c8270aea
[Response Ops] [Alerts table] Cell context alert table performance (#180016)
## Summary

This pr makes use of a new prop (and some generic memoization fixes) in
2 eui prs merged recently (https://github.com/elastic/eui/pull/7556 and
https://github.com/elastic/eui/pull/7374) to improve the performance of
the alerts table. Mainly, the cellContext prop is now available to
consumers of the triggersActionsUi alerts table to pass in custom props
in a way that allows the renderCellValue/rowCellRender functions of the
various EuiDataGrid prop apis to remain referentially stable across
re-renders. There are also some various changes to various hooks and
props found throughout plugins that use the table to improve
performance. There should be no change in functionality, just a moderate
to substantial reduction in time the app spends rendering the alerts
table in various scenarios. Below will be some react dev tools
performance profiles, main compared to this branch, with the exact same
set of generated data.

Main, switching from 10-100 rows:

![main_alerts_table](6b87093f-5b1b-4d22-8e23-ccc3406317f4)

This branch 10-100 rows:

![context_alerts_table](75bf5d53-045d-42ae-979a-e52d6c0f8020)

Pretty modest gain here, 1 render is slower than any others on main, but
overall less time spent rendering by about a second.

Main, opening the cell popover on 2 cells

![main_open_cell_popover](60c5d132-b526-4859-a29c-5d3157142d50)

This branch, opening cellpopover

![context_open_cell_popover](2c60b250-6a9f-44b4-aec8-f9dcb8c87531)

Again nothing crazy here, modest improvement.

Main opening timeline and hitting refresh


![main_open_timeline](7525200d-cf9b-4f43-9f24-43f314740db1)

This branch, opening timeline and hitting refresh


![context_open_timeline](efd3cf95-a81a-4933-b310-fa61de24258f)

This is the case that brought this about in the first place, as security
solution shares a lot of code between tables, the alerts table
recreating all cells on every render was destroying performance of the
timeline rendering in a flyout/modal while users were on alerts page or
the rule detail page, which is probably the most common use case. 93ms
in this branch vs 2500+ ms in main. This type of performance hit happens
when almost any action is taken in timeline.

Main, selecting 3 alerts 1 at a time

![main_actions](87487149-cf6d-4bcc-9192-b64411abe321)

This branch selecting 3 alerts 1 at a time


![context_actions](8407953a-5af0-4cfd-9f2c-08c710c81fb3)

Pretty substantial improvement here as well, ~2000ms vs 67ms.

Apologies if some of the gifs are cut off, please try the branch vs main
on your own! This was done on a local kibana in dev mode, so things like
emotion are eating up more cpu than they would for a user, but there
still should be improvement, and I can't think of any circumstance where
things will be worse. Also this branch was a little longer lived than I
would have liked, so if you are reviewing and changed something around
these files recently please double check I didn't miss anything.



### Checklist

- [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
2024-04-16 19:00:11 +02:00
Candace Park
47c7174bff
[Security Solution][Admin][Event Filters] Wildcard warning with IS operator for event filters creation/editing (#178440)
## Summary

- [x] Adds updated warning messaging for trusted apps entries that use
wildcards `*?` with the "IS" operator
- [x] Three different warnings: callout, individual entry item warnings
and a final confirmation modal when the user tries to add an event
filter with ineffective IS / wildcard combination entry.
- [x] Unit tests
- [x] Fixes bug in endpoint exceptions where there is a missing tooltip
icon for the wildcard performance warning

# Screenshots

![image](fd960261-66cc-44f2-b437-bbd9bd3809ab)

![image](da580273-740c-49db-bef9-d79fe0f0ca35)

Bug Fix

![image](8ebbfd83-4286-4ac1-a858-0d390fbfd4b6)
2024-04-16 09:59:02 -07:00
Efe Gürkan YALAMAN
0cbf527f08
[Search] Add description tooltips to stats (#180923)
## Summary

Adds a bunch of descriptive tooltips to the stats.
<img width="324" alt="Screenshot 2024-04-16 at 15 02 57"
src="c0df028f-ad1d-45c3-b16e-abaa496b55ad">
<img width="283" alt="Screenshot 2024-04-16 at 15 03 11"
src="8569e289-4a21-4df2-9f5c-7d75205a03f2">
<img width="281" alt="Screenshot 2024-04-16 at 15 03 13"
src="f17b6023-0468-46c7-b5b0-c7c62af5c353">



### Checklist

Delete any items that are not applicable to this PR.

- [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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-04-16 09:42:09 -07:00
Tiago Costa
289680d413
skip flaky suite (#180956) 2024-04-16 17:26:09 +01:00