Skip to content

Commit

Permalink
[data.search] Disable bfetch by default (#192789)
Browse files Browse the repository at this point in the history
## Summary

Part of #186139.

Disables `bfetch` by default.

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

---------

Co-authored-by: Peter Pisljar <[email protected]>
  • Loading branch information
lukasolson and ppisljar authored Oct 10, 2024
1 parent bc75d03 commit ed75ef6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 105 deletions.
2 changes: 1 addition & 1 deletion src/plugins/bfetch/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
name: i18n.translate('bfetch.disableBfetch', {
defaultMessage: 'Disable request batching',
}),
value: false,
value: true,
description: i18n.translate('bfetch.disableBfetchDesc', {
defaultMessage:
'Disables requests batching. This increases number of HTTP requests from Kibana, but allows to debug requests individually.',
Expand Down
165 changes: 61 additions & 104 deletions x-pack/test/functional_execution_context/tests/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
type: 'application',
name: 'discover',
url: '/app/discover',
child: {
name: 'discover',
url: '/app/discover',
type: 'application',
page: 'app',
id: 'new',
description: 'fetch documents',
},
page: 'app',
id: 'new',
description: 'fetch documents',
}),
});
});
Expand All @@ -105,20 +100,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
type: 'application',
name: 'discover',
url: '/app/discover',
page: 'app',
id: 'new',
description: 'fetch chart data and total hits',
child: {
name: 'discover',
url: '/app/discover',
type: 'application',
page: 'app',
id: 'new',
description: 'fetch chart data and total hits',
child: {
type: 'lens',
name: 'lnsXY',
id: 'unifiedHistogramLensComponent',
description: 'Edit visualization',
url: '/app/lens#/edit_by_value',
},
type: 'lens',
name: 'lnsXY',
id: 'unifiedHistogramLensComponent',
description: 'Edit visualization',
url: '/app/lens#/edit_by_value',
},
}),
});
Expand Down Expand Up @@ -185,33 +175,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('propagates to Elasticsearch via "x-opaque-id" header', async () => {
await logContains({
description: 'execution context propagates to Elasticsearch via "x-opaque-id" header',
predicate: checkHttpRequestId(
'dashboard:dashboards:7adfa750-4c81-11e8-b3d7-01146121b73d;lens:lnsXY:086ac2e9-dd16-4b45-92b8-1e43ff7e3f65'
),
predicate: checkHttpRequestId('lens:lnsXY:086ac2e9-dd16-4b45-92b8-1e43ff7e3f65'),
});
});

it('propagates to Kibana logs', async () => {
await logContains({
description: 'execution context propagates to Kibana logs',
predicate: checkExecutionContextEntry({
type: 'application',
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
name: 'dashboards',
url: '/app/dashboards',
type: 'dashboard',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'lens',
name: 'lnsXY',
id: '086ac2e9-dd16-4b45-92b8-1e43ff7e3f65',
description: '[Flights] Flight count',
url: '/app/lens#/edit_by_value',
},
type: 'lens',
name: 'lnsXY',
id: '086ac2e9-dd16-4b45-92b8-1e43ff7e3f65',
description: '[Flights] Flight count',
url: '/app/lens#/edit_by_value',
},
}),
});
Expand All @@ -222,33 +205,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('propagates to Elasticsearch via "x-opaque-id" header', async () => {
await logContains({
description: 'execution context propagates to Elasticsearch via "x-opaque-id" header',
predicate: checkHttpRequestId(
'dashboard:dashboards:7adfa750-4c81-11e8-b3d7-01146121b73d;lens:lnsMetric:b766e3b8-4544-46ed-99e6-9ecc4847e2a2'
),
predicate: checkHttpRequestId('lens:lnsMetric:b766e3b8-4544-46ed-99e6-9ecc4847e2a2'),
});
});

it('propagates to Kibana logs', async () => {
await logContains({
description: 'execution context propagates to Kibana logs',
predicate: checkExecutionContextEntry({
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
type: 'application',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
name: 'dashboards',
url: '/app/dashboards',
type: 'dashboard',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'lens',
name: 'lnsMetric',
id: 'b766e3b8-4544-46ed-99e6-9ecc4847e2a2',
description: '',
url: '/app/lens#/edit_by_value',
},
type: 'lens',
name: 'lnsMetric',
id: 'b766e3b8-4544-46ed-99e6-9ecc4847e2a2',
description: '',
url: '/app/lens#/edit_by_value',
},
}),
});
Expand All @@ -260,7 +236,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await logContains({
description: 'execution context propagates to Elasticsearch via "x-opaque-id" header',
predicate: checkHttpRequestId(
'dashboard:dashboards:7adfa750-4c81-11e8-b3d7-01146121b73d;lens:lnsDatatable:fb86b32f-fb7a-45cf-9511-f366fef51bbd'
'lens:lnsDatatable:fb86b32f-fb7a-45cf-9511-f366fef51bbd'
),
});
});
Expand All @@ -269,23 +245,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await logContains({
description: 'execution context propagates to Kibana logs',
predicate: checkExecutionContextEntry({
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
type: 'application',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
name: 'dashboards',
url: '/app/dashboards',
type: 'dashboard',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'lens',
name: 'lnsDatatable',
id: 'fb86b32f-fb7a-45cf-9511-f366fef51bbd',
description: 'Cities by delay, cancellation',
url: '/app/lens#/edit_by_value',
},
type: 'lens',
name: 'lnsDatatable',
id: 'fb86b32f-fb7a-45cf-9511-f366fef51bbd',
description: 'Cities by delay, cancellation',
url: '/app/lens#/edit_by_value',
},
}),
});
Expand All @@ -296,33 +267,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('propagates to Elasticsearch via "x-opaque-id" header', async () => {
await logContains({
description: 'execution context propagates to Elasticsearch via "x-opaque-id" header',
predicate: checkHttpRequestId(
'dashboard:dashboards:7adfa750-4c81-11e8-b3d7-01146121b73d;lens:lnsPie:5d53db36-2d5a-4adc-af7b-cec4c1a294e0'
),
predicate: checkHttpRequestId('lens:lnsPie:5d53db36-2d5a-4adc-af7b-cec4c1a294e0'),
});
});

it('propagates to Kibana logs', async () => {
await logContains({
description: 'execution context propagates to Kibana logs',
predicate: checkExecutionContextEntry({
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
type: 'application',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
name: 'dashboards',
url: '/app/dashboards',
type: 'dashboard',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'lens',
name: 'lnsPie',
id: '5d53db36-2d5a-4adc-af7b-cec4c1a294e0',
description: '[Flights] Delay Type',
url: '/app/lens#/edit_by_value',
},
type: 'lens',
name: 'lnsPie',
id: '5d53db36-2d5a-4adc-af7b-cec4c1a294e0',
description: '[Flights] Delay Type',
url: '/app/lens#/edit_by_value',
},
}),
});
Expand All @@ -334,33 +298,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('propagates to Elasticsearch via "x-opaque-id" header', async () => {
await logContains({
description: 'execution context propagates to Elasticsearch via "x-opaque-id" header',
predicate: checkHttpRequestId(
'dashboard:dashboards:7adfa750-4c81-11e8-b3d7-01146121b73d;search:discover:571aaf70-4c88-11e8-b3d7-01146121b73d'
),
predicate: checkHttpRequestId('search:discover:571aaf70-4c88-11e8-b3d7-01146121b73d'),
});
});

it('propagates to Kibana logs', async () => {
await logContains({
description: 'execution context propagates to Kibana logs',
predicate: checkExecutionContextEntry({
type: 'application',
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'dashboard',
name: 'dashboards',
url: '/app/dashboards',
page: 'app',
id: '7adfa750-4c81-11e8-b3d7-01146121b73d',
description: '[Flights] Global Flight Dashboard',
child: {
type: 'search',
name: 'discover',
id: '571aaf70-4c88-11e8-b3d7-01146121b73d',
description: '[Flights] Flight Log',
url: '/app/discover#/view/571aaf70-4c88-11e8-b3d7-01146121b73d',
},
type: 'search',
name: 'discover',
id: '571aaf70-4c88-11e8-b3d7-01146121b73d',
description: '[Flights] Flight Log',
url: '/app/discover#/view/571aaf70-4c88-11e8-b3d7-01146121b73d',
},
}),
});
Expand Down

0 comments on commit ed75ef6

Please sign in to comment.