closes https://github.com/elastic/kibana/issues/165825
## Summary
This ticket fixes the problem with the KPI subtitles that were not
correctly showing the host limit information
c2bb6109-82f6-4e2a-8a00-4ddd3f33fba5
Replacing the `useLazyRef` with `useMemo` in the `use_lens_attributes`
to fix this problem, caused many problems with charts re-rendering, now
that the attribute builder is no longer a singleton.
Charts are heavy components and rendering them unnecessarily degrades
performance considerably. So, besides fixing the main issue, I had to
fix in this PR the other problems that surfaced after the change.
I also renamed a few things.
### How to test this PR
- Start a local Kibana instance
- Run slingshot with ~200 hosts for a couple of days
- Navigate to `Infrastructure` > `Hosts` and change the host limit to
confirm that the KPI subtitle will reflect the selection
- Check if the clicks on the tabs and checkboxes are responding quickly.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
PR enables the existing data loading utilities/services, used in e2e
testing and CLI tools, to support being run against a serverless Env..
Changes include:
- `createRuntimeServices()` and the associated methods that create the
ES and KBN clients, will now by default add a CA cert to the ES and KBN
clients if the URL protocol is `https`
- an option was also added to the mothods that allows a developer to
turn this behaviour off if necessary (`noCertForSsl`)
- `createRuntimeServices()` option `asSuperuser` will NOT attempt to
create a new user in ES if it detects its running against serverless. It
will instead set the `username` to `system_indices_superuser`
- `resolver_generator.js` script was updated so that it can be run
against a serverless env. (note: tested only in local dev, not agains
cloud environments)
- new utility to determine if Kibana is running in serverless mode
(`isServerlessKibanaFlavor()`)
- Cypress tests that don't require specific user/role were updated to
use `system_indices_superuser` as the default username (instead of
`elastic`)
## Summary
A part of Quick Wins day
fixes
- https://github.com/elastic/kibana/issues/160286
The fix is to load more CSP integrations and pick the one that matches
the posture type of the current empty state
## Summary
Closes https://github.com/elastic/kibana/issues/165999
This PR adds to the config `disableStatefulSettings`. The error
originates in the
`x-pack/plugins/reporting/server/lib/deprecations/check_ilm_migration_status.ts`
that is then called by the reporting api client
``` jsx
...
this.disableStatefulSettings ? null : this.http.put(INTERNAL_ROUTES.MIGRATE.MIGRATE_ILM_POLICY);
```
I thought an appropriate fix would be adding this setting to the config
vs a topical fix in the check_ilm_migration_status to include any other
stateful settings that are not permitted in the serverless offering.
The store is also inhibiting the csv generation from working. Testing csv downloads works now in Discover.
### 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
## 📓 Summary
Closes#165486
This work restructured the entry point for the 2 different header menus
(stateful, serverless) and added both of them the Add data button to
navigate to the onboarding page.
**Stateful**
<img width="1780" alt="Screenshot 2023-09-12 at 16 01 16"
src="535a9a5c-603e-4c35-976a-70421c5e36d8">
**Serverless**
<img width="1783" alt="Screenshot 2023-09-12 at 15 49 09"
src="aaa57f41-c4d8-4da1-a808-8b55954df716">
---------
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
It fixes https://github.com/elastic/kibana/issues/165619
## Notes:
- The issue wasn't related to the `/_alertSummary` endpoint and wouldn't
be fixed after merging the new update from ResponsOps PR. (tested here
with a clone PR https://github.com/elastic/kibana/pull/166273)
- The failing test is so little flaky only **0.5%** , after each update
I run the flaky-test-runner to run 400 times.
- The issue seems related to three things that has been done:
- Waiting for the rule details page to load
- Use LogThreshold instead of the Uptime rule
- The mocking lib seems to miss the mock sometimes with Uptime and makes
the real function be called without a `featureIds`
## DoD
- The PR has been tested 2 x 400 = 800 times with 0 fails ->
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3100
Closes https://github.com/elastic/kibana/issues/164905
This PR replaces individual shard failure and timeout warnings with a
single "incomplete data" warning. This work is required for
https://github.com/elastic/kibana/issues/163381
<img width="500" alt="Screen Shot 2023-09-06 at 9 35 52 AM"
src="77e62792-c1f1-4780-b4f2-3aca24e4691b">
<img width="500" alt="Screen Shot 2023-09-06 at 9 36 00 AM"
src="56f37db1-2b4a-484b-9244-66b352d82dc1">
<img width="500" alt="Screen Shot 2023-09-06 at 9 36 07 AM"
src="4a777963-6e88-4736-9d63-99a2843ebdbb">
### Test instructions
* Install flights and web logs sample data
* Create data view kibana_sample_data*. **Set time field to timestamp**
* open discover and select kibana_sample_data* data view
* Add filter with custom DSL
```
{
"error_query": {
"indices": [
{
"error_type": "exception",
"message": "local shard failure message 123",
"name": "kibana_sample_data_logs",
"shard_ids": [
0
]
}
]
}
}
```
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
## Summary
Security issue: https://github.com/elastic/security-team/issues/7509
Updates the icons in the `Machine Learning` and `Project settings`
landing pages according to the designs
### Screenshots


https://github.com/elastic/kibana/issues/165976
Proper onChange function for headers and topics fields that now
correctly triggers `hasChanged` property resulting in activating `Save`
button as soon as any change is made.
935aee94-d4c3-424e-9481-32103eeb5b04
## Summary
Seeing a bunch of errors like this in serverless logs:
```
Executing Rule default:.es-query:23dedce0-5230-11ee-b332-73fb351d06b8 has resulted in Error: Cannot read properties of undefined (reading 'meta') - TypeError: Cannot read properties of undefined (reading 'meta')\n at /usr/share/kibana/node_modules/@kbn/actions-plugin/server/authorization/get_authorization_mode_by_source.js:45:56\n at Array.reduce (<anonymous>)\n at getBulkAuthorizationModeBySource (/usr/share/kibana/node_modules/@kbn/actions-plugin/server/authorization/get_authorization_mode_by_source.js:43:47)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at ActionsClient.bulkEnqueueExecution (/usr/share/kibana/node_modules/@kbn/actions-plugin/server/actions_client/actions_client.js:588:24)\n at ExecutionHandler.run (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/execution_handler.js:249:28)\n at /usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/task_runner.js:413:37\n at TaskRunnerTimer.runWithTimer (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/task_runner_timer.js:50:20)\n at TaskRunner.runRule (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/task_runner.js:406:5)\n at TaskRunner.run (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/task_runner.js:629:49)\n at TaskManagerRunner.run (/usr/share/kibana/node_modules/@kbn/task-manager-plugin/server/task_running/task_runner.js:315:170)
```
which seem to be caused by connectivity issues between Kibana and ES. In
this case, when a rule executes and tries to schedule an action, we use
the saved objects client `bulkGet` function to determine if the rule is
a legacy (pre 7.10) version. We were not checking for errors returned
from the `bulkGet` (which returns as a 200 with errors embedded in the
success response) and so were trying to access data from the SO that did
not exist. This PR checks for errors returned from the `bulkGet` and
logs the error accordingly. Also did some small optimizations to the
code
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Resolves https://github.com/elastic/kibana/issues/165965
## Summary
Exposes `hasOnlyDefaultSpace` from spaces contract.
If anyone has a better suggestion for the name I'd be happy to change
it.
---------
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
## Summary
Summarize your PR. If it involves visual changes include a screenshot or
gif.
[Quick Wins](https://github.com/elastic/security-team/issues/7436)
Applied offset Bottom height so JSON Tab content inside this absolute
`div` element is scrollable and doesn't get cut off by the sticky bar:
## Summary
Closes https://github.com/elastic/kibana/issues/161876
Creates a plugin providing utilities to access metrics data. The plugin
only exposes a server API which includes a client with two methods:
- `getMetricIndices` to retrieve the user-defined indices where metrics
are located
- `updateMetricIndices` to update the indices
The client is now used where we previously relied on infra plugin to
provide the configuration, in APM and Infra.
The plugin persists the configuration in a new saved object
`metrics-data-source`. Because this configuration was previously stored
in the `infrastructure-ui-source`, the plugin relies on a fallback to
reuse any existing value (see additional context
https://github.com/elastic/kibana/issues/161876#issuecomment-1673537400).
### Reviewers
There are no functional changes outside of Infra Monitoring UI and APM
UI, other codeowners are involved because this introduces a new saved
object
- APM - the change introduces a drop-in replacement of the
`infra.getMetricIndices` call. The ui code still relies on infra plugin
for a couple of components so we can't drop the dependency yet, those
we'll need to be moved to a tier 2 plugin (more details in
https://github.com/elastic/observability-dev/discussions/2787
(internal)) in a separate issue
### Testing
You'll need metrics data to verify data fetching works (I've used an
edge-oblt cluster)
1. Navigate to Infrastructure Settings and verify metric indices are
configured with the default value of `infrastructure-ui-source`
2. Update metric indices settings (if connected to oblt cluster add
`remote_cluster:..` indices)
3. Verify `metrics-data-source` saved object is persisted with correct
attributes
4. Verify Infrastructure Inventory is pulling data from the newly
configured indices
5. Go to APM services, verify service Infrastructure pulls data from
newly configured indices
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
**Problem:** In https://github.com/elastic/docs/pull/2752, we updated the URL prefix (`welcome-to-elastic`) and name for the "Welcome to Elastic Docs" docs. However, we still have some stray links that use the old `/welcome-to-elastic` URL prefix
**Solution:** Update an outdated link.
# Backport
Adds the following commits to `main`:
- [[DOCS] Adds the release notes for 8.10.0
(#165077)](https://github.com/elastic/kibana/pull/165077)
- [[8.10] [DOCS] Fix 8.10 RNs
(#166316)](https://github.com/elastic/kibana/pull/166316)
<!--- Backport version: 8.9.7 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT
[{"author":{"name":"amyjtechwriter","email":"61687663+amyjtechwriter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-09-01T10:06:12Z","message":"[DOCS]
Adds the release notes for 8.10.0 (#165077)\n\nAdds the release notes
for 8.10.0.\r\n\r\n---------\r\n\r\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"162a95938bea9f9b848f16213d1dd9425df96f12","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v8.10.0","v8.11.0"],"number":165077,"url":"https://github.com/elastic/kibana/pull/165077","mergeCommit":{"message":"[DOCS]
Adds the release notes for 8.10.0 (#165077)\n\nAdds the release notes
for 8.10.0.\r\n\r\n---------\r\n\r\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"162a95938bea9f9b848f16213d1dd9425df96f12"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/166304","number":166304,"state":"MERGED","mergeCommit":{"sha":"f9dd35d868cf641caf53cc52f9dfa23b2e645fa0","message":"[8.10]
[DOCS] Adds the release notes for 8.10.0 (#165077) (#166304)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.10`:\n- [[DOCS] Adds the release notes for
8.10.0\n(#165077)](https://github.com/elastic/kibana/pull/165077)\n\nCo-authored-by:
amyjtechwriter
<61687663+amyjtechwriter@users.noreply.github.com>"}},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165077","number":165077,"mergeCommit":{"message":"[DOCS]
Adds the release notes for 8.10.0 (#165077)\n\nAdds the release notes
for 8.10.0.\r\n\r\n---------\r\n\r\nCo-authored-by: lcawl
<lcawley@elastic.co>","sha":"162a95938bea9f9b848f16213d1dd9425df96f12"}}]}]
BACKPORT-->
---------
Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
## Summary
Enables the Alerts menu in Discover nav for the ES|QL mode and defaults
to ESQL alerts by carrying the query that the user has typed.
<img width="1621" alt="image"
src="5ffef9d1-179a-464a-8941-b6bf18b4f30f">
### 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
## Summary
This PR adds a progress bar when the suggestion chart changes due to
changes in the query. For time consuming queries this might take some
time and the old suggestion will be visible until the data being
fetched.

### 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
Resolves https://github.com/elastic/kibana/issues/161465
This is a re-do of https://github.com/elastic/kibana/pull/163414, which
we had to revert since data streams do not support `ignore_malformed` on
the `@timestamp` field. We now specifically add `ignore_malformed:
false` for that field, and then use `ignore_malformed: true` at the
index level.
This ignores malformed content globally across all allowed mapping
types. For existing alerts as data indices, the new setting is not
applied directly to the existing concrete indices but will be applied
whenever the alias rolls over and a new concrete index is created.