Commit graph

84855 commits

Author SHA1 Message Date
Ying
f6fbb63327 Merge 2025-03-20 07:50:30 -04:00
Ying
e00f832283 Merge branch 'main' of github.com:elastic/kibana into alerting/alerts-deletion 2025-03-20 07:48:52 -04:00
Aleh Zasypkin
38de01504b
chore(security,codeql): exclude more dev/test folders from CodeQL scans (#215303)
## Summary

Exclude more dev/test folders from CodeQL scans
2025-03-20 11:05:16 +00:00
Shahzad
0dad68dce7
[Synthetics] Retries journeys on failures !! (#215264)
## Summary

Retries journeys on failures !!
2025-03-20 11:53:55 +01:00
Abdul Wahab Zahid
e6e78ac6d8
[Performance] Refactor TTFMP query from, to fields (#213911)
Currently Kibana forwards `query_range_secs` and `query_offset_secs` to
mark the selected time range when reporting TTFMP event. This format
caused some challenges to identify `from`, `to` date offsets in
visualizations.

To simplify, the PR renames and sends the three fields explicitly:
- `query_from_offset_secs` offset to `0` (now), with -ve for past and
+ve for future dates
- `query_to_offset_secs` offset to `0` (now), with -ve for past and +ve
for future dates
- `query_range_secs`                      same as previously sent

_This approach is followed after a discussion, and based on the
[gist](https://gist.github.com/andrewvc/1f04a57a336d768e4ec5ff2eff06ba54)
excerpt:_

```
Earliest date -> QueryFrom
Newest date -> QueryTo
Duration -> QueryRange
```

### Indexing
These fields then should be mapped in the EBT indexer to ingest in the
top level of the document, eventually removing the need to create
runtime fields in data views for visualizations.

Also, runtime fields in data views should be updated to reflect this
change. For backward compatibility, the runtime fields can cater both
the old and new field names conditionally.

### Testing
- Ensure that the TTFMP events are correctly reporting the date ranges.

### Example

![image](https://github.com/user-attachments/assets/529507fc-66f7-440a-8bbb-b34176e8d093)
2025-03-20 11:40:24 +01:00
Maria Iriarte
48b286e460
[Graph/SCSS] Migrate settings _index.css, _legacy_icon.scss and _url_template_list.scss files to Emotion (#215021)
## Summary

Part of https://github.com/elastic/kibana/issues/208908

Replaces `_index.css`, `_legacy_icon.scss` and `_url_template_list.scss`
files file to css-in-js.


### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-20 12:29:06 +02:00
Søren Louv-Jansen
b9cd2c8040
[Obs AI Assistant] Minor cleanup api tests (#215181)
- Remove duplicated helpers
- improve log messages
- Clear intercepted requests after every test

---------

Co-authored-by: Viduni Wickramarachchi <viduni.ushanka@gmail.com>
2025-03-20 10:59:59 +01:00
Alex Szabo
d8f6bd694b
Upgrade axios 1.8.3 in buildkite (#215203)
## Summary
Upgrade `axios` to 1.8.3 in Kibana's `.buildkite` subproject; disallow
absolute URLs in axios clients.
2025-03-20 10:58:41 +01:00
David Sánchez
1119bf187d
[Security Solution][Defend Workflows] Enables endpoint integrations FTR tests (#214120)
## Summary

Enables endpoint integrations ftr test.

closes: https://github.com/elastic/kibana/issues/203916

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-20 10:37:11 +01:00
Gerard Soldevila
adb4bdf8d8
SKA: Extract list of Kibana solutions into a dedicated package (#213353)
## Summary

The intent is to have a centralised place to store the list of Kibana
solutions and serverless project types.
To that end, this PR creates a `@kbn/projects-solutions-groups` package.
It also adds the new solution type `'chat'`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-20 10:20:07 +01:00
Lisa Cawley
dcbefc3b27
Fix APM URLs in doc link service (#215261) 2025-03-20 10:00:12 +01:00
Drew Tate
4e03cf0d97
[ES|QL] Fix grammar sync (#215230)
## Summary

I wasn't copying the lib files right. 😞 

Successful run:
https://buildkite.com/elastic/kibana-es-ql-grammar-sync/builds/118#0195af98-3e96-4ef4-8417-7b8391ca5396
2025-03-20 08:36:48 +01:00
Kibana Machine
bcb75870fc
[api-docs] 2025-03-20 Daily api_docs build (#215263)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1017
2025-03-20 08:20:00 +02:00
Abhishek Bhatia
a3f89ec2c2
[Security Solution][Risk Score]Code changes for limiting the transformID length to 36 characters (#213405)
## Summary

The code changes in this PR ensure that the transform ID is limited to
36 characters when creating or updating the transform for risk-score.

This adjustment aligns with ES constraint on transform ID length.


## Test Steps

1. Create a new namespace with a very long name. Ex :
`namespace_that_stretches_farther_than_the_universe_and_beyond_like_buzz`
🚀
2. Enable the Risk Score in the new namespace. It should successfully
get enabled.
3. Check the transform that was created (using dev tools)

```
GET _transform/risk_score_latest_transform_*?filter_path=transforms.id,transforms._meta.space_id
```

Output 


![image](https://github.com/user-attachments/assets/3b5d5e67-cddf-4c6a-b8ff-675517c123b2)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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] 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)
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
2025-03-20 11:23:55 +05:30
Viduni Wickramarachchi
bfe2db38e3
[Obs AI Assistant] Update test to intercept API request to fix flakiness (#215172) 2025-03-19 22:43:03 -04:00
Jared Burgett
64743b3a82
Added more request validation to entity store enablement (#212657)
# Purpose

This change introduces new validations that ensure no loss of data is
possible if a user accidentally sets the Security Entity Store enrich
policy execution interval to a value that “doesn’t play nicely” with the
lookback period value.

The specific logic (greater than or equal to half the value) was chosen
to not only ensure no loss of data, but also provide extra resiliency in
case of a failed enrich policy execution.

(Note that this is not considered a breaking change, as the parameters
are not yet available on any version of Elastic, including Serverless.)

# How to test

1. Load appropriate entity log data to your Kibana instance (for
example, using the
[security-documents-generator](https://github.com/elastic/security-documents-generator))
2. Navigate to the Developer console
3. Attempt to enable the Entity Store via the /enable or /init routes
(examples below), and pass in values that are expected to error. For
example, “lookbackPeriod”: “24h” and “enrichPolicyExecutionInterval”:
“24h” should fail, because of the validation logic
4. Expect results similar to those shown below, specifically a 400
error, or else a success message

<img width="1902" alt="Screenshot 2025-02-27 at 12 57 45 AM"
src="https://github.com/user-attachments/assets/a7f4b0fb-9899-4e00-a0ae-d172245bd506"
/>
<img width="1909" alt="Screenshot 2025-02-27 at 12 58 06 AM"
src="https://github.com/user-attachments/assets/372acde2-9d7b-4c75-8596-af8374088f79"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-20 01:31:31 +02:00
Julian Gernun
8928dbbdef
[Response Ops][Alerting] Alert Deletion - Persist settings (#211488)
## Summary

https://github.com/elastic/kibana/issues/209258 updates the settings
endpoint to also be able to get/set the alert deletion settings. The
alert deletion setting should make use of this new endpoint to load its
initial data and store any user update.

> [!WARNING]
> This will be merged into a feature branch.


## QA:
Activate the feature flag
```
# config/kibana.dev.yml
xpack.trigger_actions_ui.enableExperimental: ['alertDeletionSettingsEnabled']
```
Follow these steps:
- Go to rules
- Click on settings
- Change the alert deletion settings
- Click on save
- Reload and check the settings kept the values

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 20:09:14 +01:00
Alexander Wert
81f69713f3
Enable editing central config for EDOT Agents / SDKs (#211468)
## Summary
Enables central configuration for EDOT Agents / SDKs while keeping it
disabled for other OTel Agents.

**EDOT JAVA agent**
<img width="2124" alt="Screenshot 2025-03-17 at 09 26 37"
src="https://github.com/user-attachments/assets/fcff661c-6655-444d-bc09-39b70c835b82"
/>

**EDOT Nodejs Agent**
<img width="1264" alt="Screenshot 2025-03-18 at 13 08 12"
src="https://github.com/user-attachments/assets/97cdd03b-b6cd-494f-bd7e-a9b3fc4976b4"
/>

---------

Signed-off-by: Alexander Wert <alexander.wert@elastic.co>
Co-authored-by: jackshirazi <jacks@fasterj.com>
Co-authored-by: Caue Marcondes <caue.marcondes@elastic.co>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 16:06:08 -03:00
Patrick Mueller
a3aaa04eba
[ResponseOps] mustache lambdas for EncodeURI and EncodeURIComponent, take 2 (#213859)
resolves https://github.com/elastic/kibana/issues/168728

## Release note

Adds Mustache lambdas for alerting actions to encode URLs with
`{{#EncodeURI}}` and `{{#EncodeURIComponent}}` using `encodeURI()` and
`encodeURIComponent()`.

doc to update, in a separate PR:
https://github.com/elastic/docs-content/issues/735
2025-03-19 14:54:03 -04:00
Tiago Costa
80ddd99adb
skip flaky suite (#215216) 2025-03-19 18:36:18 +00:00
Tiago Costa
efbe321db0
Merge remote-tracking branch 'upstream/main' 2025-03-19 18:35:44 +00:00
David Kilfoyle
5d6bed8479
Small fixes for alert & actions yaml file (#215218)
This updates the versioning tags in the Alert and Action settings yaml
file to use `all` instead of `ga`. I guess the former makes more sense
since these settings aren't newly GAed.


The PR also makes a couple of very minor content changes based on
https://github.com/elastic/kibana/pull/214934
2025-03-19 14:19:53 -04:00
Carlos Crespo
8bbfa35437
[Synthtrace] Fix id overflow (#215199)
fixes [214636](https://github.com/elastic/kibana/issues/214636)

## Summary

Fix the random id generator, it would sometimes generate an id longer
than the specified length.

> Error: generated id is longer than 16 characters: 17
2025-03-19 19:52:26 +02:00
Marta Bondyra
de52f41a5c
[Lens/SCSS] Replace scss to css-in-js for Lens codebase (#209768)
Replace SCSS in css-in-js for Lens codebase
2025-03-19 18:33:23 +01:00
Brad White
231507bf28
Combine Webpack renovate config (#215075)
## Summary

We ended up with two configurations in Renovate for `webpack` deps. This
combines them all under the enabled config.
2025-03-19 10:13:36 -07:00
Hannah Mudge
05db9e9597
[kbn-grid-layout] Allow rows to be reordered (#213166)
Closes https://github.com/elastic/kibana/issues/190381

## Summary

This PR adds the ability to drag and drop rows by their headers in order
to reorder them:

![Mar-12-2025
16-07-04](https://github.com/user-attachments/assets/de6afb8e-f009-4c00-b1dc-4804769e54eb)

It can be a bit confusing dragging section headers around when other
sections are expanded - it is easy to lose track of them, especially
when the expanded sections are very large. I experimented with
auto-collapsing all sections on drag, but this felt extremely
disorienting because you instantly lost all of your context - so, to
improve the UI here, I added a "scroll to" effect on drop like so:



https://github.com/user-attachments/assets/0b519783-a4f5-4590-9a1c-580df66a2f66

Reminder that, to test this feature, you need to run Kibana with
examples via `yarn start --run-examples` and navigate to the grid
examples app via `Analytics > Developer examples > Grid Example`.

### 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] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Collapsible sections are not available on Dashboard yet and so there is
no user-facing risk to this PR.
2025-03-19 11:12:35 -06:00
elastic-renovate-prod[bot]
24de20fe9b
Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to c4e10ec (main) (#215076)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base | digest | `5ba5def` ->
`c4e10ec` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDpza2lwIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-19 11:39:33 -05:00
Lukas Olson
423d331b3b
[data.search] Add APM instrumentation to search route (#214280)
## Summary

Resolves https://github.com/elastic/kibana/issues/208219.

Adds APM instrumentation to the search route called by `data.search`
services. This was part of `bsearch` before it was removed but for some
reason was never added to the search routes directly.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 09:37:54 -07:00
Maryam Saeidi
cc9494ccb0
[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)
## Summary

In this PR, we use a similar approach as was introduced in the ES Query
rule in this [PR](https://github.com/elastic/kibana/pull/183694) for the
custom threshold rule to reduce the field_caps traffic using createLazy.
(Thanks @mikecote for pointing this out!)

||Screenshot|
|---|---|
|Create (796
ms)|![image](https://github.com/user-attachments/assets/2df8f864-bbc5-44e4-af43-7ae70f5dd2c3)|
|CreateLazy (321
ms)|![image](https://github.com/user-attachments/assets/cd9a6e51-af7e-411a-ab2e-5d7a2efd3ce5)|

### 🧪 How to test
- Enable APM locally
```
elastic.apm.active: true
elastic.apm.transactionSampleRate: 1.0
elastic.apm.environment: username
```
- Create a custom threshold rule and check its execution in
[traces](https://kibana-cloud-apm.elastic.dev/app/apm/traces?rangeFrom=now-15m&rangeTo=now)
filtered for your `username` as the environment. There should be one
with your rule name:
<img
src="https://github.com/user-attachments/assets/59274acc-3edf-4de7-8870-3b175af73523"
width=500 />
    
The timing for `_field_caps` would be more if you replace the
`createLazy` with the `create` function.
2025-03-19 17:23:26 +01:00
Kevin Qualters
7f435b046d
[Security Solution] Cleanup alerts table rendering and reference issues (#213649)
## Summary

This pr fixes some odd issues with getBulkActions, which is really a
hook in disguise, as well as an issue with the useGetMutedAlertsQuery
hook, which was/is fetching data much more often than it should, exactly
why that is I'm not sure, perhaps something to do with how timeline
blocks focus to the underlying DOM when it's open, and this causes the
default to true refetchOnWindowFocus prop of useQuery to re-run the
query, or if there's an error with the queryKey.

Below are 2 GIFs comparing react performance profiles of simply opening
and then closing the timeline while on the alerts page with 50 alerts in
the table.

Before fix:

![pre_fixes_profiler](https://github.com/user-attachments/assets/548d1ea8-6bde-460f-90da-0cead5ea76e1)

12 renders for a total of 950 ms, a large portion of which is coming
from the alert table cells.

After fix:


![with_fixes_profiler](https://github.com/user-attachments/assets/7119725a-fe3a-4e66-a181-4dd7b24204f0)

8 renders for a total of 380 ms, almost none of it coming from the alert
table.

Each of the alerts table and timeline/discover drive some of the more
stateful and complex workflows in kibana on their own, and on top of
that one is rendering within a flyout on top of the other, listening to
the same url changes/tens of context provider wrappers changing above
them in the tree/kibana services, etc, & so proper memoization is a
pre-requisite for a good ux.

### 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
2025-03-19 12:07:54 -04:00
Kibana Machine
f7d01667ee
Unauthorized route migration for routes owned by obs-ai-assistant,security-solution (#198338)
### Authz API migration for unauthorized routes

This PR migrates unauthorized routes owned by your team to a new
security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before migration:**
```ts
router.get({
  path: '/api/path',
  ...
}, handler);
```

### **After migration:**
```ts
router.get({
  path: '/api/path',
  security: {
    authz: {
      enabled: false,
      reason: 'This route is opted out from authorization because ...',
    },
  },
  ...
}, handler);
```

### What to do next?
1. Review the changes in this PR.
2. Elaborate on the reasoning to opt-out of authorization.
3. Routes without a compelling reason to opt-out of authorization should
plan to introduce them as soon as possible.
2. You might need to update your tests to reflect the new security
configuration:
  - If you have snapshot tests that include the route definition.

## Any questions?
If you have any questions or need help with API authorization, please
reach out to the `@elastic/kibana-security` team.

Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
Co-authored-by: Viduni Wickramarachchi <viduni.wickramarachchi@elastic.co>
2025-03-19 12:04:24 -04:00
Tre
22587ea045
[SKIP ON MKI] index mgmt test (#215178)
## Summary

see details: https://github.com/elastic/kibana/issues/200878
2025-03-19 17:56:40 +02:00
Gerard Soldevila
cbb5e612a1
Update upgrade_assistant archive to 8.19.0 (#215176)
## Summary

Addresses https://github.com/elastic/kibana/issues/209048

1. Started ES with
```
yarn es snapshot --version 8.19.0 --data-archive=../kibana/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip
```

2. Then created updated archive
```
zip -r ../../../kibana/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip data  -x "*/\.*"
```
2025-03-19 17:52:59 +02:00
Maria Iriarte
ecd3521acd
[Graph/SCSS] Refactor styles to use Emotion (#212916)
## Summary

Part of https://github.com/elastic/kibana/issues/208908

Replaces scss to css-in-js.

> [!NOTE]
> The rest of the `.scss` will be migrated in different pull requests

<!--

- [ ] `x-pack/platform/plugins/private/graph/`public/_mixins.scss

- [ ]
`x-pack/platform/plugins/private/graph/`public/components/_app.scss
- [ ]
`x-pack/platform/plugins/private/graph/`public/components/_graph.scss
- [ ]
`x-pack/platform/plugins/private/graph/`public/components/_inspect.scss
- [ ]
`x-pack/platform/plugins/private/graph/`public/components/_search_bar.scss

- [ ]
`x-pack/platform/plugins/private/graph/`public/components/_search_bar.scss
- [ ]
`x-pack/platform/plugins/private/graph/`public/components/field_manager/_field_picker.scss
- [ ]
`x-pack/platform/plugins/private/graph/`public/components/field_manager/_index.scss

-->

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-19 16:14:01 +01:00
Paul Tavares
e11c3ecea5
[Security Solution][Endpoint] Adjust Artifacts policy assignment component in support of spaces (#214487)
## Summary


### Fleet

- Exposed API route for bulk get package policies via the routes service
- Created and exposed type `BulkGetPackagePoliciesRequestBody`

<br/>


### Security Solution

The following changes were made to Endpoint Artifacts in support of
spaces:

> [!NOTE]
> Space awareness is currently behind feature flag:
`endpointManagementSpaceAwarenessEnabled`


- The policy assignment component, which is displayed on artifact's
Create and Update forms, now:
- Displays the count of policies (if any) that are associated with the
artifact, but not currently accessible in the active space (screen
capture 1️⃣ )
- When a user does NOT have the Global Artifact privilege, the `Global`
toggle selection will be disabled and a tooltip is displayed. This
change also applies to the create form where the default selection will
be per-policy and the global button will be disabled. (screen capture
2️⃣ )
- Artifact policy assignments that are not accessible in active space
are preserved when submitting an update to the artifact
- The component was also refactored a bit to simplify its list of props
- Artifact card policy assignment menu was adjusted to show any policy
that is not accessible to the user as "disabled" along with a tooltip
(screen capture 3️⃣ )
- The update artifact API was changed (via server-side extension point)
to not error when validating policies that are not accessible in active
space if they were already associated with the item being updated.
- Fixes a bug in the Find artifacts API (impact only when spaces was
enabled) where an invalid filter was created when there was no policies
currently shared with active space.
2025-03-19 11:12:59 -04:00
Gerard Soldevila
443af08131
Fix failing migrations actions.test.ts (#215161)
## Summary

Addresses https://github.com/elastic/kibana/issues/167273

* Breaks down the `beforeAll` logic in 3 different hooks (allowing for
bigger margin for each).
* Updates the logic that fills the `existing_index_with_100k_docs`
index, using `refresh: 'wait_for'` only in the last iteration.
* Fixes a source of flakiness: a search request that was returning
results in random order.

The most recent failure was:
<img width="1140" alt="image"
src="https://github.com/user-attachments/assets/fef18850-ab06-43b0-afd9-671604a5f84a"
/>
2025-03-19 16:09:58 +01:00
Riccardo Magliocchetti
ea73a1aa1c
[ObsUX] [APM] [OTel] Reduce python runtime metrics dashboard to otel_native (#215005)
## Summary

Since the GA supported path is the native OTel one, start simple with
just that one.
This also renames the dashboard to match the dashboard triplet.

This is a follow up from #213599

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

This reduce risks since it reduces the surface of changes from #213599
2025-03-19 16:58:38 +02:00
Philippe Oberti
97f3594c3a
[Security Solution] Fix issue with alert grouping re-render (#215086)
## Summary

While doing a POC trying to implement the grouping component with the
UnifiedDataTable, I discovered a rendering issue that caused some sort
of infinite loop rerendering after selecting a group.

This PR fixes that issue but making sure we do not have a new instance
of an empty array every time the component is rendered.
2025-03-19 09:57:55 -05:00
Gonçalo Rica Pais da Silva
54d9cf45cb
[Discover][APM] Refactor APM sources for better trace enablement (#212634)
## Summary

This PR reworks how APM handles getting its sources data, elevating the
necessary code to a private shared plugin so that Discover for Traces
can access the data and handle user provided configuration. It also
removes the need for Discover for Traces to rely on the APM static data
view, so the Trace data source and document profile will work on any
compatible/configured index, even in ESQL mode.

Closes #211414

<img alt="ESQL Discover Traces Screenshot 2025-03-04 173032"
src="https://github.com/user-attachments/assets/f5bbb736-8b8b-45dc-ac23-4bf7083aa47e"
/>

## How to test

Test with olbt-cli instance for now, will post for doing with synthtrace
data. Ensure the following is added to your kibana.dev.yml:

```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
```

- Make sure your space has the Observability solution view configured
- Go to Discover page
- Select Data Views mode if required and create a view with a `traces`
specific index. Or use the APM static data view.
- The default columns on the page should show the summary column with
four of the following badges: `service.name`, `event.outcome`,
`transaction.name`, `transaction.duration.us`, `span.name`,
`span.duration.us`
- Go to ESQL mode with the query targetting a `traces` index
- The default columns should show the same as in Data View mode

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
2025-03-19 15:52:30 +01:00
Carlos Crespo
2f453ac2b7
[Synthtrace] Synthtrace to generate unique ids (#214637)
closes [214636](https://github.com/elastic/kibana/issues/214636)

## Summary

This PR updates the id generation logic in Synthtrace to ensure the
uniqueness of generated ids. The change addresses the issue of ID
collisions when Synthtrace is executed on multiple pods in parallel, as
observed in the edge clusters.

This change will affect APM traces, but the idea could be extended to
other scenarios requiring unique/random ids in the test environments.


### Performance

| Length | Sequential id generator | Random id generator |
| --| -----------------------| ----------------------|
| 16 chars | ~0.005ms | ~ 0.007ms |
| 32 chars | ~0.005ms | ~ 0.007ms |

### How to test

Execute this query after running synthtrace.

```bash
curl -X GET "http://elastic:changeme@localhost:9200/apm*,traces-apm*/_search" -H "Content-Type: application/json" -d '{
  "size": 1,
  "query": {
    "bool": {
      "filter": [
        {
          "terms": {
            "processor.event": [
              "transaction",
              "span"
            ]
          }
        }
      ]
    }
  },
  "_source": [
    "span.id",
    "transaction.id",
    "trace.id",
    "error.id"
  ]
}' | jq '.hits.hits[]._source'
```


**Historical data**


*Sequential ids*

```bash
node scripts/synthtrace service_map_oom.ts --from=now-5m to=now --clean --workers=1
```

```json
{
  "trace": {
    "id": "56956000000000000000000000281715"
  },
  "transaction": {
    "id": "5695600000281714"
  }
}
```

*Random ids*

```bash
node scripts/synthtrace service_map_oom.ts --from=now-5m to=now --clean --workers=1 --uniqueIds
```

```json
{
  "trace": {
    "id": "9dd787e4c55948000000000000081916"
  },
  "transaction": {
    "id": "9dd709a2f7979800"
  }
}
```


**Live data**

*Sequential ids*

```bash
node scripts/synthtrace service_map_oom.ts --live --clean
```

```json
{
  "trace": {
    "id": "58384000000000000000000000001995"
  },
  "transaction": {
    "id": "5838400000001994"
  }
}

```
*Random ids*

```bash
node scripts/synthtrace service_map_oom.ts --live --clean --uniqueIds
```

```json
{
  "trace": {
    "id": "3d8b3401711004000000000000001996"
  },
  "transaction": {
    "id": "3d834f49b9bb0c00"
  }
}
```
2025-03-19 15:44:01 +01:00
Devin W. Hurley
cd491c34e7
[Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284)
fixes flakey test https://github.com/elastic/kibana/issues/209024
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2025-03-19 09:12:38 -04:00
Maria Iriarte
347e384b91
[Lens/SCSS] Delete and migrate annotations.scss file (#209074)
## Summary

Part of https://github.com/elastic/kibana/issues/208908

Replaces scss to css-in-js.


### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 14:04:02 +01:00
Jatin Kathuria
89a56ec73c
[Security Solution] Fix - Extra timeline space because of Borealis changes (#215124)
## Summary

This very small PR fixes an extra space below querybar in timeline. This
was issue because of what `euiThemeVars` v/s`euiTheme` returns as a size
i.e. `8` v/s `8px`

### Before

![image](https://github.com/user-attachments/assets/ee767778-741b-4430-aac2-543a08b50822)


### After

![image](https://github.com/user-attachments/assets/cf9eca1c-8c99-43ef-96f4-914e68fcc233)



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-03-19 14:45:21 +02:00
Maria Iriarte
1dbaf0e22b
[Graph/SCSS] Migrate _guidance_panel.scss file to Emotion (#214929)
## Summary

Part of https://github.com/elastic/kibana/issues/208908

Replaces scss `_guidance_panel.scss` file to css-in-js .

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-19 14:40:16 +02:00
Sergi Romeu
0ee664a555
[APM] Prevent getChildrenGroupedByParentId to include the parent in the children list (#214957)
## Summary

Closes #213074

This PR prevents `getChildrenGroupedByParentId` to include the parent
item in the children list, as this was causing some duplication.

| Before | After |

|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
<img width="1433" alt="image"
src="https://github.com/user-attachments/assets/788684a8-21d7-48a6-820c-07b1fb3d0045"
/>|<img width="858" alt="image"
src="https://github.com/user-attachments/assets/b68129e1-137d-42fe-a7ce-70373447ece9"
/>|
|<img width="1372" alt="image"
src="https://github.com/user-attachments/assets/ff6a5ac8-b46a-4eea-9c4c-638f4b479dc8"
/>|<img width="844" alt="image"
src="https://github.com/user-attachments/assets/31ef881c-a6d0-41ea-80d4-aebd587e76cd"
/>|
2025-03-19 13:28:20 +01:00
Stratoula Kalafateli
4a8915e98e
[ES|QL] Update grammars (manually) (#215091)
## Summary

Update the antlr to get the latest changes, especially the double
parameter one which is blocking the work for variables
2025-03-19 12:55:46 +01:00
Marco Liberati
cc52db1474
[Lens][Embeddable] fix can edit check (#213887)
## Summary

This PR fixes a regression introduced for user messages.
The `viewMode` check moved from observable to its raw value but still
performing the observable check.

The fix is to check both the panel `viewMode` AND as fallback the
embeddable hierarchy viewMode until the `edit` mode is met.

---------

Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
2025-03-19 12:50:04 +01:00
Abhishek Bhatia
90dd368e71
[Security Solution][Entity Analytics][Bug][Risk Score]Changes to replace 30m to 30d for Risk score lookback period (#215093)
## Summary

The PR updates the code to extend the lookback period for Risk scoring
calculations from `now-30m` to `now-30d`.

This change impacts:  
- Risk score UI (date picker)
- The preview API  
- The enable API (for Risk Score Saved Object configuration)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Screenshots : 

## UI and Preview API payload


![image](https://github.com/user-attachments/assets/9a074dc4-328f-405b-8ffe-5ce8a7def3d6)

## Risk Engine configuration SO


![image](https://github.com/user-attachments/assets/bfd4f6f8-3f1c-4f83-8247-66b9e93a71c2)


## Testing Steps:

1. Navigate to the Entity Analytics management page (Entity Risk Score
webpage).
2. Ensure the default text in the date picker displays **"Last 30
days"**.
3. Open the **Network** tab in Developer Tools and verify that the
**"preview"** API request reflects a 30-day difference between the
`from` and `to` values.
4. If the **Risk Engine** is enabled, disable it and open a window
displaying Kibana logs.
5. Re-enable the **Risk Engine** and check the logs for the
configuration message: **"Risk engine running with configuration"**. The
expected range should be:
   ```json
   "range": {
     "start": "now/M",
     "end": "now"
   }
   ```


## Advanced Testing Steps  

1. The date picker should default to **"Last 30 days"**. If you change
it to **"Yesterday"** without clicking **Save changes**, the **Preview
API** should reflect "Yesterday," but the **Saved Object (SO)** should
**not** update its range.
2. Upon refreshing the page without saving the changes, the date picker
should reset to its default value, **"Last 30 days"**.
2025-03-19 17:16:24 +05:30
Julia Rechkunova
328ce08494
[Discover Tabs] Visually connect the active tab with the top nav (#214440)
- Closes https://github.com/elastic/kibana/issues/210864

## Summary

This PR changes tabs styles and visually connects the selected tab with
the Kibana header.

Classic view:

<img width="1439" alt="Screenshot 2025-03-17 at 13 26 16"
src="https://github.com/user-attachments/assets/31dc0311-7bc1-4bc8-9b83-48f40227705f"
/>
<img width="1435" alt="Screenshot 2025-03-17 at 13 26 52"
src="https://github.com/user-attachments/assets/301963fb-3207-49ae-ab70-177834f3a73f"
/>


Project view:

<img width="1438" alt="Screenshot 2025-03-17 at 13 25 34"
src="https://github.com/user-attachments/assets/df1d1bff-82f8-4eed-9cf3-b3e557f5658c"
/>
<img width="1437" alt="Screenshot 2025-03-17 at 13 24 58"
src="https://github.com/user-attachments/assets/dfe27fc7-1cfe-4695-b1fd-2e306adc8787"
/>

### Testing

Two options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 13:33:51 +02:00
Jesus Wahrman
e14369edab
Add strip unkowns to nested objects in maps, arrays and records (#214978)
## Summary

Resolves https://github.com/elastic/kibana/issues/210617

Added strip unkowns to nested objects in map, array and record. Added a
lot of test cases to cover things like objects inside maps, objects
inside records, objects inside maps inside records, ...

One thing to note is that we can't apply `stripUnkowns` to
`schema.oneOf` since it's using `joi.alternatives` and you can't use it
there.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-19 11:38:31 +01:00