## Summary
Currently, the FTR tests are written to expect only two preconfigured
endpoints. However, there might be more incoming, and this PR
generalizes these tests so they do not depend on the number of
preconfigured endpoints in the future.
### 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/packages/kbn-i18n/README.md)
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Part of https://github.com/elastic/kibana/issues/203250
All embeddables have been converted to new embeddable system. Now its
time to clean-up the legacy embeddable system. Part of that clean up
involves removing usage of `reactEmbeddableRegistryHasKey`.
This PR removes `reactEmbeddableRegistryHasKey` from
observability_solution plugins
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
As discussed here:
https://github.com/elastic/kibana/pull/202372#discussion_r1875857095
There is a bug redirecting the user away from any management tab but
`route`. This was happening because while loading the definition it
would behave as if the stream is unmanaged. This fixes this problem.
This change is related to removing the permission check for capabilities
catalogue in enterprise search.
This PR resolves this
[issue](https://github.com/elastic/search-team/issues/8521).
### Description
Currently, this
[line](01de887060/x-pack/plugins/enterprise_search/server/plugin.ts (L234))
is registering kibana capabilities for app search and workplace search.
Enterprise search has it's own RBAC and this registration is an
extension of kibana's RBAC. Once we get rid of enterprisesearch nodes,
we do not need this any more.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
The FIPS pipeline runs all tests as a privileged superuser, some tests
that check privileges fail and should be skipped for this pipeline
The FIPS pipeline runs all test with a trial license, some tests that
verify premium functionality vs basic should be skipped for this
pipeline
## FIPS Pipeline run for this branch
https://buildkite.com/elastic/kibana-fips/builds/304
## Summary
Resolves: https://github.com/elastic/kibana/issues/202666
## For reviewers
To see the change, run this:
`node scripts/get_owners_for_file.js --file
test/functional/apps/console/_autocomplete.ts`
### Results:
#### Before
```
succ elastic/kibana-management
```
#### After
```
succ Found matching entry in .github/CODEOWNERS:
test/functional/apps/console/*.ts elastic/kibana-management
```
---------
Co-authored-by: Robert Oskamp <traeluki@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: David Olaru <dolaru@elastic.co>
Closes https://github.com/elastic/kibana/issues/190379
## Summary
This PR switches the example grid layout app to render embeddables as
panels rather than the simplified mock panel we were using previously.
In doing so, I had to add the ability for custom panels to add a custom
drag handle via the `renderPanelContents` callback - this required
adding a `setDragHandles` callback to the `ReactEmbeddableRenderer` that
could be passed down to the `PresentationPanel` component.
https://github.com/user-attachments/assets/9e2c68f9-34af-4360-a978-9113701a5ea2
#### New scroll behaviour
In https://github.com/elastic/kibana/pull/201867, I introduced a small
"ease" to the auto-scroll effect that happens when you drag a panel to
the top or bottom of the window. However, in that PR, I was using the
`smooth` scrolling behaviour, which unfortunately became **very**
jittery once I switched to embeddables rather than simple panels
(specifically in Chrome - it worked fine in Firefox).
The only way to prevent this jittery scroll was to switch to the default
scroll behaviour, but this lead to a very **abrupt** stop when the
scrollbar reached the top and/or bottom of the page - so, to give the
same "gentle" stop that the `smooth` scroll had, I decided to recreate
this effect by adding a slow down "ease" when close to the top or bottom
of the page:
https://github.com/user-attachments/assets/cb7bf03f-4a9e-4446-be4f-8f54c0bc88ac
This effect is accomplished via the parabola formula `y = a(x-h)2 + k`
and can be roughly visualized with the following, which shows that the
"speed up" ease happens at a much slower pace than the "slow down" ease:

#### Notes about parent changes
As I investigated improving the efficiency of the grid layout with
embeddables, one of the main things I noticed was that the grid panel
was **always** remounted when moving a panel from one collapsible
section to another. This lead me (and @ThomThomson) down a rabbit hole
of React-reparenting, and we explored a few different options to see if
we could change the parent of a component **without** having it remount.
In summary, after various experiments and a whole bunch of research, we
determined that, due to the reconciliation of the React tree, this is
unfortunately impossible. So our priorities will instead have to move to
making the remount of `ReactEmbeddableRenderer` **as efficient as
possible** via caching, since the remount is inevitable.
### 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)
### Identify risks
There are no risks to this PR, since the most significant work is
contained in the `examples` plugin. Some changes were made to the
presentation panel to allow for custom drag handles, but this isn't
actually used in Dashboard - so for now, this code is only called in the
example plugin, as well.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Moved Search Applications & Behavioral Analytics from the base
KibanaFeature to their own so that they can be controlled independently
from other parts of the search solution.
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
All usages of "success" colors have been updated to "accentSecondary"
and "textAccentSecondary" as needed.
Recommend to review with white-space changes skipped:
https://github.com/elastic/kibana/pull/202430/files?w=1
### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for breaking 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.
### Identify risks
- Risk of some visual glitches because of oversights
### Summary
A recent [bug](https://github.com/elastic/kibana/issues/199902) that
affected some of the pages in Stack Monitoring was caused by changes
related to the locators of the logs-related apps.
The goal of this PR is to reduce the number of Observability
dependencies that could potentially cause issues in the app by removing
the `observability` and `observabilityShared` plugin dependencies from
the `monitoring` plugin.
Currently, the `monitoring` plugin is [categorised as
observability](https://github.com/elastic/kibana/blob/main/x-pack/plugins/monitoring/kibana.jsonc#L7)
but when the dependency on the `infra` plugin is removed, it can be
marked as a `platform` plugin.
### Notes for reviewers
- The components used to render the header menu as well as the
[use_track_metric](https://github.com/elastic/kibana/pull/203492/files#diff-7e39fc60ca80ee551d824ca97f9f879e3364a368a5736cf9178b5943a12ca7a7)
hook were copied from the `observabilityShared` plugin
- There should be no UX and functionality changes in the stack
monitoring header
- Usage collection could be verified by searching for UI counters sent
by the cluster created for this PR, once telemetry has been sent
### Testing
The stateful environment deployed by this PR includes logs and metrics
for stack monitoring. Please make sure to select a larger time range
(e.g. last 14 days).
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Enables a logs only overview for hosts & containers. Disables the
metrics tab as there's no data incoming for metrics, and provides Logs
charts on the overview page detailing the Log Rate (all logs generated)
and Log Error Rate (all recorded errors).
https://github.com/user-attachments/assets/ced14b6d-dd08-4514-9066-6c02c62d5ff8Closes#201752
## How to test
This is tested using synthtrace data, loading the scenario below:
```
node scripts/synthtrace traces_logs_entities.ts --live
```
This loads a logs-only host, though if other scenarios contain logs only
containers, feel free to use those as well.
* Go to Inventory page. Click on a host or container.
* If it is a logs only host/container, no metrics tab should be shown.
Metrics KPI charts should be replaced with Logs KPI charts (Log Rate and
Log Error Rate).
* If the host/container contains metrics, the metrics tab should be
visible and the normal Metrics KPI charts should be present.
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Ensure "App Search" is the name for the app search nav link in classic
mode over "Engines" which is the label for the navLink (deepLink)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This change is related to this
[issue](https://github.com/elastic/search-team/issues/7961). This PR
replaces 'enterprise_search' with 'elasticsearch' in all urls for
Elasticsearch->Build. In the PR, we replaced the following URLs.
| Old URL | New URL |
| :------------------------------------- |
:------------------------------------- |
| app/enterprise_search/applications/search_applications |
app/elasticsearch/applications/search_applications |
| app/enterprise_search/analytics | app/elasticsearch/analytics |
https://github.com/user-attachments/assets/e7b6ba66-e47b-4d99-8edc-37a9d30edc69
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR resolves this
https://github.com/elastic/search-team/issues/7961. In this PR, we
changed the following Urls by replacing 'enterprise_search' with
'elasticsearch'.
| Old URL | New URL |
| :------------------------------------- |
:------------------------------------- |
| app/enterprise_search/elasticsearch | app/elasticsearch/elasticsearch
|
| app/enterprise_search/vector_search | app/elasticsearch/vector_search
|
| app/enterprise_search/semantic_search |
app/elasticsearch/semantic_search |
| app/enterprise_search/ai_search | app/elasticsearch/ai_search |
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Fix a11y focus order in index mappings page. When new field is in
pending state and after closing edit pending field Flyout.
https://github.com/user-attachments/assets/dbdf59e5-0ebd-47e0-9b5e-19ab1556e771
### Test instructions
#### Adding a field
1. Add new field in index mappings page by navigating via tab
2. Notice that type fields combo box is focused
3. Add field and click to Add field button again with in pending fields
form
4. Notice focus is on new create field form
#### Edit field in pending state
1. Add new fields via tab key
2. click on edit field
3. Try closing, updating and cancelling in the edit field flyout form
4. Notice after edit field flyout is closed, focus is on the pending
fields form
## Summary
When using the new Custom Lens embeddable component, the titles are
hidden by default due to to a regression introduced in
https://github.com/elastic/kibana/pull/186642.
This PR should fix the correct title handling of the header visibility
by hiding or showing the wrapping Panel title depending on the
`hidePanelTitles` props of the `LensRenderer` component
fix https://github.com/elastic/kibana/issues/203354
Closes https://github.com/elastic/kibana/issues/197281
PR replaces `DashboardContainer`, which implements legacy Container and
Embeddable interfaces, with plain old javascript object implementation
returned from `getDashboardApi`.
The following are out of scope for this PR and will be accomplished at a
later time:
1) re-factoring dashboard folder structure
2) removing all uses of Embeddable and EmbeddableInput types
3) removing legacy types like DashboardContainerInput
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
### Authz API migration for authorized routes
This PR migrates `access:<privilege>` tags used in route definitions to
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:**
Access control tags were defined in the `options` object of the route:
```ts
router.get({
path: '/api/path',
options: {
tags: ['access:<privilege_1>', 'access:<privilege_2>'],
},
...
}, handler);
```
### **After migration:**
Tags have been replaced with the more robust
`security.authz.requiredPrivileges` field under `security`:
```ts
router.get({
path: '/api/path',
security: {
authz: {
requiredPrivileges: ['<privilege_1>', '<privilege_2>'],
},
},
...
}, handler);
```
### What to do next?
1. Review the changes in this PR.
2. You might need to update your tests to reflect the new security
configuration:
- If you have tests that rely on checking `access` tags.
- If you have snapshot tests that include the route definition.
- If you have FTR tests that rely on checking unauthorized error
message. The error message changed to also include missing privileges.
## 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: Andrew Macri <andrew.macri@elastic.co>
Resolves: https://github.com/elastic/response-ops-team/issues/249
This PR increases task claiming interval in case of
`cluster_block_exception` to avoid generating too many error during TM
index reindexing.
## To verify:
- Run your local Kibana,
- Create a user with `kibana_system` and `kibana_admin` roles
- Logout and login with your new user
- Use below request to put a write block on TM index.
`PUT /.kibana_task_manager_9.0.0_001/_block/write`
- Observe the error messages and their occurring interval on your
terminal.
- Use below request on the Kibana console to halt write block.
```
PUT /.kibana_task_manager_9.0.0_001/_settings
{
"index": {
"blocks.write": false
}
}
```
## Fix refresh issue for serverless
If use only have `write` and `read` privileges `refresh=true` don't
work, because it require at least `maintenance`
For creation it's easy to change to `wait_for` and it will work.
For delete endpoint I implement the same technique as is used in
deleting lists.
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
Closes https://github.com/elastic/kibana/issues/190795
Adds the logic to display a message to the user in case there is already
an existing Firehose data in their cluster and to show the identified
AWS services in the "Visualize Data" step right away without waiting for
the window to loose focus first.

## How to test
1. Open the Firehose flow
2. Make sure there is no callout and the third step is not active
3. Go to Kibana dev console and ingest some dummy data (see examples
bellow)
4. Refresh the page with the Firehose flow
5. make sure there is a callout and the third steps shows the identified
AWS service
```
POST logs-aws.apigateway_logs-default/_doc
{
"@timestamp": "2024-11-25T13:32:01.000Z",
"some": 111,
"aws.kinesis.name": "Elastic-CloudwatchLogs"
}
POST metrics-aws.apigateway_metrics-default/_doc
{
"@timestamp": "2024-11-25T13:31:01.000Z",
"agent": {
"type": "firehose"
},
"aws": {
"cloudwatch": {
"namespace": "AWS/ApiGateway"
},
"exporter": {
"arn": "arn:aws:cloudwatch:us-west-2:975050175126:metric-stream/Elastic-CloudwatchLogsAndMetricsToFirehose-CloudWatchMetricStream-Nhb4NhzPdL4J"
}
},
"cloud": {
"account": {
"id": "975050175126"
},
"provider": "aws",
"region": "us-west-2"
}
}
```
## Summary
This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.
> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
> * customised eslint rules
> * docs pointing to source code
> [!NOTE]
> This PR has been auto-generated.
> Do not attempt to push any changes unless you know what you are doing.
> Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.
#### 1 plugin(s) are going to be relocated:
| Id | Target folder |
| -- | ------------- |
| `@kbn/translations-plugin` |
`x-pack/platform/plugins/private/translations` |
<details>
<summary>Updated references</summary>
```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-synthetic-package-map/synthetic-packages.json
./packages/kbn-ts-projects/config-paths.json
./src/dev/i18n_tools/README.md
./tsconfig.base.json
./tsconfig.refs.json
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>
```
x-pack/platform/plugins/private/translations/tsconfig.json:2
```
</details>
<details>
<summary>Script errors</summary>
```
```
</details>
## Summary
Closes https://github.com/elastic/ingest-dev/issues/4325
Added modal window with column selector table when agents are exported.
There are some differences compared to the design due to technical
limitations:
- `Filters applied` badge not included, it's not really possible to
accurately calculate the count of filters, since they are stored in a
single string. We could potentially count by splitting AND/OR
conditions, but it may not be accurate. Do we still want to include it?
- We don't have display names for these mappings coming from the agent
index, and currently I don't have a way to show display names on the
exported file. For this reason showing the original field names on the
modal too.
- Added a Description column that transforms the field name to a more
readable name, we can also hardcode the descriptions if this is not good
enough.
- After some consideration, I decided to hardcode the allowed field list
to export other than querying dynamically from the agent index mappings,
otherwise new sensitive field mappings would show up on the UI.
- Caveat: searching on columns in the modal removes the already selected
columns that do not match. This seems to be a default behaviour of the
EuiTable, I find it a little strange, didn't see a straightforward way
to change it. I can spend more time on it if needed.
To verify:
- Select a few agents, click on Export CSV action
- Verify that the modal window opens with the agent mappings visible, by
default the columns on the UI selected
- Select a few columns to export
- Submit the modal
- Wait for the report to be ready and download it
- Verify that the exported csv includes the columns selected
<img width="1301" alt="image"
src="https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e">
Figma design:

<img width="2138" alt="image"
src="https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4">
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [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
With https://github.com/elastic/elasticsearch/issues/117544 fixed,
`subobjects: false` can be set on wired streams.
This allows to map fields as scalars even if they share the same prefix,
e.g.
* `deeply.nested.path` as `keyword`
* `deeply.nested.path.and.more` as `keyword`