Commit graph

47234 commits

Author SHA1 Message Date
Milton Hultgren
53263fd9fc
[kbn/server-route-repository] Make security required (#216196)
To mirror the changes in https://github.com/elastic/kibana/pull/215180
2025-04-09 12:51:54 +02:00
Dario Gieselaar
bdfc5a53f8
[Profiler] Grep for processes (#216770)
Grep for running Node.js processes if specified.
2025-04-09 12:15:53 +02:00
Janki Salvi
adbc6d9a38
[ResponseOps][Alerts] Remove fieldsForAad attribute from rule type registry (#215767)
## Summary

Implements https://github.com/elastic/kibana/issues/215338

This PR removes `fieldsForAAD ` and `hasFieldsForAAD ` from the rule
type registry and all corresponding rule types.
It uses existing `getBrowserFieldsByFeatureId ` route to fetch fields
from
[field_caps](https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-field-caps.html)
API.

It also updates `getBrowserFieldsByFeatureId` route 
- to use `include_empty_fields: false` query param to fetch only non
empty fields to have limited number of fields
- to use `index filter` to fetch fields only from last 90 days for
better performance
    ```
       const indexFilter = {
              range: {
                '@timestamp': {
                  gte: 'now-90d',
                },
              },
            };
    ```   


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### Flaky Test runner: 
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8151

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-09 12:05:05 +02:00
Joe Reuter
102ceb65e3
🌊 Streams: Fix indices link (#217229)
The link to all indices of a data stream from the streams UI didn't work
properly because `includeHiddenIndices` wasn't set properly.

To fix it and prevent it breaking in another place, I moved the logic to
the locator itself
2025-04-09 11:56:36 +02:00
Arturo Lidueña
4109420186
update knowledge base installation flow (#214133)
## Summary
Closes [#209791](https://github.com/elastic/kibana/issues/209791)
Closes [#204378](https://github.com/elastic/kibana/issues/204378)
### Improve Knowledge Base Installation and Inference Endpoint
Management

#### Enhancements  
- The **"Install Knowledge Base"** button is only shown when there is no
inference endpoint. If the inference endpoint creation fails, an error
notification is displayed.
- When an inference endpoint **exists and is ready**, no buttons or
messages are shown.
- If the installation was in progress and **succeeded**, a success
message is displayed.
- If an inference endpoint is present, users can **inspect the state of
the model deployment** to diagnose issues.
- When an inference endpoint exists but has an **error**, users can
retry the installation.

#### Inspection & Troubleshooting  
Users can inspect the inference endpoint's deployment status, including:
- **Model is deploying**  
- **No ML node available**  
- **Insufficient memory available**  


https://github.com/user-attachments/assets/03a91120-173c-4dc9-b6f2-59a8c8c8defb

### Suggested Improvements  
- Display **autoscaling information** for better resource insights.  
- Show **ML node details** to help users understand the infrastructure.
- Allow users to **install, deploy, and stop the model** directly from
the inspection popup.

These changes enhance visibility, troubleshooting, and control over
inference endpoint deployment. 🚀


### 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-04-09 11:38:41 +02:00
Tomasz Ciecierski
795094d8c6
[AI4DSOC] Change rules and alerts capabilities (#215148) 2025-04-09 11:29:09 +02:00
Robert Oskamp
e710e98fe0
[workchat] Initial FTR test setup (#216828)
## Summary

This PR adds the structure for workchat FTR tests and adds a few initial
tests as an example.

### Details about initially added tests

New test directories:
- `x-pack/test_serverless/api_integration/test_suites/chat`
  - load a few common tests (that run on all project types)
- run `platform` security tests (taken over from `search` project type)
- `x-pack/test_serverless/functional/services/svl_chat_navigation.ts`
  - load the `home page` common test
- run a simple navigation test, using the `svlChatNavigation` service
that has been introduced as an example

Note that these tests mostly serve as examples to prove things are
actually running and will have to be adjusted / removed / extended over
time. The purpose of this PR is NOT to add proper test coverage.

Closes #213469

---------

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2025-04-09 10:31:12 +02:00
Marco Antonio Ghiani
4302da3b6d
[Streams 🌊] Move management page + update Streams template (#217487)
## 📓 Summary

Closes https://github.com/elastic/streams-program/issues/233

This work applies changes as follows:
- Move stream management section into a standalone page
- Update routing config to support nested breadcrumbs and keep shared
stream retrieval between detail <-> management
- Replace custom panels with EuiTemplate for stream pages. Remove
previous ad-hoc components
- Improve stream detail view validation (add redirect) for unknown
stream detail sections
2025-04-09 10:19:11 +02:00
Miriam
92a9f8531a
[ObsUx][A11y] Add unique accessible lables to metadata table (#217496)
Closes https://github.com/elastic/kibana/issues/194972

## Summary

Add unique accessible labels to metadata table

### How to test

Use a screen reader to navigate the table

On Host details, Metadata tab

1. Verify the first column in the table header announces Pin Fields
column

<img width="1262" alt="Screenshot 2025-04-08 at 12 38 28"
src="https://github.com/user-attachments/assets/bdac5799-97d4-4001-b5f0-f9230227b749"
/>

2. Verify the Pin column row announces which field pins

<img width="1262" alt="Screenshot 2025-04-08 at 12 38 45"
src="https://github.com/user-attachments/assets/a9a18fc4-4f46-49d7-880e-9b77eca476dd"
/>

<img width="1262" alt="Screenshot 2025-04-08 at 12 39 14"
src="https://github.com/user-attachments/assets/889ca03f-aa00-4360-87b5-6d767fe11cff"
/>

3. Verify the "+ x more" does announce more of which field

<img width="1262" alt="Screenshot 2025-04-08 at 12 39 35"
src="https://github.com/user-attachments/assets/dfba3fd9-7e71-4ef6-956e-3761094f4667"
/>
2025-04-09 08:41:30 +01:00
Carlos Crespo
704a3d4a9e
[APM] Treat "links" field as array (#215906)
Fixes [#215706](https://github.com/elastic/kibana/issues/215706)

## Summary

This fixes the problem where Otel span links were not considered a
collection of links.


<img width="1721" alt="image"
src="https://github.com/user-attachments/assets/bce354d5-8473-41db-856e-3bbb66b88c18"
/>


### How to test

Run: `node scripts/synthtrace span_links.ts --live --uniqueIds --clean
--logLevel=debug --scenarioOpts pipeline=apmToOtel` and wait a few
minutes

Navigate to Services Inventory -> product consumer -> Transactions and
inspect the span links from `Span B`

Run the query below to confirm that there are `links` with a collection
of items
```
GET traces-*otel*/_search
{
  "query": {
    "exists": {
      "field": "links*"
    }
  }
}
```
2025-04-09 09:10:15 +02:00
Sergi Romeu
749f57c12f
[A11y][APM] Add missing aria-label for some services buttons (#217325)
## Summary

Fixes #212264

This PR adds a couple of `aria-label` attributes to buttons that do not
have a screen-reader announcement under the Services and Services Groups
pages.
2025-04-09 09:02:15 +02:00
Weronika Olejniczak
1204458d2a
Upgrade EUI to v101.3.0 (#217491)
`101.2.0`  `101.3.0`

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

## Package updates

### `@elastic/eui`

#### [`v101.3.0`](https://github.com/elastic/eui/releases/v101.3.0)

- Updated 78 existing and added two new glyphs (`code` and
`checkCircle`) for `EuiIcon`
([#8530](https://github.com/elastic/eui/pull/8530))
- Changed `gutterSize` to `m` between right side items on
`EuiPageHeader` ([#8529](https://github.com/elastic/eui/pull/8529))

**Bug fixes**

- Fixed a visual bug on disabled `EuiButton` in high contrast mode where
wrong text colors were applied
([#8550](https://github.com/elastic/eui/pull/8550))
2025-04-09 08:05:42 +02:00
Dzmitry Lemechko
a234f3646c
[ftr] split feature controls tests into v1/v2 configs (#217458)
## Summary

Splitting long running config:
`x-pack/test/functional/apps/saved_query_management/config.ts` **~57
min** into

  - x-pack/test/functional/apps/saved_query_management/config.ts 35m 
- x-pack/test/functional/apps/saved_query_management/config.v2.ts 25m
17s

ideally we need to split both even more, but I will leave it for the
later (probably Data-Discovery Team have some ideas how to re-org it?)
2025-04-08 19:01:06 -03:00
Paul Tavares
990432ccc0
[Security Solution][Endpoint] Fix endpoint package policy update Fleet extension callback error (#217391)
## Summary

### Fleet Changes

- Added a debug statement to the execution of external callbacks that
outputs `callback.toString()` whenever an external callback throws an
error
- The output of `callback.toString()` should help identify the code
behind the callback that threw an error and assist with debugging

### Security Solution

- Fixes the Endpoint package policy update callback that is registered
with Fleet to now throw an error while attempting to report policy
protection feature usage. (see error below)
- Fleet recently made a change to `PackagePolicy.bulkUpdate()` service
method that ensure registered callbacks for policy update is called,
which seems to be the reason why this started to happen recently. Its
unclear why this error is occurring being that Space Awareness features
are currently disabled by default.
2025-04-08 14:37:54 -04:00
Melissa Alvarez
f51ac13197
[ML] Moves job and trained model management features into Stack Management (#204290)
## Summary

Updates the navigation for Machine Learning pages, moving admin tasks
for managing ML jobs and models to a single place inside Stack
Management, and leaving exploratory tasks in a consolidated top-level
Machine Learning menu.

The available items vary by solution, so that the navigation for an
Elasticsearch project, for example, contains a single item for managing
trained models.

#### Stack management menu for classic/observability/security nav
<img width="275" alt="Screenshot 2025-04-04 at 16 10 04"
src="https://github.com/user-attachments/assets/14b6e8d4-7111-4fbd-ae5d-9f389f83f23c"
/>

#### Stack management for search:
<img width="271" alt="Screenshot 2025-04-07 at 14 38 45"
src="https://github.com/user-attachments/assets/e104bf20-8a4d-4eed-9b5b-9c05944091ca"
/>


#### Machine Learning menu for Classic nav
<img width="341" alt="Screenshot 2025-04-07 at 14 22 03"
src="https://github.com/user-attachments/assets/610efd59-311f-410f-9881-548359ca7997"
/>


#### Machine Learning menu for Observability
<img width="522" alt="Screenshot 2025-04-04 at 16 11 48"
src="https://github.com/user-attachments/assets/ef16acf1-4d39-4494-a5d3-0fb078d74730"
/>


#### Machine Learning menu for Security
<img width="528" alt="Screenshot 2025-04-04 at 17 46 43"
src="https://github.com/user-attachments/assets/2df20c20-b894-4421-a732-9370bb5d6f2d"
/>


### 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/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
- [ ] 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)
- [ ] ...

---------

Co-authored-by: Quynh Nguyen <quynh.nguyen@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2025-04-08 19:52:16 +02:00
Mason Herron
b0c0917fa7
[Fleet] Add 'No Tags' filter to agent table (#216944)
## Summary

Closes #213933 

Adds a `No Tags` filter to the filter select on the agents table so that
users can filter for agents without tags.


https://github.com/user-attachments/assets/1223d049-1f21-4565-854c-75776ae4609b



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

N/A
2025-04-08 19:47:27 +02:00
Marco Vettorello
971edc124a
[Lens] Fix getIndexPatternsObjects for index-pattern only and minor cleanups (#215325)
## Summary

This PR fixes the https://github.com/elastic/kibana/issues/215323 issue
and also provide small cleanup on the code near the edited file, not
directly correlated but I was already there and the changes are pretty
minimal.

Cleanups:

- the `SavedObjectReference` is deprecated and needs to be imported from
`core/server` instead
- Looking at the locator I've noticed a couple of non-null assertion
that wasn't necessary
- the locator readme was referencing the old `kibana app services` team
- cleaned up the `x-pack/platform/plugins/shared/lens/public/utils.ts`
to align all the method to use the same form (or all functions or all
arrow function, there was a pretty interesting mix there)
- replaced usages of exclusive OR with a more appropriate nullish
coalescing operator
2025-04-08 18:31:56 +02:00
Dominique Clarke
9d56263413
[Chore] Remove Investigate plugin, Investigate app plugin, and Investigation-schema package (#216342)
## Summary

Removes unused code from the Investigate and Investigate app plugin.

Removes all references to those plugins in storybook, i18n, types, etc.

Removes codeowner requirements for those plugins

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 12:25:21 -04:00
Viduni Wickramarachchi
a2e0bb1422
[Obs AI Assistant] Remove direct function calling from the chat input (#217359)
Closes https://github.com/elastic/kibana/issues/215206

## Summary

Removes direct function calling capabilities as this feature is not
important anymore.

Before:

<img width="588" alt="image"
src="https://github.com/user-attachments/assets/5c4e3dfb-a8dd-420b-aa02-389a2d4f7b5c"
/>

After:

<img width="592" alt="image"
src="https://github.com/user-attachments/assets/97bea8d0-f1e9-43c7-a4df-42e094861879"
/>


### 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] 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-04-08 12:17:46 -04:00
Saarika Bhasi
9c3c0b72da
[Onboarding] search playground UX improvements (#217243)
## Summary

Update search playground UI to align with new design. Updated following
in this PR

- [x] Remove pagination from top of search results.
- [x] Hide Field & Contents when document is not expanded
- [x] Remove space between search results but shows space when expanded.
- [x] Enable clear search for the search bar and updated to search as
user types
- [x] Update empty state text

## Demo

https://github.com/user-attachments/assets/9242061b-5f40-4cb0-b2c5-b3a4bdebd982




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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/src/platform/packages/shared/kbn-i18n/README.md)
2025-04-08 12:17:21 -04:00
Viduni Wickramarachchi
3aa036d515
[Obs AI Assistant] Archiving conversations (#216012)
Closes https://github.com/elastic/kibana/issues/209386

## Summary

1. The option to archive conversations are enabled via the conversation
contextual menu.
2. Archived conversations can be viewed under the "Archived" section of
the conversation list.
3. Only the owner of the conversation can archive and unarchive.
4. Once archived, the conversation cannot be continued until unarchived.
5. If the archived conversation is shared, other users (who are not the
owner) can duplicate the conversation, if they wish to continue the
conversation.
6. The archived section of the conversation list is collapsed by
default.
7. Updating the conversation such as title updates, regenerating,
providing chat feedback are disabled for archived conversations

### 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/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 10:42:20 -04:00
Søren Louv-Jansen
a5f3c0ad03
[LockManager] Fix flaky API test (#217470)
Related: https://github.com/elastic/kibana/pull/216916

The flaky test runner is sometimes throwing this error:

```

└-: withLock API
--
  | └-> "before all" hook: beforeTestSuite.trigger in "withLock API"
  | └-> "before all" hook in "withLock API"
  | └- ✖ fail: Stateful Observability - Deployment-agnostic API integration tests observability AI Assistant LockManager withLock API "before all" hook in "withLock API"
  | │       ResponseError: {"took":1,"timed_out":false,"total":1,"deleted":0,"batches":1,"version_conflicts":1,"noops":0,"retries":{"bulk":0,"search":0},"throttled_millis":0,"requests_per_second":-1,"throttled_until_millis":0,"failures":[{"index":".kibana_locks-000001","id":"my_lock_with_token_fencing","cause":{"type":"version_conflict_engine_exception","reason":"[my_lock_with_token_fencing]: version conflict, required seqNo [117], primary term[1]. but no document was found","index_uuid":"F_O5sNfQSLqtyPeLexG_Qw","shard":"0","index":".kibana_locks-000001"},"status":409}]}
  | │       at SniffingTransport._request (node_modules/@elastic/elasticsearch/node_modules/@elastic/transport/src/Transport.ts:605:17)
  | │       at processTicksAndRejections (node:internal/process/task_queues:95:5)
  | │       at /opt/buildkite-agent/builds/bk-agent-prod-gcp-1744099176361402458/elastic/kibana-flaky-test-suite-runner/kibana/node_modules/@elastic/elasticsearch/node_modules/@elastic/transport/src/Transport.ts:711:22
  | │       at SniffingTransport.request (node_modules/@elastic/elasticsearch/node_modules/@elastic/transport/src/Transport.ts:708:14)
  | │       at Client.DeleteByQueryApi [as deleteByQuery] (node_modules/@elastic/src/api/api/delete_by_query.ts:143:10)
  | │       at Context.<anonymous> (distributed_lock_manager.spec.ts:444:9)
  | │       at Object.apply (wrap_function.js:74:16)
```

The error happens when `release` and `clearAllLocks` simultaneously
tries to delete the same document. This PR ensures that `clearAllLocks`
will not throw an exception on conflict
2025-04-08 16:06:05 +02:00
Joe Reuter
fd374463f7
🌊 Streams: Permission handling (#217353)
Currently, the streams UI doesn't deal well with partial permissions.
This PR improves that. As a lot of things come together in streams, we
could do even better, but I think it's OK to draw a line somewhere.

The logic is now as follows:
When reading a stream, the privileges of the current user are returned
along with the stream itself. These are grouped like this:
```
interface IngestStreamPrivileges {
  // User can change everything about the stream
  manage: boolean;
  // User can read stats (like size in bytes) about the stream
  monitor: boolean;
  // User can change the retention policy of the stream
  lifecycle: boolean;
  // User can simulate changes to the processing or the mapping of the stream
  simulate: boolean;
}
```

This is part of the definition response and is passed around to the
components and disabled buttons and similar in the places where this is
necessary.

The "advanced" tab is only shown when full `manage` permissions are
present - there constellations of permissions that would allow some
access but not all (e.g. having `read_pipelines` but not
`manage_index_templates`), but these should be rather rare and not worth
the additional effort.

## Conditions

In the following places privileges are checked:
* Overview
  * Without `monitor`, the overall stats are not shown
* Enrichment
  * Without `manage`, you can't save changes
  * Without `simulate`, the UI is readonly
* Partitioning
  * Without `manage`, you can't save changes
  * Without `simulate`, the UI is readonly
* Schema editor
  * Without `manage`, the UI is readonly
* Retention
  * Without `monitor`, the ingest stats are not shown
* Without `lifecycle`, the retention can't be changed and ILM breakdown
is not rendered
* Advanced
  * Without `manage`, the tab is hidden completely

## Drive-by fix

I noticed that we still register the app header action menu which adds
an empty bar on serverless, removed that code.

## Testing

Check
https://github.com/elastic/kibana/pull/217353/files#diff-d8f33d7021058bf90cbeea908bf399da2af50d8b8bfac8a07f160ddc0cdff12bR747
for which Elasticsearch level privileges you need for different
permutations. Then set up a role and a user and log in as that user.

Also test the different pre-defined roles on serverless.
2025-04-08 15:42:29 +02:00
Paul Tavares
970e9fe4a3
[Security Solution][Endpoint] Update artifact export api in support of space awareness (#217102)
## Summary

### Lists plugin:

- Add the ability to pass a KQL `filter` to the
exportExceptionListAndItems()` server-side service
- NOTE: this `filter` property is NOT exposed via the public API. Only
used internally
- Fixes the `getExcetionList()` service method to ensure that if a list
if not found using the `id`, that it attempts to then find it using
`list_id` if that was provided on input to the method.


### Security Solution:

- Export for endpoint artifacts was updated with additional filtering
criteria to ensure that only artifact accessible in active space are
included in the export
2025-04-08 15:28:05 +02:00
Nicolas Chaulet
587add8e60
[Fleet] Compare agent version with build (#217376) 2025-04-08 09:27:32 -04:00
Dzmitry Lemechko
aa9be6a621
[ftr] split oblt DA configs to speedup CI (#217452)
## Summary

Splitting the following config:

-
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
**~61 min**

by moving `ai_assistant`, `synthetics` and `streams` tests in its own
configs

-
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.ai_assistant.serverless.config.ts
~11m 30s
-
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.synthetics.serverless.config.ts
~21m 30s
-
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.streams.serverless.config.ts
~21m 43s

original config with less tests:
-
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
~17 min
2025-04-08 08:14:58 -05:00
Mason Herron
f8f6e6ed0a
[Fleet] Move log level setting to settings tab (#217112)
## Summary

Closes #197707 

Moves the log level setting on an agent from the `Logs` tab, to a newly
created `Settings` tab

Before: 

![image](https://github.com/user-attachments/assets/1532f698-73e6-49dd-9dbf-037d75483e2b)

After: 

![image](https://github.com/user-attachments/assets/1239a451-dc5d-465c-a090-22bc220c8b17)


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

N/A

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 09:12:49 -04:00
Milton Hultgren
fa23a90d80
🌊 Refactor API control flow for stream management (#211696)
### Background
This PR is a proposal for a different way to structure the Streams code
flow based on some challenges faced while working on
https://github.com/elastic/streams-program/issues/26 and discussed
[here](https://github.com/elastic/streams-program/discussions/147) and
[here](https://github.com/elastic/streams-program/discussions/55),
mainly around finding it difficult to decide where to place certain
validations that need access to the state as a whole.
It is also in response to some expressed difficulty about how to add new
stream types into the code base.

It aims to achieve 3 goals:
1. It is easy to add new stream types and there is a clear place where
changes (new validation, new logic) for existing stream types happen,
making the code easier to evolve over time
2. It is easier to improve the robustness of the system because there
are clear phases where problems can be caught, fixed and rolled back
3. It lays some ground work for features such as [bulk
changes](https://github.com/elastic/streams-program/issues/125), [dry
runs](https://github.com/elastic/streams-program/discussions/138) and a
[health
endpoint](https://github.com/elastic/streams-program/discussions/139)

In the future, this will most likely be handled by Elasticsearch to a
large degree, as imagined in
https://github.com/elastic/streams-program/discussions/30

The solution takes inspiration from the reconciliation / controller
pattern that Kubernetes uses, where users specify a desired state and
the system takes action towards reaching that step. But it is also
somewhat more similar to how React's Virtual DOM works in that it
happens in a single iteration.

Another key pattern is the [Active Record
pattern](https://www.martinfowler.com/eaaCatalog/activeRecord.html), we
let each stream class contain all the logic for how to validate and
modify that stream in Elasticsearch. The client and `State` class simply
orchestrate the flow but defer all actual work and decision making to
the stream classes.

**Note:** This PoC ignores the management of assets 

### Summary

The process takes the following steps:
1. A route accepts a request (upsert / delete) and translates it into
one or more (for bulk) `StreamChange` objects before passing these to
`State.applyChanges` method (which also takes a toggle for dry runs)
2. The current state of Streams is loaded by using the `State` class
3. The changes are then applied to the current state to derive the
desired state [1]
4. The desired state is then validated, this is done by asking each
individual stream if given the desired state and starting state, from
the perspective of that individual stream, is it in a valid state
(upserted or deleted correctly)
5. If the state is invalid, we return those errors and stop
6. Else we continue, if it's a dry run, we ask the desired state object
for what has changed and report that in the shape of the Elasticsearch
actions that would be attempted
7. Else we proceed to commit the changes to Elasticsearch by asking each
changed stream to determine which Elasticsearch actions need to be
performed to reach the desired state
8. These actions are then combined and sent to the `ExecutionPlan` class
which does planning (mainly for actions around Unwired streams) and then
handles executing the actions in the most parallel way but in the safe
order
9. If any error happens, we attempt to revert back to the starting state
by taking the changed streams and marking each stream as created based
on the starting state and then getting the Elasticsearch actions for
that and applying those

This PR also changes our `resync` endpoint to make use of the same rough
strategy (load current state, mark all as created, get Elasticsearch
actions and apply).

[1] Applying changes:

1. The current state is first cloned
2. Then for each change we see if it is a deletion or an upsert
3. Based on this we either mark existing streams for deletion or
create/update existing streams
10. When creating a new stream instance we use the helper
`streamFromDefinition` which is the only mapping between the definition
documents and the Active Record-style stream type classes
11. As part of this, each stream that changes is marked in the desired
state
12. The stream is passed the desired and current state and should update
itself based on the change
13. The stream can return a set of cascading changes (taking the same
format as the requested changes) which are executed directly after but
we have a limit for how many rounds of cascading changes can happen to
avoid infinite loops

### Adding new stream types

Key in all of this is that the client and `State` classes don't know
anything about any of the specific stream types, they know only of the
`StreamActiveRecord` interface.
When adding a new stream type you need to implement this interface and
update `streamFromDefinition` to create the right class for your new
definition. Streams of different types should only interact with each
other by creating cascading changes.

### Possible follow up tasks
- Introduce a lazy Elasticsearch cluster state cache because multiple
places in the code access the same stuff over and over again
- Make API endpoints the consume `attemptChanges` pass back the
`DesiredState` and planned `ElasticsearchActions` as debug information
based on a flag (maybe also all cascading changes)
- Don't run cascading changes by default but run them if _some_ flag is
submitted based on
https://github.com/elastic/streams-program/discussions/230
- Wrap `attemptChanges` and `resync` with the new LockManager
https://github.com/elastic/kibana/pull/216397
- Unit test WiredStream, UnwiredStream and GroupStream
- Clean up old sync helpers 
- Wrap ES calls to get better stack traces for errors

### Out of scope

- Asset linking and content pack installation (it's probably okay for
these to continue to use the asset client directly since there is less
domain logic and no cascading changes involved)

---------

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 13:02:56 +02:00
Elena Shostak
18ca869d92
Added DisabledAuthz utility (#216633)
## Summary

Added `DisabledAuthz` utility class, this will address the current
repetition of the reason string `'This route delegates authorization to
the ES/SO client` and other common scenarios.

__Closes: https://github.com/elastic/kibana/issues/216632__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
2025-04-08 12:59:28 +02:00
Luca Wintergerst
05712f2bf8
[Streams] Data ingestion tooltip (#217453)
Adds a tooltip to the histogram, and adjusts the wording of the other
ingestion tooltips slightly

Before:
![CleanShot 2025-04-08 at 10 26
28@2x](https://github.com/user-attachments/assets/49d9c242-9a3f-42a4-a787-c3a1f3da6b51)
After:
![CleanShot 2025-04-08 at 10 22
33@2x](https://github.com/user-attachments/assets/a816be12-0d06-4184-9803-8b161932dc95)
2025-04-08 12:27:09 +02:00
Alejandro Fernández Haro
3ab31d3fc9
[ES 9.0] Remove body workaround (@elastic/fleet) (#217218)
## Summary

Follow up to https://github.com/elastic/kibana/pull/213375: The latest
version of the ES client fixed the issue
https://github.com/elastic/elasticsearch-js/issues/2584.

We should be able to remove all usages of `// @ts-expect-error
elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`.


### 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-04-08 11:34:26 +02:00
Alejandro Fernández Haro
e7dbe43e28
[ES 9.0] Remove body workaround (@elastic/security-entity-analytics) (#217225)
## Summary

Follow up to https://github.com/elastic/kibana/pull/213375: The latest
version of the ES client fixed the issue
https://github.com/elastic/elasticsearch-js/issues/2584.

We should be able to remove all usages of `// @ts-expect-error
elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`.
2025-04-08 11:10:46 +02:00
Joe Reuter
86fab6e2b4
🌊 Streams: Small bug fixes (#217309)
* Preview tables for enrichment and partitioning showed header actions
which were not actually taking effect (now disabled)
* Ingest pipeline was linking to "not found" flyout if data stream
doesn't have a default ingest pipeline
* Index pattern for discover link and histogram was built the wrong way
(shows child streams for classic streams instead of wired streams)
2025-04-08 10:58:02 +02:00
Lene Gadewoll
0f4361d05d
[HCM] High contrast mode style adjustments (#216964)
## Summary

This PR adds a couple of style fixes to ensure improved visual output in
high contrast mode.

The updates focus on borders, mainly removing duplicate borders due to
nested `EuiPanel` usages and ensuring custom borders are correctly
applied and receive a high contrast color.

### Changes

| Solution | Before | After |
|--------|-----|-----|
| discover | ![Screenshot 2025-04-03 at 09 48
20](https://github.com/user-attachments/assets/068c5dc7-be38-482a-9b60-74ec15ec0c69)
| ![Screenshot 2025-04-03 at 09 50
45](https://github.com/user-attachments/assets/3e06c775-6c4f-481f-9186-334803ee0f3b)
|
| dashboard | ![Screenshot 2025-04-03 at 09 32
56](https://github.com/user-attachments/assets/ca4cda9d-5607-4aff-9485-b9e5a864322f)
| ![Screenshot 2025-04-03 at 09 31
44](https://github.com/user-attachments/assets/0324d367-f86e-440b-950a-a4debd77962c)
|
| dashboard | ![Screenshot 2025-04-03 at 09 33
07](https://github.com/user-attachments/assets/3aac0640-1d34-4f03-8d47-32253d6f7092)
| ![Screenshot 2025-04-03 at 09 33
37](https://github.com/user-attachments/assets/9679e008-9aac-441c-ae0c-5d713eb83a61)
|
| elasticsearch | ![Screenshot 2025-04-03 at 09 40
26](https://github.com/user-attachments/assets/ced77757-086a-4dc6-ab9d-4befcd543177)
| ![Screenshot 2025-04-03 at 09 41
36](https://github.com/user-attachments/assets/39f51db1-fb0b-4231-9d58-cd3100e1f7f8)
|
| observability | ![Screenshot 2025-04-03 at 09 47
40](https://github.com/user-attachments/assets/568c9c60-63ea-4ffa-9155-26bd160600c5)
| ![Screenshot 2025-04-03 at 09 47
55](https://github.com/user-attachments/assets/be036721-fccc-4514-b7b0-67340087b020)
|
| security | ![Screenshot 2025-04-03 at 09 31
01](https://github.com/user-attachments/assets/01b24035-54bc-4471-a5b8-df3446fbc230)
| ![Screenshot 2025-04-03 at 09 30
46](https://github.com/user-attachments/assets/fbb3ac03-50fe-4ecc-aaeb-e0dfecabc566)
|

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-08 10:39:07 +02:00
Ievgen Sorokopud
6ab8808d72
[Attack Discovery][Scheduling] Use core.services.featureFlags to control access to assistantAttackDiscoverySchedulingEnabled feature flag (#12005) (#217306)
## Summary

Feature description: [internal
link](https://github.com/elastic/security-team/issues/10142)
Part of: [internal
link](https://github.com/elastic/security-team/issues/12005)

These changes we switched to `core.services.featureFlags` to manage the
`assistantAttackDiscoverySchedulingEnabled` feature flag to control
visibility of the Attack Discovery Scheduling feature.

To enable the flag locally, add this in the `kibana.dev.yml`:

```
feature_flags.overrides:
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```
2025-04-08 10:24:35 +02:00
José Luis González
ba91787976
[Search][Query Rules] Ruleset table (#217170)
## Summary

Listing the rulsets created, otherwise the Empty prompt will be
rendered.

- [x] Create paginated query ruleset table as with design.
- [x] This is the table only, no edit/create/update actions available.

![CleanShot 2025-04-04 at 14 53
17@2x](https://github.com/user-attachments/assets/2a59848a-8ebc-42e8-8f19-b94d5e9f4e10)

Jira ticket: https://elasticco.atlassian.net/browse/SEARCH-927

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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/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
- [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
- [ ] 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)
- [ ] ...

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-08 10:13:32 +02:00
Søren Louv-Jansen
624410524f
[Obs AI Assistant] Replace Task Manager usage with Lock Manager (#216916)
This PR replaces usage of the Kibana Task Manager with the [LockManager
utility](https://github.com/elastic/kibana/pull/216397) that ensures
strict mutual exclusion when running operations such as re-indexing or
data migrations.

---------

Co-authored-by: Viduni Wickramarachchi <viduni.ushanka@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 10:13:00 +02:00
Alex Prozorov
854bfc4964
[Cloud Security ] 12165 update UI handling of multiple CVEs and package fields (#216411)
## Summary

This PR updates the rendering of multi value fields - vulnerability.id,
package.name, package.version and package.fixed_version in the
vulnerabilities data-grid page and alerts insights vulnerabilities tab
data grid.
It also updates the rendering of package.* fields in the vulnerabilities
flyout and both flyout and data grids are re using the same kbn package
component to display it.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Make CVSS column to be displayed first in the data grid.
- [x] if there is a single CVE display its value across the data grid.
- [x] data-grid if there is more than a single CVE show it as
<first_cve> <+x more> badge indicating the number of CVES left. Clicking
on the badge should open a Popver where all CVEs are displayed as badges
- clicking on the value will add it to the search bar filters, each
batch should have a copy icon as well.
- [x] insights tab data-grid should have similar logic to display multi
value fields but without adding it to the filters logic since there are
no filters in that page.
- [x] logic of displaying multiple CVEs should be applied to
package.name, package.version and package.fixed_version fields in both
data grids.
- [x] arrays in package-related vulnerability fields are rendered
correctly in the flyout header and footer.
- [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/src/platform/packages/shared/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
- [ ] [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)

### Screen recording


https://github.com/user-attachments/assets/208f8445-83c1-4e8f-a490-85ec48830fae

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 10:22:57 +03:00
Carlos Crespo
9cc220ac52
[Synthtrace] APM Otel v2 (#217019)
## Summary
This PR enhances support for otel data in Synthtrace. It introduces the
ability to generate otel-sdk data and transforms APM Server data into
otel format.

Key Changes
- Added a pipeline for processing otel traces.

- Add a pipeline to convert APM server traces into exported otel traces

- Removed `OtelSynthtraceEsClient` in favor of `ApmSynthtraceEsClient`.

### Examples

Reproduces the otlp traces -> APM Server/tracesexporter -> output case
```ts
 // this needs to be set in the synthtrace scenario's `bootstrap` to run the correct pipeline
apmEsClient.pipeline(apmEsClient.getPipeline('otelToApm'));

// scenario
apm.otelService({
    name: 'sendotlp-otel-native-synth',
    sdkName: 'otlp',
    sdkLanguage: 'nodejs',
  })
  .instance('otel-native-instance')
   // this interface doesn't provide a `transaction` function
  .span({
    name: transactionName,
    kind: 'Server',
  })
  .timestamp(timestamp)
  .duration(1000)
  .success()
  .children(
    instance
      .dbExitSpan({
        name: 'GET /',
        type: 'elasticsearch',
      })
      .duration(1000)
      .success()
      .timestamp(timestamp)
  )
```

APM Server -> otel output. This can be useful for reusing existing
synthtrace scenarios.

```ts
 // this needs to be set in the synthtrace scenario's `bootstrap` to run the correct pipeline
 apmEsClient.pipeline(apmEsClient.getPipeline('apmToOtel'));

 // scenario
 apm.service({
    name: 'apmserver-otel-synth',
    environment: 'prod',
    agentName: 'opentelemetry/java',
  })
  .instance('otel-apmserver-instance')
  .transaction({ transactionName })
  .timestamp(timestamp)
  .defaults({
    'url.domain': 'foo.bar',
  })
  .duration(1000)
  .success()
  .children(
    otelApmServerInstace
      .span({
        spanName: 'GET apm-*/_search',
        spanType: 'db',
        spanSubtype: 'elasticsearch',
      })
      .duration(1000)
      .success()
      .destination('elasticsearch')
      .timestamp(timestamp)
  )
```

### How to test


otel -> APM Server/tracesexporter -> output
Run `node scripts/synthtrace otel_simple_trace.ts --live --uniqueIds
--clean`


<img width="800" alt="image"
src="https://github.com/user-attachments/assets/e237e506-1c0d-4851-9053-0f1e2fe554db"
/>

APM Server -> otel 

Run `node scripts/synthtrace simple_trace.ts --scenarioOpts
pipeline=apmToOtel --live --uniqueIds --clean`

<img width="800" alt="image"
src="https://github.com/user-attachments/assets/1bd577be-ded6-44ad-a54d-c5bb4e5ad59d"
/>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-08 09:16:19 +02:00
Patryk Kopyciński
17440896f9
[Security Assistant] Don't cache MLClient (#217408)
## Summary

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


### 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-04-08 01:25:45 +02:00
Alexi Doak
902bca98f1
[ResponseOps] ES|QL rules should generate a context.link that points to Discover (#216376)
Resolves https://github.com/elastic/kibana/issues/188856

## Summary

Currently ES query rule types link back to the alert details in the
`context.link` variable, except for the search source type. This PR
updates the rest of the ES query rule types to links to the relevant
docs in Discover.


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

### To verify
1. Set `server.publicBaseUrl` in kibana.yml
2. Create an ES|QL rule and include `context.link` in your action
message. Verify that when you go to the link it goes to Discover with
the correct query and timestamp
3. Create a DSL ES query rule and include `context.link` in your action
message. Verify that when you go to the link it goes to Discover and
works as expected
4. For your DSL rule also add some filters and verify that when you go
to Discover your filters are correctly applied.
2025-04-07 14:59:55 -07:00
Kibana Machine
9897f5dd60 skip failing test suite (#217399) 2025-04-07 23:09:03 +02:00
Ying Mao
3d54923123
[Response Ops][Reporting] Add health API to inform whether conditions are sufficient for scheduled reports (#216857)
Resolves https://github.com/elastic/kibana/issues/216319

## Summary

Adds an internal reporting health API to return whether conditions are
sufficient to support scheduled reports. For scheduled reporting, we
need for security and API keys to be enabled in Elasticsearch and for a
permanent encryption key to be set for the encrypted saved objects
plugin.

```
GET kbn:/internal/reporting/_health

Response 
{
  "has_permanent_encryption_key": true,
  "is_sufficiently_secure": true
}
```

The issue also mentions returning whether a preconfigured email service
is configured, but that will be done as part of the main scheduled
reporting task.

## To Verify

1. Run kibana and ES with no special flags, both flags should be `true`
2. Run ES with `-E xpack.security.enabled=false`.
`is_sufficiently_secure` should be set to `false`
3. Run ES With `-E xpack.security.authc.api_key.enabled=false`.
`is_sufficient_secure` should be set to `false`

Note that in dev mode, an encryption key is auto-set if not defined in
the Kibana yml so `has_permanent_encryption_key` will always return
`true` in dev mode.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-07 16:46:02 -04:00
Alejandro Fernández Haro
1bd3385d5d
[ES 9.0] Remove body workaround (@elastic/kibana-security) (#217222)
## Summary

Follow up to https://github.com/elastic/kibana/pull/213375: The latest
version of the ES client fixed the issue
https://github.com/elastic/elasticsearch-js/issues/2584.

We should be able to remove all usages of `// @ts-expect-error
elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`.


### 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-04-07 22:34:25 +02:00
Kibana Machine
9342cff262 skip failing test suite (#213821) 2025-04-07 21:30:10 +02:00
Tiago Costa
c02ec5eef5
skip flaky suite (#216815) 2025-04-07 20:14:23 +01:00
Tiago Costa
29ab72c961
skip flaky suite (#216735) 2025-04-07 20:13:16 +01:00
Tiago Costa
074b511fdc
skip flaky suite (#216219) 2025-04-07 20:11:20 +01:00
Kibana Machine
52b2708d79 skip failing test suite (#213990) 2025-04-07 21:08:12 +02:00
Kibana Machine
0a10dbfd20 skip failing test suite (#214191) 2025-04-07 21:07:44 +02:00