Closes#188641
## Summary
This PR adds new formulas for rx and tx metrics for hosts. In inventory
we show the old metrics as legacy and the new ones with the old metrics
labels (this affects only hosts):
<img width="1788" alt="image"
src="https://github.com/user-attachments/assets/d3e5bf26-e521-4ff8-b00b-1d78eebd56f9">
All old alerts should work - The only difference is that it will show
the metric as "Legacy" and it still can be used in the rules. The hosts
view and the lens charts are using a new formula
## Testing
- Check the network metrics in the inventory / alert flyout (both the
new ones and the old ones)
- Check the network metrics and charts in the hosts view (only the new
ones should be available)
https://github.com/user-attachments/assets/886fd5a0-858c-458b-9025-eb55913b1932https://github.com/user-attachments/assets/7752939f-f693-4021-bf23-89e264ef0c2d
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Update for puppeteer, the following changeset updates puppeteer to
version `22.13.1`.
The chromium version required for this version of puppeteer is
`126.0.6478.182` from revision `1300313`, as such the chromium binary
included for windows and darwin platforms either match or were the
closest revision to the expectation. The linux headless binary was built
from commit `5b5d8292ddf182f8b2096fa665b473b6317906d5` of the same
revision.
<!--
### Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
-->
### How to verify linux headless build
- clone the following repo
https://github.com/tsullivan/kibana-dev-docker
- pull this particular PR
- follow the steps outlined in the repo, replacing any occurrence of
`kibana-8.13.0-SNAPSHOT-linux-aarch64.tar.gz` from the repo above's step
with the output of running build on this changeset.
- before running step 4, modify the `kibana.yml` file from the
`kibana-dev-docker` repo and include the following so we might be able
to verify the version of chromium running;
```yaml
logging.loggers:
- name: plugins.reporting
level: debug
```
- complete the steps outlined in the README, you'll have a linux distro
of kibana running on port `5601`
- Attempt creating exports of PDF and PNG reports, in dashboard, canvas,
and visualizations, on report creation attempt we would see a log output
that prints out the chromium version exactly matching this;
<img width="1645" alt="Screenshot 2024-07-30 at 16 07 10"
src="https://github.com/user-attachments/assets/930a05fa-385b-4429-89e8-7b846043be59">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/187752
## Summary
Display a warning to users when a role mapping is created/updated to
include empty `any` or `all` rules
### Screenshots
<img width="1480" alt="image"
src="https://github.com/user-attachments/assets/6cb7e505-95d9-43c6-b8b7-a1f9114cdcda">
### Release notes
Display a warning to users whenever role mappings with empty `any` or
`all` rules are created or updated.
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Three major changes:
- Created my own streaming function
- If on cloud, fill up the response so that exceeds the network buffer
that cloud puts into place
- this buffer entry is ignored on the frontend
- use abortController instead of a variable. Subscribe to changes to the
network request to abort controller signal
- there was a random wait timeout for each chunk. This was introduced
with the error handling though im unsure why its needed. This causes a
big delay in the responses.
### Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Removing an unused feature flag called `alertTypeEnabled`. The feature
was added in 8.7 (https://github.com/elastic/kibana/pull/152872) but was
never enabled.
This PR removed unused components and renamed directory from
`alert_by_type_panel` to `alerts_by_rule_panel`.
### 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
Use `retryTransientEsErrors` when fetching agent status to avoid flaky
ES errors throwing a 500.
I'd love to add tests for this, but it's a bit challenging as these
methods rely heavily on an ES runtime field to populate the status
values. The amount of mocking necessary to add Jest tests for these was
getting a bit ridiculous, so maybe FTR is a better way to go?
## Summary
New feature flag added: `dataIngestionHubEnabled` and implemented in
`onboarding` page.
### Checklist
Delete any items that are not applicable to this PR.
- [ ] [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
This PR resolves https://github.com/elastic/search-team/issues/7993
Recently, a backend https://github.com/elastic/elasticsearch/pull/111366
was merged to elasticsearch which basically replaces 'model_id' with
'inference_id' in the GET inference api. This change was also backported
to v8.15. Due to this change, the frontend works related to
semantic_text UI and Inference Endpoints view are broken.
---------
Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Resolves https://github.com/elastic/kibana/issues/189566
## Summary
This PR removes tech preview from the ES query ES|QL rule form
### To verify
- Create an ES query ES|QL rule and verify that the tech preview badge
is removed from the ui.
## Summary
Resolves https://github.com/elastic/kibana/issues/186838
Prevents checking for Uptime data on plugin register when the user does
not have Uptime privileges
## Background Context
Uptime is hidden by default. However, there are two ways that the Uptime
app can become accessible.
1. Turning on the Uptime app in the advanced settings
2. If you have data in your Uptime indices within the past 7 days.
The data check present in Uptime plugin register is intended to enable
Uptime if there is Uptime data within the past 7 days. However, there's
no need to check this data if the user does not have privileges.
### Testing
1. Create a user without Uptime Kibana privileges
2. Open up the network tab in dev tools
3. Refresh any page in Kibana
4. You should not see a call to `internal/uptime/index_status`
The EBT pacakge has been moved to a separate NPM package
([@elastic/ebt](https://www.npmjs.com/package/@elastic/ebt))
The npm package is on version `0.0.x` until we finish the reviews then
i'll publish the `1.0.0` version before merging this PR.
The PR is mostly code deletes after moving the code to the public ebt
github repo https://github.com/elastic/ebt
The significant changes are:
1. removed the `packages/analytics/ebt` package from kibana
2. remove @kbn/ebt references in favor of the npm package.
3. Added a util package to provide the package with the telemetry
endpoint and headers
This was previously backed into the package but now i've rewired it be
provided from Kibana, this way we have more control over the URL and
headers we use to send EBT telemetry for our elastic endpoint, which
will probably be different between users of this package and this way
we'll also avoid republishing the package if we ever want to change
these details.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Partially fixes. #189072
## Summary
In this PR, we pass the `query:allowLeadingWildcards` for the optional
filter to the custom threshold (specifically
`getSearchConfigurationBoolQuery` function that generates the related ES
Query).
|Before|After|
|----|---|
||
#### Rule
<img
src="https://github.com/user-attachments/assets/70d2de37-2285-450f-88bf-45aa88954019"
width=500 />
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/187348
This changes adds an optional `history.settings.lookbackPeriod` property
that will default to `1h` if none is provided. The main point is to
prevent accidental processing of the entire dataset when creating a
definition.
I took the opportunity to do some refactoring:
- `durationSchema` was transforming a literal duration (eg `1h`) into a
`moment.Duration` with overriden `toJSON` property. since we don't use
any of the `moment` functionalities in consuming code the schema now
returns the raw string after regex validation
- split the `generateHistoryTransform` in `generateHistoryTransform` and
`generateBackfillHistoryTransform`
The ML team should be a code owner of the file upload plugin.
This [PR](https://github.com/elastic/kibana/pull/148130) removed them by
accident while removing duplicate entries.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
fixes: [#189484](https://github.com/elastic/kibana/issues/189484)
## Summary
Fix duplicate request during hosts view mounting cycle.
https://github.com/user-attachments/assets/dce73b2a-77e8-461a-bd9e-661fc40afe7ahttps://github.com/user-attachments/assets/0e8c41b4-1a36-470f-855d-c189221ad1f6
The problem happened because the `buildEsQuery` returns a complex
object, making the `useFetcher` to treat every payload, as a new one,
triggering duplicate requests.
### Extra
I have refactored the `use_unified_search` and
`use_unified_search_url_state`. It was misusing `useReducer` and there
was some magic happening with `rxJS`. I tried to make the code easier to
understand
### How to test
- Start a local Kibana and es instances
- run `node scripts/synthtrace infra_hosts_with_apm_hosts --live `
- Navigate to Infrastructure > Hosts
- Open the dev tools and check if there is more than one call to
`api/metrics/infra` endpoint
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Disables the `md5` hashing algorithm in cases files when Kibana is
running in FIPS mode.
## References
Closes#185600
### 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
**Resolves:** https://github.com/elastic/kibana/issues/189269
**Resolves:** https://github.com/elastic/kibana/issues/189270
## Summary
This PR adds an ability to specify OpenAPI `servers` and security requirements (`security`) to be used in the result bundle. `servers` and/or `security` in the source OpenAPI specs are be dropped when custom `servers` and/or `security` provided.
## Details
Kibana is usually deployed at a single access point and manages authentication in a central way. That way it's much more convenient to have control on what `servers` and `security` are present in the result bundles. It will help to avoid conflicts, duplicates and update them in centralized way.
This PR extends OpenAPI bundler configuration options with `prototypeDocument`. "Prototype" in the name means it's a prototype for the result. The bundler uses certain properties from that prototype OpenAPI document to add them to the result OpenAPI bundle. The following properties are used
- `info` representing OpenAPI Info object (former `options.specInfo`)
- `servers` OpenAPI Server Object Array
- `security` + `components.securitySchemes` OpenAPI Security Requirement Object Array + OpenAPI Security Schemes Object (validation checks that both fields are set otherwise an error is thrown)
For convenience `prototypeDocument` could be specified as a string path to a file containing prototype OpenAPI document.
## How to test?
`prototypeDocument` can be specified for `bundle` and `merge` utilities like the following
**bundle**
```js
const { bundle } = require('@kbn/openapi-bundler');
(async () => {
await bundle({
sourceGlob: 'source/glob/*.yaml',
outputFilePath: 'output/bundle.yaml,
options: {
prototypeDocument: {
info: {
title: 'Some title',
description: 'Some description',
},
servers: [{
url: 'https://{kibana_url}',
variables: {
kibana_url: {
default: 'localhost:5601',
}
}
}],
security: [{ ApiKeyAuth: [] }],
components: {
securitySchemes: {
ApiKeyAuth: {
type: 'apiKey',
in: 'header',
name: 'Authorization',
}
}
}
},
},
});
```
**bundle** with external prototype document
```js
const { bundle } = require('@kbn/openapi-bundler');
(async () => {
await bundle({
sourceGlob: 'source/glob/*.yaml',
outputFilePath: 'output/bundle.yaml,
options: {
prototypeDocument: 'path/to/prototype_document.yaml',,
},
});
```
**merge**
```js
const { merge } = require('@kbn/openapi-bundler');
(async () => {
await merge({
sourceGlobs: [
'absolute/path/to/file.yaml`,
'some/glob/*.schema.yaml',
],
outputFilePath: 'output/file/path/bundle.yaml',
options: {
prototypeDocument: {
info: {
title: 'Some title',
description: 'Some description',
},
servers: [{
url: 'https://{kibana_url}',
variables: {
kibana_url: {
default: 'localhost:5601',
}
}
}],
security: [{ ApiKeyAuth: [] }],
components: {
securitySchemes: {
ApiKeyAuth: {
type: 'apiKey',
in: 'header',
name: 'Authorization',
}
}
}
},
},
});
})();
```
**merge** with external prototype document
```js
const { merge } = require('@kbn/openapi-bundler');
(async () => {
await merge({
sourceGlobs: [
'absolute/path/to/file.yaml`,
'some/glob/*.schema.yaml',
],
outputFilePath: 'output/file/path/bundle.yaml',
options: {
prototypeDocument: 'path/to/prototype_document.yaml',
},
});
})();
```
The result bundles will contain specified `servers` and `security` while source `servers` and `security` will be dropped.
fixes#188133
## Summary
I simplified the failing test a bit to make it less likely to timeout.
1. We checked for the test **and** the `id` to make sure the component
was rendered, it was redundant.
2. We looked for all custom fields(4) and I reduced the check to just
2(which have different types).
3. Updated another test that looked for a label to look for an `id`(for
consistency).
fixes#187456
## Summary
Following @JiaweiWu 's classic advice I replaced `waitForNextUpdate`
with `waitFor` 😁
I looked for other places in cases that did the same and fixed them too.
fixes#178457fixes#187554
## Summary
I think this test was skipped by mistake.
The [failing
build](https://buildkite.com/elastic/kibana-on-merge/builds/42401#018e2f40-5109-4a2a-a877-f0aeed20f20f)
points to
`x-pack/plugins/cases/public/components/create/custom_fields.test.tsx`
but this file does not exist anymore.
[In the commit where the pipeline
failed](cd16d03ca9)
the file
`x-pack/plugins/cases/public/components/create/template.test.tsx` did
not exist.
The `renders correctly` test is **very** different between these two
files so I think there was some mistake here.
Additionally, there is [this skipped
test](https://github.com/elastic/kibana/issues/188133) which IMO is the
correct one. I fix that in a different PR.
PS: I kept looking into our flaky test list and I think the same is the
case for #187554 the file skipped there does not match the one in the
failing pipeline and it did not exist at the time of that commit. I
think there was some confusion and time difference between the failing
tests and the tests being skipped. When the tests were skipped the
original file did not exist anymore and prob all custom field related
`renders correctly` tests were skipped indiscriminately 🤷