Commit graph

40025 commits

Author SHA1 Message Date
Tre
2dfac0ea3c
[SKIP ON MKI] skip Reporting Data Stream on mki (#186649)
## Summary

see details: https://github.com/elastic/kibana/issues/186648
2024-06-21 20:08:06 +02:00
Sergi Massaneda
9b3775e6b5
[GenAI][Integrations] UI for the custom integration creation with AI (#186304)
## Summary 

This ticket is the initial implementation for the UI side for the
AI-driven custom integration creation.

This PR only contains the implementation of the UI, due to the tight
timing it will not include tests, everything will be tested manually for
8.15 FF. We'll implement the tests later.

#### Enable Feature

The new integration assistant plugin is disabled by default, to enable
it:

```
xpack.integration_assistant.enabled: true
```


#### Complete tasks

- [x] New integration button on the /integrations page
- [x] New integration "landing" page with buttons to upload zip and
assistant
- [x] Upload zip page to install integration
- [x] Integration assistant:
  - [x] Connector selection step
  - [x] Integration details step
  - [x] Data stream step
  - [x] Review and install

#### Follow-ups (will be implemented in separate PRs)

- [ ] Add RBAC
- [ ] Add telemetry
- [ ] Documentation
- [ ] Add license/productType controls
- [ ] Add links to the create integration page
- [ ] Improve package name retrieval:
https://github.com/elastic/kibana/issues/185932
- [ ] Add time estimation on the generation stage
- [ ] Add support for multi-valuated "input type"
- [ ] Enable Langsmith tracing using AI assistant settings

#### Demo


b04c21c6-09cf-49bb-be8f-bf4b9d3feb8e


## Files by Code Owner

### elastic/docs

* packages/kbn-doc-links/src/get_doc_links.ts
* packages/kbn-doc-links/src/types.ts

### elastic/fleet

* x-pack/plugins/fleet/kibana.jsonc
*
x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx
*
x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx
*
x-pack/plugins/fleet/public/applications/integrations/sections/epm/index.tsx
*
x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/create/index.tsx
* x-pack/plugins/fleet/public/components/header.tsx
* x-pack/plugins/fleet/public/constants/page_paths.ts
* x-pack/plugins/fleet/public/plugin.ts
* x-pack/plugins/fleet/tsconfig.json

### elastic/kibana-core

* x-pack/plugins/fleet/kibana.jsonc
* x-pack/plugins/integration_assistant/kibana.jsonc

### elastic/kibana-operations

* packages/kbn-optimizer/limits.yml

### elastic/security-solution

* x-pack/plugins/integration_assistant/**/*

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 19:19:05 +02:00
Cee Chen
04d6c1d3d7
Upgrade EUI to v95.1.0 (#186324)
`v95.0.0-backport.0`  `v95.1.0-backport.0`

This PR primarily concerns converting multiple common/building block
form control components to Emotion (text, number, and search fields).
This means that custom CSS or direct `className` usage of these form
controls **should be manually QA'd** to ensure they still look the same
before visually, with no regressions.

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v95.1.0`](https://github.com/elastic/eui/releases/v95.1.0)

- Updated `EuiFormControlLayout` to automatically pass icon padding
affordance down to child `input`s
([#7799](https://github.com/elastic/eui/pull/7799))

**Bug fixes**

- Fixed broken focus/invalid styling on compressed `EuiDatePickerRange`s
([#7770](https://github.com/elastic/eui/pull/7770))

**CSS-in-JS conversions**

- Converted `EuiFieldText` to Emotion
([#7770](https://github.com/elastic/eui/pull/7770))
- Updated the autofill colors of Chrome (and other webkit browsers) to
better match EUI's light and dark mode
([#7776](https://github.com/elastic/eui/pull/7776))
- Converted `EuiFieldNumber` to Emotion
([#7802](https://github.com/elastic/eui/pull/7802))
- Converted `EuiFieldSearch` to Emotion
([#7802](https://github.com/elastic/eui/pull/7802))
- Converted `EuiFieldPassword` to Emotion
([#7802](https://github.com/elastic/eui/pull/7802))
- Converted `EuiTextArea` to Emotion
([#7812](https://github.com/elastic/eui/pull/7812))
- Converted `EuiSelect` to Emotion
([#7812](https://github.com/elastic/eui/pull/7812))
- Converted `EuiSuperSelect` to Emotion
([#7812](https://github.com/elastic/eui/pull/7812))

##
[`v95.1.0-backport.0`](https://github.com/elastic/eui/releases/v95.1.0-backport.0)

**This is a backport release only intended for use by Kibana.**

- Updated `EuiSteps` to support a new `titleSize="xxs"` style, which
outputs the same title font size but smaller unnumbered step indicators
([#7813](https://github.com/elastic/eui/pull/7813))
- Updated `EuiStepsHorizontal` to support a new `size="xs"` style, which
outputs smaller unnumbered step indicators
([#7813](https://github.com/elastic/eui/pull/7813))
- Updated `EuiStepNumber` to support new `titleSize="none"` which omits
rendering step numbers, and will only render icons
([#7813](https://github.com/elastic/eui/pull/7813))
2024-06-21 09:10:58 -07:00
Paul Tavares
108e1fadea
[Security Solution][Endpoint] Bug fixes to the Endpoint List (#186223)
## Summary

Fixes a display bug on the Endpoint List where the Policy name column
value was wrapping and causing the row to be miss-aligned. Changes
include:

- Moved components pieces that display the Policy Revision and the
"Out-of-date" message to the `<EndpointPolicyLink>` component
- this component now handles on displaying all of this information in
one place via input Props
- The component also dues Authz checks and ensures that if the user does
not have Authz to read the Endpoint Policy Management section, the
component will display the policy name as plain text (no link)
- It will truncate the Policy name if not enough width is available to
display its full value
- Replaced the Policy List column component for Policy Name with the use
of `<EndpointPolicyLink>`
- Replaced the Policy Details flyout component to also use
`<EndpointPolicyLink>` to display the policy name

> [!NOTE]
> Its still possible for the Policy Name column on the Endpoint list to
display across two lines - when the Policy that the Endpoint host last
reported is not longer available in Kibana. In this case/flow, the
second line will display a message indicating that. See screen captures
below.
2024-06-21 11:42:57 -04:00
Maxim Palenov
b632f0011d
[Security Solution] Add missing Alert index API OpenAPI specs (#186401)
**Addresses:** https://github.com/elastic/kibana/issues/183661

## Summary

This PR adds missing OpenAPI specs for the Alert Index API endpoints available in ESS

- `POST /api/detection_engine/index`
- `GET /api/detection_engine/index`
- `DELETE /api/detection_engine/index`
2024-06-21 08:39:35 -07:00
Elena Stoeva
44bdb82353
[Advanced Settings] Change role in security functional tests (#186602)
Closes https://github.com/elastic/kibana/issues/184813

## Summary

This PR adds a role-based login in the advanced settings functional
tests for security serverless project instead of using normal login
where we use operator privileges. It also moves the test file to a more
appropriate folder.
2024-06-21 16:07:05 +01:00
Elena Stoeva
d16d402d81
[Rollups] Add attributes for tracking doc links clicks (#186612)
Closes https://github.com/elastic/kibana/issues/186610

## Summary

This PR adds `data-test-subj` attributes to the doc links in the Rollup
deprecation warning callout and the deprecation empty callout so that
clicks on these links can be tracked on Fullstory. The links on the
deprecation callout have test subjects with a prefix depending on
whether they are on the list view page or the create form page so that
we can differentiate the clicks from the different pages.
2024-06-21 16:05:44 +01:00
Luke G
7129eea6d5
[Security Solution] Add Discover Data View picker to Timeline (#184928)
## Summary

Add new `Dataview picker` component and some initial redux setup to feed
it with data.
Dont expect this to work just like the original timeline sourcerer does
just yet.

### 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

### Testing
Do `localStorage.setItem('EXPERIMENTAL_SOURCERER_ENABLED', true)` in the
browser console, reload the page,
then open new timeline.

You should see the new dataview picker (colored in red temporarily),
that should allow data view switching.

Known issues: dataview editor is showing behind the picker (to be fixed
in subsequent PR).
2024-06-21 16:46:59 +02:00
Dima Arnautov
4c3afc5f42
[ML] Update code editors for Transform, Data Frame and Anomaly Detection wizards (#184518)
## Summary

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

Improves code editors in Anomaly detection, Data frame analytics and
Transform wizards with autocomplete, data types validation and inline
documentation from elasticsearch specification.

![Jun-19-2024
15-33-00](c230deae-962e-4295-8146-0bf3579a66bd)


Adds a package with JSON schemas extracted from the [openapi output of
elasticsearch-specification](https://github.com/elastic/elasticsearch-specification/tree/main/output/openapi).

Schema file is generated per editor/endpoint, keeping only relevant
components.

To test the script locally, execute 
```
yarn run jsonSchema
```
from `/x-pack/packages/ml/json_schemas`.

By default it assumes that your `elasticsearch-specification` folder is
located next to the `kibana` repo, but you can also provide a path to
`openapi` file as a parameter, e.g. `yarn run jsonSchema
/Users/my_user/dev/elasticsearch-specification/output/openapi/elasticsearch-serverless-openapi.json`

#### How JSON files are served 

JSON files are asynchronously imported at the React component level and
passed to the `CodeEditor` instances on mount.

Initially I tried different approaches to take advantage of CDN, but
unfortunately it didn't work out:

#####  Using static assets
 
I made an attempt to retrieve a URL to the JSON schema file as a static
asset using Kibana service
```typescript
const schemaJsonAsset = http?.staticAssets.getPluginAssetHref('my_schema.json') ?? '';
```
and passing it as part of the schema definition, but the browser was
blocking a request 🤔


![image](accf47b1-2a89-4408-9c5a-36bb269e8889)

![image](aa64ae66-8749-4d4d-b645-6cd11b221c68)

##### Using raw loader

Approach with a raw loader also didn't succeed.

```typescript
import mySchema from '!!raw-loader!./my_schema.json';
```

<details>
  <summary>See error </summary>
 
  ```
ERROR in
./public/app/sections/create_transform/components/advanced_pivot_editor/my_schema.json
(/Users/dimaarnautov/Repos/kibana/node_modules/raw-loader/dist/cjs.js!./public/app/sections/create_transform/components/advanced_pivot_editor/my_schema.json)
│ Module parse failed: Unexpected token 'e', "export def"... is not
valid JSON while parsing 'export default "{\n \"type\": \"object\'
       │          File was processed with these loaders:
       │           * ../../../node_modules/raw-loader/dist/cjs.js
│ You may need an additional loader to handle the result of these
loaders.
│ SyntaxError: Unexpected token 'e', "export def"... is not valid JSON
while parsing 'export default "{\n \"type\": \"object\'
       │              at JSON.parse (<anonymous>)
│ at parseJson
(/Users/dimaarnautov/Repos/kibana/node_modules/json-parse-better-errors/index.js:7:17)
│ at JsonParser.parse
(/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/JsonParser.js:16:16)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/NormalModule.js:482:32
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/NormalModule.js:358:12
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:373:3
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:236:3
│ at runSyncOrAsync
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:205:4
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:85:15
│ at processTicksAndRejections (node:internal/process/task_queues:77:11)
  ```
</details>



### Checklist

- [ ] [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-06-21 16:43:20 +02:00
Robert Austin
96497f90f4
Mark stable entity-analytics MKI tests for quality gate 2 (#182618)
## Summary

Mark stable entity-analytics MKI tests for quality gate 2. These tests
have not had recent failures on MKI and they represent critical paths
for our feature.

## Follow-up
We should aim to continue enabling more of our tests.


### 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-06-21 09:27:23 -05:00
Tre
5478a06445
[FTR](reporting) update common serverless api tests to use api keys (#184819)
## Summary

- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/reporting/`
- update one ui test in
`x-pack/test_serverless/functional/test_suites/common/reporting/management.ts`
- update snapshot
`x-pack/test_serverless/api_integration/test_suites/common/reporting/__snapshots__/generate_csv_discover.snap`
- update shared service in
`x-pack/test_serverless/shared/services/svl_reporting.ts`


Contributes to: https://github.com/elastic/kibana/issues/180834

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 14:51:45 +01:00
Ying Mao
6faadda1eb
[Response Ops][Task Manager] Integration test for switching between task claim strategies (#186419)
Resolves https://github.com/elastic/kibana/issues/184941

## Summary

Adds integration test to verify that restarting Kibana with a different
task claim strategy does not break anything and tasks are claimed as
expected.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 09:29:13 -04:00
Achyut Jhunjhunwala
e9a224d5b0
[Dataset Quality] Fix flaky summary test (#186618)
## Summary

Closes https://github.com/elastic/kibana/issues/186549
2024-06-21 06:24:22 -07:00
Tomasz Ciecierski
2820ae44dc
[EDR Workflows] Change crowdstrike fields to ecs fields (#186469) 2024-06-21 15:18:58 +02:00
Bena Kansara
a9089be4b3
[SLO] Fix alert reason not being hyperlinked in SLO details and SLO alerts embeddable (#186563)
Closes https://github.com/elastic/kibana/issues/183322

- Fixes alert reason link in SLO details -> Alerts tab
- Fixes alert reason link in SLO alerts embeddable


04805171-b3ad-4d83-a89d-317345d13675



eaaab802-bc88-4977-a2e8-f30c566eb635
2024-06-21 05:10:05 -07:00
Nikita Indik
55687dd539
[Security Solution] DetectionRulesClient: return RuleResponse from all methods (#186179)
**Partially addresses: https://github.com/elastic/kibana/issues/184364**

## Summary

This PR is a follow-up to [PR
#185748](https://github.com/elastic/kibana/pull/185748) and it converts
the remaining `DetectionRulesClient` methods to return `RuleResponse`.

Changes in this PR:
- These methods now return `RuleResponse` instead of internal
`RuleAlertType` type:
  - `updateRule`
  - `patchRule`
  - `upgradePrebuiltRule`
  - `importRule`
2024-06-21 14:05:55 +02:00
Saikat Sarkar
385bb2b35b
[Semantic Text UI] Display semantic_text based on licensing (#185902)
This PR includes changes related to displaying semantic_text based on
the ml operations capacity of the users. The PR includes the following
changes:

 - Display a banner based on the user's capacity to run ML operations.
- Display semantic_text if the user has the capacity to run ML
operations; otherwise, hide the semantic_text field.

### Trial License
<img width="1052" alt="Screenshot 2024-06-10 at 4 06 16 PM"
src="56a492db-c181-44ca-a77d-ea14a54ed0a3">


### Basic License
<img width="1456" alt="Screenshot 2024-06-10 at 4 00 56 PM"
src="aa9e0e6c-7a5f-4637-896b-9c2c2a1e152a">


### Serverless
<img width="1083" alt="Screenshot 2024-06-10 at 3 52 19 PM"
src="bd1fe21d-aacb-4b6a-98d9-489fab62e506">


# How to test
- Enable semantic_text in config/kibana.yml.
`xpack.index_management.dev.enableSemanticText: true`
- For Basic license, we can run elastic_search using: `yarn es snapshot`
- For Trial license, we can run elastic_seach using: `yarn es snapshot
--license trial`
- For serverless, we can run elastic_search using: `yarn es serverless
--projectType es`
2024-06-21 13:33:48 +02:00
Panagiota Mitsopoulou
dca0ea2ade
[SLO] use generic edit actions in the SLO embeddables (#186374)
Fixes https://github.com/elastic/kibana/issues/186365

## SLO Group Overview Embeddable
- `Edit criteria` appears on top
- Edit criteria does not appear under `More` actions
- Inline Edit criteria is removed from the panel



4b322361-08dd-4f3f-8440-2d4380efa2bd



## SLO Alerts Embeddable
- `Edit configuration` appears on top
- Edit configuration does not appear under `More` actions
- `X SLOs included` within the panel still opens the Edit configuration



c609fa70-4c1f-4aa5-aa17-4e765456f7e6

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 04:24:52 -07:00
Tre
73ef3cf9c3
[FTR](platform-security) update common serverless api tests to use api keys (#184935)
## Summary

- Update files within:
`x-pack/test_serverless/api_integration/test_suites/common/platform_security/`

Contributes to: https://github.com/elastic/kibana/issues/180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 11:33:25 +01:00
Robert Oskamp
c0eba7c0f1
Add saved objects serverless API tests to esGate (#186589)
## Summary

This PR tags the saved_object_management API integration test suite with
`esGate` to include it in the verification checks that run as part of
the Elasticsearch on-merge process.
2024-06-21 12:31:07 +02:00
Sid
9ed2ad9faf
Refactor Roles Grid page from class component to functional component (#186278)
Closes https://github.com/elastic/kibana/issues/186388

## Summary 

This PR covers some of the pre-work required to modernize role
management in Kibana. It convert the older Class component to a
functional component. It also breaks up the EUI in-memory table into
it's component parts of EUI Search Bar, Filters and EUI Basic table.

### Checklist

- [x] Since there's no change to the functionality, tests are expected
to continue passing

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 01:22:28 -07:00
elena-shostak
32e5360afc
a11y fixes for user profile input labels (#186471)
## Summary

a11y fixes for user profile input labels. 
Screen readers announce "Change username, optional" or "Change email
address, optional" when inputs receive focus.


### 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
- [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 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)

### 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)

__Fixes: https://github.com/elastic/kibana/issues/151934__

### Release note
a11y fixes for user profile input labels.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 09:45:38 +02:00
Walter Rafelsberger
695d382bcc
[ML] AIOps: Fix the text field icon margins in the log rate analysis results table. (#186520)
## Summary

Part of #181111.

Fixes the regression where the text field icon margins in the log rate
analysis results table were not rendered. It turned out the css applied
to `EuiIconTip` was not picked up correctly. Wrapping it in a `span`
applies it correctly.

Before:

<img width="1094" alt="image"
src="fd1a3e09-1815-490c-9c6a-ded3af71cf15">


After:

<img width="1098" alt="image"
src="4522f85a-82b5-4009-9ac5-ad207ac7b3e3">

### Checklist

- [ ] [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 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-06-21 09:20:53 +02:00
Shahzad
50ee4cf58b
[Synthetucs] Added perf metrics for es queries (#186313)
## Summary

Added perf metrics for es queries !!

Fixes https://github.com/elastic/synthetics-dev/issues/351

Started reporting query time for exploratory based visualizations used
in Synthetics

Test data can be seen on staging telemetry cluster !!

<img width="1698" alt="image"
src="120d9ea6-0162-4f56-8168-001b749d31e8">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 23:17:56 -07:00
Lisa Cawley
cd96a10529
[DOCS] Add SLO APIs to bundled OpenAPI document (#186575) 2024-06-20 19:49:05 -07:00
Carlos Crespo
4db61fa913
[APM] Add tests for service_map and critical_path endpoints to serverless integration tests suite (#186466)
closes [186450](https://github.com/elastic/kibana/issues/186450)

## Summary

Add tests for aggregate critical path and service map endpoints to
serverless test suite

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 16:00:53 -07:00
Konrad Szwarc
8f01b66ef2
[EDR Workflows] Additional usage reporting task test (#185888)
**Unit:**

This PR introduces an additional unit test to validate the behavior of
"paginated" ES.search() when using a default batch size of 1000. It
ensures that the data is appropriately passed down to the API through
three subsequent requests. The underlying logic can be summarized as
follows:

1. Fetch all documents with a timestamp greater than or equal to 15
minutes in batches of 1000.
2. Perform internal transformations.
3. Transmit transformed documents to an external API.

Since this process occurs server-side within a managed task running at
regular intervals, it is not feasible to conduct integration testing
using FTR or Cypress, as these requests cannot be intercepted in a
browser environment. However, I believe that the Jest test included in
this PR adequately addresses our responsibility. In this test, I mock
esClient.search() responses in a loop to ensure that all fetched items
are correctly sent to the API.

**Cypress:**

The Cypress integration test added with this PR is based on an actual
task run. Steps taken:
1. Create an environment with the task interval set to 1 minute and a
local API URL for usage reporting.
2. Load 2001 documents into ES, ensuring they have all the required
heartbeat fields.
3. Start transparent API proxy on a local API URL
4. Wait for the task to run.
5. Intercept the task API call to the usage reporting API.
6. Verify that the API request contains a payload of all 2001 documents
stored in ES.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 15:14:28 -07:00
Lisa Cawley
ac58b908de
[OAS] Lint SLO APIs (#186339) 2024-06-20 22:37:58 +02:00
Rickyanto Ang
4321421ae9
[Cloud Security][Serverless] Updated UI FTR tests to not run with operator privileges (#186485)
## Summary

To handle this https://github.com/elastic/kibana/issues/184135

We are now using role based login instead of just using normal login
where we use Operator by default
2024-06-20 13:12:21 -07:00
Ying Mao
d7e4cc44c9
[Response Ops][Alerting] Adding more granular apm spans to alerting task runner for better traceability (#186427)
Resolves https://github.com/elastic/kibana/issues/185873

## Summary

Added more granular APM spans during rule execution.

## To Verify
Add the following to your kibana config:

```
elastic.apm:
  active: true
  environment: 'ying-test-185873'
  transactionSampleRate: 1.0
  breakdownMetrics: true
  spanStackTraceMinDuration: 10ms
  # Disables Kibana RUM
  servicesOverrides.kibana-frontend.active: false
```

This will push APM transaction information to
`https://kibana-cloud-apm.elastic.dev/` where you can see what the new
spans look like. Create an alerting rule that will generate alerts and
add some actions and summary actions to the rule. Let it run and then
check out the transactions in the cloud APM cluster. Make sure the
correct environment is selected and then view the transaction for
`Execute Alerting Rule ${ruleName}`.

<img width="1380" alt="Screenshot 2024-06-20 at 10 09 30 AM"
src="519b06eb-0b5f-4550-9f32-c71559d61757">
<img width="1347" alt="Screenshot 2024-06-20 at 10 09 38 AM"
src="c3b7242e-9930-4bbe-b392-82bc3732c0a8">
2024-06-20 16:09:13 -04:00
Alexey Antonov
963a178b3d
fix: [Obs Alerts > Rules][KEYBOARD]: State dropdown menu is not keyboard accessible (#183509)
Closes: https://github.com/elastic/observability-dev/issues/3358

## Description

The Obs Alert Rules view has a `State` dropdown menu that cannot be
accessed by keyboard. I've included a MOV file that shows the keypress
events I tried to interact with the menu.

### Steps to recreate

1. Open the [Obs Alerts
Rules](https://keepserverless-qa-oblt-b4ba07.kb.eu-west-1.aws.qa.elastic.cloud/app/observability/alerts/rules)
table
2. Tab to the `State` button
3. Press `Enter` to open the menu
4. Click `Tab` and `Down_Arrow` to verify no action is being taken
5. Hover over the menu options and click one with a mouse to verify
action is being taken

### What was changed?: 
1. EuiSelectableListItem was replace to EuiSelectable

### Screen:


befc9c75-9313-416a-be64-cc0b67f97a84
2024-06-20 22:27:47 +03:00
Katerina
1989a601ed
[APM] Entity centric inventory view (#183605)
## Summary

fixes https://github.com/elastic/kibana/issues/183012 
- Rename `assets` to `entities`
- Update entities index: `.entities-observability.latest-*` The index
where the data transform writes the summaries
- Show a search field to filter by service name. This will allow the
user to filter the table without knowing the entities index and the
fields.
- Use the same template and path for the service inventory`/services` . 
- `throughput` remains the initial sorting field
- Merge the entities with the the same service name and calculates the
averages in the front end







2dbc07e9-3086-4d32-a98e-5dc364f59554



### How to test
1. Add the config to your kibana.yml
```
xpack.assetManager:
  alphaEnabled: true
```
2. Enable `observability:apmEnableMultiSignal` in advansted settings
 
<details>


<summary>3. Run the entities definition in the dev tools</summary>


```
POST kbn:/internal/api/entities/definition
{
  "id": "apm-services-with-metadata",
  "name": "Services from logs and metrics",
  "displayNameTemplate": "test",
  "history": {
    "timestampField": "@timestamp",
    "interval": "5m"
  },
  "type": "service",
  "indexPatterns": [
    "logs-*",
    "metrics-*"
  ],
  "timestampField": "@timestamp",
  "lookback": "5m",
  "identityFields": [
    {
      "field": "service.name",
      "optional": false
    },
    {
      "field": "service.environment",
      "optional": true
    }
  ],
  "identityTemplate": "{{service.name}}:{{service.environment}}",
  "metadata": [
    "tags",
    "host.name",
    "data_stream.type",
    "service.name", 
    "service.instance.id",
    "service.namespace",
    "service.environment",
    "service.version",
    "service.runtime.name",
    "service.runtime.version",
    "service.node.name",
    "service.language.name",
    "agent.name",
    "cloud.provider",
    "cloud.instance.id",
    "cloud.availability_zone",
    "cloud.instance.name",
    "cloud.machine.type",
    "container.id"
  ],
  "metrics": [
    {
      "name": "latency",
      "equation": "A",
      "metrics": [
        {
          "name": "A",
          "aggregation": "avg",
          "field": "transaction.duration.histogram"
           
          
        }
      ]
    },
    {
      "name": "throughput",
      "equation": "A / 5",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "transaction.duration.histogram:*"
        }
      ]
    },
    {
      "name": "failedTransactionRate",
      "equation": "A / B",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "event.outcome: \"failure\""
        },
        {
          "name": "B",
          "aggregation": "doc_count",
          "filter": "event.outcome: *"
        }
      ]
    },
    {
      "name": "logErrorRate",
      "equation": "A / B",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "log.level: \"error\""
        },
        {
          "name": "B",
          "aggregation": "doc_count",
          "filter": "log.level: *"
        }
      ]
    },
     {
      "name": "logRatePerMinute",
      "equation": "A / 5",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "log.level: \"error\""
        }
      ]
    }
  ]
}
```

</details>

4. Generate data with synthrace

    1. logs only: `node scripts/synthtrace simple_logs.ts`
    2. APM only: `node scripts/synthtrace simple_trace.ts` 


### Checklist
- [ ] There is a issue with the `SearchBar` that causing the gap between
the search field and the timerange. I need to check it
2024-06-20 22:20:33 +03:00
Tom Myers
16bfe577d5
[EEM] Add APIs for managing api keys and enabling entity discovery (#184548)
## Summary

This PR adds endpoints for managing builtin entity discovery:
- `GET /internal/api/entities/managed/enablement`: check if stored API
key exists and is valid, then checks whether builtin definitions are
installed and running
- `PUT /internal/api/entities/managed/enablement`: creates API key if
none exists, then installs and kickoff the builtin definitions
- `DELETE /internal/api/entities/managed/enablement`: stops and
uninstalls builtin definitions, then delete API key
- `GET /internal/api/entities/definition`: returns the definitions
installed and their corresponding state `{ installed: bool, running:
bool }`

The API key is stored in an encrypted saved object, and has only the
permissions required to manage the transforms/ingest pipelines, and read
the source data.
Built in definitions are stored in code and have hardcoded IDs with a
special prefix `builtin_`.

The change also includes an `entityClient` that can be consumed by
public plugins and exposes methods that proxy the http endpoints listed
previously.

### Testing
- verify entity discovery is not enabled with `GET
kbn:/internal/api/entities/managed/enablement`
- setup entity discovery with `PUT
kbn:/internal/api/entities/managed/enablement`
- verify builtin definitions are installed and running `GET
kbn:/internal/api/entities/definition?builtIn=true`
- verify entity discovery is enabled with `GET
kbn:/internal/api/entities/managed/enablement`
- disable entity discovery with `DELETE
kbn:/internal/api/entities/managed/enablement`
- verify builtin definitions are not installed anymore `GET
kbn:/internal/api/entities/definition?builtIn=true`
- verify entity discovery is disabled with `GET
kbn:/internal/api/entities/managed/enablement`

---------

Co-authored-by: Kevin Lacabane <kevin.lacabane@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 20:56:30 +02:00
christineweng
004daf70e7
[Security Solution][Document Details] Refactor alert reason and rule preview into panels (#186218)
## Summary

We want to have a preview for alert/events. Currently alert reason and
rule overview are embedded in the same preview. This PR separate them
into their own panels, so that they can be called outside of document
details if needed in the future. The `DocumentDetailPreviewPanelKey`
reference is removed, but will be used again when setting the preview
for alerts/events.

No functionality changed in this PR.

This PR is part 1 of refactoring document details code for alert
preview:

1️⃣ ➡️ separating the alert reason and rule overview into their own
panels
2️⃣ refactor left and right context to share
`DocumentDetailsPanelContext`, which will reduce the duplication for
alert preview
3️⃣ set up preview context for the actual alert/event details preview

### 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
2024-06-20 13:29:19 -05:00
Shahzad
e3a85ddb39
[Synthetics] Support project lightweight 10 and 30 seconds schedules (#185920)
## Summary

Companion PR to https://github.com/elastic/synthetics/pull/932
2024-06-20 19:17:38 +02:00
Steph Milovic
5f03747ad3
[Security solution] Fix SimpleChatModel arguments (#186540) 2024-06-20 10:46:11 -06:00
Julia Bardi
ffa943c8be
[Fleet] Change agent policies in edit package policy page (#186084)
## Summary

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

Added agent policy selection to Edit integration policy page.


There is a lot of duplication between Create and Edit integration policy
pages, I'll see if I can refactor to extract the common logic: steps
components and managing its state.
I extracted the steps to a hook, it would be a bigger refactor to use
this in Create package policy page, so I might create a follow up issue
for that.

## To verify
- enable the `enableReusableIntegrationPolicies` experimental feature in
`kibana.dev.yml`
- Create a few agent policies
- Add an integration 
- Go to Edit integration, and modify the linked agent policies
- Verify that the existing agent policies are populated correctly in the
Existing hosts combo box
- Verify that the modified agent policy list is reflected in the
`Preview API Request`, `policy_ids` list.
- Verify that when submitting the form, the package policy linkages are
updated to the selected ones (add/remove agent policies)
- The agent count should update below the combo / in the submit modal
window
- It's not allowed to submit the form after removing all agent policies
- If a new agent policy is selected, it will be created first and then
assigned to the integration policy

<img width="995" alt="image"
src="0a7163c6-154e-49b1-b73c-19ed024f6dc3">
<img width="993" alt="image"
src="ad470a27-90fa-40f5-b394-a93a08c95e06">
<img width="535" alt="image"
src="3b0ddc29-abf8-4e0d-8beb-300634c245b3">
<img width="1758" alt="image"
src="e8b976fe-3e53-439c-9b23-803deaf3e0aa">

### Create agent policy
<img width="1737" alt="image"
src="6f2a7f65-981a-487d-87c4-2dbb7ecd1835">
Preview API request contains the POST agent policy request
<img width="896" alt="image"
src="109140ab-13f2-42c9-9bbc-fb64859c4f62">
After submit, the updated integration policy is assigned to the new
agent policy too
<img width="2552" alt="image"
src="4027b47b-8d20-4153-b7ec-ed3500f08c9a">


## Open questions

- Currently the namespace placeholder of the package policy is set to
show the namespace of the first selected agent policy (if not set by the
package policy). I have to check what happens on the backend, if the
inherited namespace is changed if the agent policies change. The
behaviour should be consistent in the backend and UI.
Currently on the Agent policy details UI, the same integration policy
might show different inherited namespace if its shared by multiple agent
policies with different namespace.

<img width="1498" alt="image"
src="567800a8-2dcb-4b18-af89-f6e902889092">
<img width="1326" alt="image"
src="b59d131e-314c-4d5a-81e3-ab8fe0fa6e1f">
<img width="1318" alt="image"
src="69b54a63-f7c1-4f0f-8041-74b1774f1e9e">

- When the Edit integration was started from the Agent policy details
UI, the navigation goes back to the same agent policy after submitting
the page. Is this okay? Might be somewhat unexpected if creating a new
agent policy, though it is getting complex to decide where to navigate
in case of multiple agent policies.


### 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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: criamico <mariacristina.amico@elastic.co>
2024-06-20 09:26:35 -07:00
Rickyanto Ang
592aafcaba
[Cloud Security][Serverless] Serverless API FTR Test Update on Roles (#186488)
## Summary

We no longer uses with Operator role when doing serverless FTR,
2024-06-20 08:44:56 -07:00
Rickyanto Ang
7304484cf4
[Cloud Security] Patch fix for Column label on Cloud Security Data table (#186425)
## Summary
<img width="1478" alt="Screenshot 2024-06-18 at 6 10 05 PM"
src="f095591d-f0ee-41bd-8b7d-07880bcf61d9">


Currently we have an issue where if user already has localStorageKey
from previous version where we still use Update for our Column Label and
then proceed to upgrading to version where we no longer use that, the
column name in Findings table will show field name (it shows resource.id
instead of Resource ID)

also because we changed the logic and not allow users to change the
column headers in the data grid, option to **edit data view field** is
removed for Cloud Security Table
<img width="741" alt="Screenshot 2024-06-19 at 9 16 06 AM"
src="df1ec765-89de-4f43-a723-daf9558af135">


This patch fixes that issues

Related to #184295
2024-06-20 08:30:19 -07:00
Nicolas Chaulet
a2671433d9
[Fleet] Fix package upgrade variable merge (#186483) 2024-06-20 11:16:17 -04:00
Achyut Jhunjhunwala
103e619c0a
[Dataset Quality] Fix flaky tests for Dataset Quality Summary (#184640)
## Summary

As part of the PR, i have rewritten 4 of the test files for both
serverless and stateful for Dataset Quality Project

- `/dataset_quality/dataset_quality_summary.ts`
  - Closes - https://github.com/elastic/kibana/issues/178874
  - Closes - https://github.com/elastic/kibana/issues/178884
  - Closes - https://github.com/elastic/kibana/issues/186354
- `/dataset_quality/dataset_quality_table.ts`
- Closes - https://github.com/elastic/kibana/issues/183940 (Possibly,
not guaranteed)
  - Closes - https://github.com/elastic/kibana/issues/182353
- `/dataset_quality/dataset_quality_table_filters.ts`
  - Closes - https://github.com/elastic/kibana/issues/183861
  - Closes - https://github.com/elastic/kibana/issues/182320
  - Closes - https://github.com/elastic/kibana/issues/184852
- `/dataset_quality/dataset_quality_flyout.ts`
  - Closes - https://github.com/elastic/kibana/issues/184438
  - Closes - https://github.com/elastic/kibana/issues/183851
  - Closes - https://github.com/elastic/kibana/issues/183771
  - Closes - https://github.com/elastic/kibana/issues/183525
  - Closes - https://github.com/elastic/kibana/issues/183312
  - Closes - https://github.com/elastic/kibana/issues/183129
  - Closes - https://github.com/elastic/kibana/issues/182154
  
## Why are the tests re-written

- Most of the `it` were loading its own data, which add 2 problems, 1.
Makes our tests slower, 2. Data cleanup becomes challenging. Now the
tests simply load one master set of data and all the Functional tests
can be executed on that master data. This makes our tests leaner and
more functional.

- Every `it` resets the page state after the tests. Like when a `it`
blocks opens the Flyout, it should also close the flyout which was
missing. In order to refresh the page, the `navigate` API was used,
which is not good. Navigate API should only be used once to navigate to
the page in the starting and then refresh events should be used if a
refresh is required, or the action should be un-done in order to get the
same state as previous. For ex - Sorting make update the state of the
whole page. At the end of the sorting test, sorting should be reset.
With these changes `it` block now only focus on pure functional testing.
This means the `it` blocks can be moved around, skipped without
impacting other tests

- We had too much of generic tests, which could be combined into 1 `it`
block and be checked together. Idea to split 1 `it` block into another
is when we test for a completely different scenario. For eg - Writing a
single `it` for testing different columns of a table is much more
cleaner than multiple `it` for testing various columns of the same
table.

- Removed usage of `retry.try`. (Personal Opinion, please read it with a
pinch of salt) - The retry service seems like an escape hatch (read
workaround) when we don't have control over the rendering of UI
elements. Better alternative is to use `retry.tryforTime` as the last
resort.
Also the only time i found using the whole `retry` package was when we
use the `browser` package for getting URL value of refreshing page. I
cannot prove yet the problem with the `browser` package but somehow it
breaks the sync behaviour causing elements to be not available hence
requiring these retries.
I have removed `browser.refresh` completely from our code in favour of
better refresh handlers using DateTimePicker Refresh action


Linked Issued - https://github.com/elastic/kibana/issues/184145
2024-06-20 16:50:33 +02:00
Philippe Oberti
153ec668e3
[Security Solution][Notes] - store setup (#186433) 2024-06-20 09:34:17 -05:00
dkirchan
6ce61db2ff
[Security][Serverless] Add Product types in FTR API Integration tests. (#184309)
# Pull Request Overview
This pull request (PR):
1. Enables Product Types for FTR API Integration Test Suites in
Serverless MKI:
- Previously, the test suites ignored product types entirely. With this
PR, scripts to run the tests have been relocated to
x-pack/test/security_solution_api_integration/scripts.
- Users can now run tests from the API Integration tests directory for
security solutions by using the command:
TARGET_SCRIPT={script_from_package_json} node
./scripts/mki_start_api_ftr_execution. This will execute the following
steps:
1. Create a security serverless project, respecting the product types
specified in the serverless configuration found in the config folder of
the relevant test suite.
      2. Reset credentials.
3. Wait for Elasticsearch (ES) and Kibana to be ready and available.
      4. Execute the tests.
      5. Delete the project upon completion.
2. Adds Proxy Services Organizations to .ftr Role Users Files:
- This PR updates the .ftr role_users files to include all proxy
services organizations, ensuring they have the necessary permissions for
the tests.

# Implementation Details
Product Types

  - Previous Setup:
- A project was created and handed over to the test suite to run the API
tests against, without considering product types.
  - Changes Introduced:
- The script execution for tests has moved to
x-pack/test/security_solution_api_integration/scripts.
- Tests can be initiated using the command from the API Integration
tests folder where package.json exists:
      ```
TARGET_SCRIPT={script_from_package_json} node
./scripts/mki_start_api_ftr_execution
      ```
- The mki_start_api_ftr_execution script performs several steps to run
the tests, including creating a security serverless project with
specified product types, resetting credentials, ensuring ES and Kibana
readiness, executing tests, and cleaning up the project afterward.
- The script reads extra configuration (currently only product types are
supported) in the specific format as is, from the following file :
[api_configs.json](https://github.com/elastic/kibana/pull/184309/files#diff-1122baffe7ff843b1f486cee95468bed5851a9a4934be747f540bd42dc9a07daR2).
The key for the JSON file is the name of the script in
[package.json](https://github.com/elastic/kibana/pull/184309/files#diff-c6af1c81947b3a77bed431c688c7ad38c8969bd52e1c3ea92d643f09d422eb61R296)
- If a specific configuration is not required and the default complete
project is needed for the test to run, the key and configuration in the
`api_configs.json` file can be ommitted.

# Summary

This PR enhances the flexibility and functionality of the FTR API
integration test suites for serverless MKI by incorporating product type
considerations and updating the role_users configuration to include
proxy services organizations.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 17:30:35 +03:00
Alexi Doak
0468b8f46d
Onboard Synthetics Monitor Status rule type with FAAD (#186214)
Towards: https://github.com/elastic/kibana/issues/169867

This PR onboards the Synthetics Monitor Status rule type with FAAD.

### To verify
I can't get the rule to alert, so I modified the status check to report
the monitor as down. If you know of an easier way pls let me know 🙂

1. Create a [monitor](http://localhost:5601/app/synthetics/monitors), by
default creating a monitor creates a rule.
2. Click on the monitor and grab the id and locationId from the url
3. Go to [the status check
code](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/synthetics/server/queries/query_monitor_status.ts#L208)
and replace the object that is returned with the following using the id
and locationId you got from the monitor.
```
{
    up: 0,
    down: 1,
    pending: 0,
    upConfigs: {},
    pendingConfigs: {},
    downConfigs: {
      '${id}-${locationId}': {
        configId: '${id}',
        monitorQueryId: '${id}',
        status: 'down',
        locationId: '${locationId}',
        ping: {
          '@timestamp': new Date().toISOString(),
          state: {
            id: 'test-state',
          },
          monitor: {
            name: 'test-monitor',
          },
          observer: {
            name: 'test-monitor',
          },
        } as any,
        timestamp: new Date().toISOString(),
      },
    },
    enabledMonitorQueryIds: ['${id}'],
  };
```
5. Your rule should create an alert and should saved it in
`.internal.alerts-observability.uptime.alerts-default-000001`
Example:
```
GET .internal.alerts-*/_search
```
6. Recover repeating step 3 using
```
{
    up: 1,
    down: 0,
    pending: 0,
    downConfigs: {},
    pendingConfigs: {},
    upConfigs: {
      '${id}-${locationId}': {
        configId: '${id}',
        monitorQueryId: '${id}',
        status: 'down',
        locationId: '${locationId}',
        ping: {
          '@timestamp': new Date().toISOString(),
          state: {
            id: 'test-state',
          },
          monitor: {
            name: 'test-monitor',
          },
          observer: {
            name: 'test-monitor',
          },
        } as any,
        timestamp: new Date().toISOString(),
      },
    },
    enabledMonitorQueryIds: ['${id}'],
  };
```
8. The alert should be recovered and the AAD in the above index should
be updated `kibana.alert.status: recovered`.
2024-06-20 06:56:17 -07:00
Faisal Kanout
85f12800bb
[OBX-UI-MNGMT] Align the Metric rule charts by using Lens in Alert details page and Creation Rule flyout (#184950)
## Summary
Fixes #184922
Fixes #184574

It uses the `RuleConditionChart`, a.k.a Lens chart, for the Metric
Threshold rule.
### Implemented in both places:
- Metric Alert Details page
![Screenshot 2024-06-10 at 16 12
43](9d88d9b9-fe5d-4f8d-9e5a-538c52c58692)

- Rule creation flyout
![Screenshot 2024-06-10 at 16 13
18](8c9ca3b3-2fbf-4cfa-83c9-00278c5e8e77)
2024-06-20 14:16:16 +02:00
Mykola Harmash
b46f9d3867
[Infra] Fix processes chart query time range (#186484)
Closes https://github.com/elastic/sdh-kibana/issues/4739

## Summary

Fixes an issue with process chart query where it was fetching only for 1
minute while the chart was expecting data for 15 minites.

The issue was that `query` was filtering the documents by the latest 1
minute while `date_histogram` is using `extended_bounds` to cover the
last 15 minutes (relative the to provided `to` date). `extended_bounds`
ensures that we return buckets for 15 minutes range even if some buckets
are empty, but it does not expand the filter range from the `query`
which is set to 1 minute, meaning the first 13 buckets were always
empty.

This change expands the `filter` query for the chart to 15 minutes.

**After the change**
![CleanShot 2024-06-19 at 19 57
33@2x](5b828891-1f73-4b27-b73f-c48501bcf69b)
2024-06-20 11:32:41 +02:00
Tiago Vila Verde
c97e098e29
[Entity Analytics] Add criticality column to All Users table In Explore pages (#186456)
This PR, a follow-up to #186375, adds a new column for Asset Criticality
to the "All hosts" tab in the Explore/Hosts page.
If any of the hosts has criticality data assigned, it will be displayed
in the new column. If no criticality has been assigned, the field is
left blank.

<img width="1530" alt="Screenshot 2024-06-19 at 13 46 52"
src="054d0bb0-8858-40ae-ab20-7fe6f31e5858">

### How to test

1. Make sure you have test data with Asset Criticality.
- Either use the [datagen
tool](https://github.com/elastic/security-documents-generator) or just
make sure to assign criticality to already existing hosts
2. Enable Asset Criticality settings in `Stack Management > Kibana >
Advanced Settings`
3. Navigate to `Explore > Users > All Users`

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 11:30:08 +02:00
Tre
f05416e225
[FTR](search_oss) update common serverless api tests to use api keys (#185030)
## Summary
- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/search_oss/`



Contributes to: https://github.com/elastic/kibana/issues/180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 09:18:22 +01:00
Marta Bondyra
2f4997cbfe
[Lens] Legend Statistics feature (#182357)
## Summary

Fixes https://github.com/elastic/kibana/issues/183887

<img width="959" alt="Screenshot 2024-06-09 at 21 11 33"
src="950a92cb-a70a-4413-9358-f4a8a5b7da5d">


<img width="513" alt="Screenshot 2024-06-09 at 21 11 38"
src="36d8fe9d-fa40-4721-ac24-db0599076b9c">

- [x] popover width = 500 px
- [x] new combobox legend values component added
- [x] switch show value removed
- [x] location and alignment is in a single for row
- [x] auto legend width option to allow users to have the legend
automatically size based its contents - not there yet
- [x] no limit imposed of the number of values  
- [x] when a value is selected, list or table appears
- [x] when the list is selected, label truncations is not offered and
legend items should be forced to have truncation on and clamped to a
single line.
- [x] adds telemetry too - adds events on save if the legend statistics
change:

`lens_legend_stats`- triggered if any stats is in legend

`lens_legend_stats_${TYPE}` - triggered for specific types, if user has
2 statistics (eg. AVG and MIN) two events are triggered.

and counting how many they use
`lens_legend_stats_amount_1`
`lens_legend_stats_amount_2`
`lens_legend_stats_amount_3`
`lens_legend_stats_amount_4_7`
`lens_legend_stats_amount_above_8`

---------

Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2024-06-19 21:04:07 +02:00
Davis McPhee
57891ff353
[Discover] Add support for contextual awareness functional tests (#185905)
## Summary

This PR adds functional test support for the Discover contextual
awareness framework, and adds tests for the initial `getCellRenderers`
extension point using example profiles.

To support this, this PR introduces a new YAML setting called
`discover.experimental.enabledProfiles` which can be used to selectively
enable profiles both for functional testing and demoing WIP profiles
that aren't yet ready for GA.

Example usage:
```yml
discover.experimental.enabledProfiles: ['example-root-profile', 'example-data-source-profile', 'example-document-profile']
```

Flaky test runs:
- Stateful x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6304
- Serverless Observability x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6305
- Serverless Search x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6306
- Serverless Security x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6307

Resolves #184699.

### Checklist

- [ ] 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
- [x] [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)
2024-06-19 14:17:26 -03:00