mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] Hide from UI some shipper options (#151341)
Closes https://github.com/elastic/kibana/issues/147613 Closes https://github.com/elastic/kibana/issues/147613 ## Summary Follow up of https://github.com/elastic/kibana/pull/145755 Introduce a feature flag (`showExperimentalShipperOptions`) to hide from the UI the shipper options that are still not ready to be shown to the user. The only available parameters for now should be the following, as per [comment](https://github.com/elastic/ingest-dev/issues/1512#issuecomment-1409233389): - Mem queue - Max batch size - Queue flush timeout ### Testing steps - Add a new output and in the yaml editor add one of the following and save it; ``` shipper: {} ``` or ``` shipper: enabled: true ``` - Edit the output, the shipper section should appear under "advanced options" <img width="742" alt="Screenshot 2023-02-15 at 16 30 01" src="https://user-images.githubusercontent.com/16084106/219096849-cf6041c5-654c-404d-b8de-7fdc13cec2f4.png"> - Generated full agent policy: <img width="762" alt="Screenshot 2023-02-16 at 15 05 20" src="https://user-images.githubusercontent.com/16084106/219386500-6b791c33-afee-4458-af5e-3ffb381baf8c.png"> There are more parameters visible, but they're set to `null` ### Checklist - [ ] [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 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
20fc667792
commit
b94c77780e
4 changed files with 177 additions and 161 deletions
|
@ -20,6 +20,7 @@ export const allowedExperimentalValues = Object.freeze({
|
|||
displayAgentMetrics: true,
|
||||
showIntegrationsSubcategories: false,
|
||||
agentFqdnMode: true,
|
||||
showExperimentalShipperOptions: false,
|
||||
});
|
||||
|
||||
type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
|
||||
|
|
|
@ -23,6 +23,8 @@ import {
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { ExperimentalFeaturesService } from '../../../../services';
|
||||
|
||||
import type { OutputFormInputsType } from './use_output_form';
|
||||
|
||||
export interface AdvancedOptionsSectionProps {
|
||||
|
@ -46,6 +48,7 @@ export const AdvancedOptionsSection: React.FunctionComponent<AdvancedOptionsSect
|
|||
queueFlushTimeout,
|
||||
maxBatchBytes,
|
||||
} = inputs;
|
||||
const { showExperimentalShipperOptions } = ExperimentalFeaturesService.get();
|
||||
|
||||
return enabled ? (
|
||||
<EuiAccordion
|
||||
|
@ -135,168 +138,172 @@ export const AdvancedOptionsSection: React.FunctionComponent<AdvancedOptionsSect
|
|||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiHorizontalRule />
|
||||
{showExperimentalShipperOptions && (
|
||||
<>
|
||||
<EuiHorizontalRule />
|
||||
|
||||
<EuiFormRow fullWidth {...diskQueueEnabledInput.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.diskQueueSwitch"
|
||||
{...diskQueueEnabledInput.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueSwitchLabel"
|
||||
defaultMessage="Disk Queue"
|
||||
<EuiFormRow fullWidth {...diskQueueEnabledInput.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.diskQueueSwitch"
|
||||
{...diskQueueEnabledInput.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueSwitchLabel"
|
||||
defaultMessage="Disk Queue"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueSwitchDescription"
|
||||
defaultMessage="Once enabled, events will be queued on disk if, for some reason, agent is not able to send them."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
<EuiSpacer size="m" />
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueSwitchDescription"
|
||||
defaultMessage="Once enabled, events will be queued on disk if, for some reason, agent is not able to send them."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
<EuiSpacer size="m" />
|
||||
|
||||
<EuiFormRow fullWidth {...diskQueueEncryptionEnabled.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.diskQueueEncryption"
|
||||
{...diskQueueEncryptionEnabled.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueEncryptionLabel"
|
||||
defaultMessage="Encryption"
|
||||
<EuiFormRow fullWidth {...diskQueueEncryptionEnabled.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.diskQueueEncryption"
|
||||
{...diskQueueEncryptionEnabled.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueEncryptionLabel"
|
||||
defaultMessage="Disk Queue Encryption"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueEncryptionDescription"
|
||||
defaultMessage="Enable encryption of data written to the disk queue."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
<EuiSpacer size="m" />
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueEncryptionDescription"
|
||||
defaultMessage="Enable encryption of data written to the disk queue."
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueuePathLabel"
|
||||
defaultMessage="Disk Queue Path"
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
<EuiSpacer size="m" />
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueuePathLabel"
|
||||
defaultMessage="Disk Queue Path"
|
||||
/>
|
||||
}
|
||||
{...diskQueuePathInput.formRowProps}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
data-test-subj="settingsOutputsFlyout.diskQueuePath"
|
||||
{...diskQueuePathInput.props}
|
||||
placeholder={i18n.translate(
|
||||
'xpack.fleet.settings.editOutputFlyout.diskQueuePathPlaceholder',
|
||||
{
|
||||
defaultMessage: 'path_data/diskqueue',
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
{...diskQueuePathInput.formRowProps}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
data-test-subj="settingsOutputsFlyout.diskQueuePath"
|
||||
{...diskQueuePathInput.props}
|
||||
placeholder={i18n.translate(
|
||||
'xpack.fleet.settings.editOutputFlyout.diskQueuePathPlaceholder',
|
||||
{
|
||||
defaultMessage: 'path_data/diskqueue',
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
{...diskQueueMaxSizeInput.formRowProps}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueMaxSize"
|
||||
defaultMessage="Maximum Disk Queue Size"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiFieldNumber {...diskQueueMaxSizeInput.props} placeholder="Bytes" min={0} />
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
{...diskQueueMaxSizeInput.formRowProps}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueMaxSizeDescription"
|
||||
defaultMessage="Limits the disk queue size for spooling of data. When data in the queue exceeds this limit, new events will be dropped."
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueMaxSize"
|
||||
defaultMessage="Maximum Disk Queue Size"
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
}
|
||||
>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiFieldNumber {...diskQueueMaxSizeInput.props} placeholder="Bytes" min={0} />
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.diskQueueMaxSizeDescription"
|
||||
defaultMessage="Limits the disk queue size for spooling of data. When data in the queue exceeds this limit, new events will be dropped."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiHorizontalRule />
|
||||
<EuiHorizontalRule />
|
||||
|
||||
<EuiFormRow fullWidth {...loadBalanceEnabledInput.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.loadBalancingSwitch"
|
||||
{...loadBalanceEnabledInput.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.loadBalancingSwitchLabel"
|
||||
defaultMessage="Load Balancing"
|
||||
<EuiFormRow fullWidth {...loadBalanceEnabledInput.formRowProps}>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.loadBalancingSwitch"
|
||||
{...loadBalanceEnabledInput.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.loadBalancingSwitchLabel"
|
||||
defaultMessage="Load Balancing"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.loadBalancingDescription"
|
||||
defaultMessage="Once enabled, the agents will balance the load across all the hosts defined for this output. This will increase the number of connections opened by the agent."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.loadBalancingDescription"
|
||||
defaultMessage="Once enabled, the agents will balance the load across all the hosts defined for this output. This will increase the number of connections opened by the agent."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiHorizontalRule />
|
||||
<EuiHorizontalRule />
|
||||
|
||||
<EuiFormRow fullWidth>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.compressionSwitch"
|
||||
{...diskQueueCompressionEnabled.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.compressionSwitchLabel"
|
||||
defaultMessage="Compression"
|
||||
<EuiFormRow fullWidth>
|
||||
<EuiFlexGroup alignItems="flexStart">
|
||||
<EuiFlexItem>
|
||||
<EuiSwitch
|
||||
data-test-subj="editOutputFlyout.compressionSwitch"
|
||||
{...diskQueueCompressionEnabled.props}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.compressionSwitchLabel"
|
||||
defaultMessage="Compression"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiSelect
|
||||
data-test-subj="editOutputFlyout.compressionLevelSelect"
|
||||
id="selectCompressionLevel"
|
||||
aria-label="Use aria labels when no actual label is in use"
|
||||
{...compressionLevelInput.props}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.compressionSwitchDescription"
|
||||
defaultMessage="Level 1 compression is the fastest, Level 9 however would provide the most compression."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiSelect
|
||||
data-test-subj="editOutputFlyout.compressionLevelSelect"
|
||||
id="selectCompressionLevel"
|
||||
aria-label="Use aria labels when no actual label is in use"
|
||||
{...compressionLevelInput.props}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiText size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.settings.editOutputFlyout.compressionSwitchDescription"
|
||||
defaultMessage="Level 1 compression is the fastest, Level 9 however would provide the most compression."
|
||||
/>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
</EuiAccordion>
|
||||
) : null;
|
||||
|
|
|
@ -23,6 +23,7 @@ import {
|
|||
} from '../../../../hooks';
|
||||
import type { Output, PostOutputRequest } from '../../../../types';
|
||||
import { useConfirmModal } from '../../hooks/use_confirm_modal';
|
||||
import { ExperimentalFeaturesService } from '../../../../services';
|
||||
|
||||
import {
|
||||
validateName,
|
||||
|
@ -65,6 +66,8 @@ export interface OutputFormInputsType {
|
|||
export function useOutputForm(onSucess: () => void, output?: Output) {
|
||||
const fleetStatus = useFleetStatus();
|
||||
|
||||
const { showExperimentalShipperOptions } = ExperimentalFeaturesService.get();
|
||||
|
||||
const hasEncryptedSavedObjectConfigured = !fleetStatus.missingOptionalFeatures?.includes(
|
||||
'encrypted_saved_object_encryption_key_required'
|
||||
);
|
||||
|
@ -159,7 +162,6 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
!diskQueueCompressionEnabled.value ?? false
|
||||
);
|
||||
|
||||
// These parameters are yet tbd - https://github.com/elastic/kibana/issues/147613
|
||||
const memQueueEvents = useNumberInput(output?.shipper?.mem_queue_events || undefined);
|
||||
const queueFlushTimeout = useNumberInput(output?.shipper?.queue_flush_timeout || undefined);
|
||||
const maxBatchBytes = useNumberInput(output?.shipper?.max_batch_bytes || undefined);
|
||||
|
@ -265,8 +267,20 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
setIsloading(true);
|
||||
|
||||
let shipperParams = {};
|
||||
|
||||
if (!isShipperDisabled) {
|
||||
shipperParams = {
|
||||
shipper: {
|
||||
mem_queue_events: memQueueEvents.value ? Number(memQueueEvents.value) : null,
|
||||
queue_flush_timeout: queueFlushTimeout.value ? Number(queueFlushTimeout.value) : null,
|
||||
max_batch_bytes: maxBatchBytes.value ? Number(maxBatchBytes.value) : null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (!isShipperDisabled && showExperimentalShipperOptions) {
|
||||
shipperParams = {
|
||||
...shipperParams,
|
||||
shipper: {
|
||||
disk_queue_enabled: diskQueueEnabledInput.value,
|
||||
disk_queue_path:
|
||||
|
@ -284,9 +298,6 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
? Number(compressionLevelInput.value)
|
||||
: null,
|
||||
loadbalance: loadBalanceEnabledInput.value,
|
||||
mem_queue_events: memQueueEvents.value ? Number(memQueueEvents.value) : null,
|
||||
queue_flush_timeout: queueFlushTimeout.value ? Number(queueFlushTimeout.value) : null,
|
||||
max_batch_bytes: maxBatchBytes.value ? Number(maxBatchBytes.value) : null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -353,8 +364,10 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
}
|
||||
}, [
|
||||
validate,
|
||||
isLogstash,
|
||||
isShipperDisabled,
|
||||
showExperimentalShipperOptions,
|
||||
proxyIdInput.value,
|
||||
isLogstash,
|
||||
nameInput.value,
|
||||
typeInput.value,
|
||||
logstashHostsInput.value,
|
||||
|
@ -366,10 +379,11 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
sslCertificateAuthoritiesInput.value,
|
||||
elasticsearchUrlInput.value,
|
||||
caTrustedFingerprintInput.value,
|
||||
proxyIdInput.value,
|
||||
notifications.toasts,
|
||||
onSucess,
|
||||
output,
|
||||
onSucess,
|
||||
memQueueEvents.value,
|
||||
queueFlushTimeout.value,
|
||||
maxBatchBytes.value,
|
||||
diskQueueEnabledInput.value,
|
||||
diskQueuePathInput.value,
|
||||
diskQueueMaxSizeInput.value,
|
||||
|
@ -377,10 +391,8 @@ export function useOutputForm(onSucess: () => void, output?: Output) {
|
|||
diskQueueCompressionEnabled.value,
|
||||
compressionLevelInput.value,
|
||||
loadBalanceEnabledInput.value,
|
||||
memQueueEvents.value,
|
||||
queueFlushTimeout.value,
|
||||
maxBatchBytes.value,
|
||||
confirm,
|
||||
notifications.toasts,
|
||||
]);
|
||||
|
||||
return {
|
||||
|
|
|
@ -221,10 +221,6 @@ export function transformOutputToFullPolicyOutput(
|
|||
if (!isShipperDisabled) {
|
||||
shipperDiskQueueData = buildShipperQueueData(shipper);
|
||||
}
|
||||
/*
|
||||
TODO: Once the Elastic-Shipper is ready,
|
||||
Verify that these parameters have the correct names and structure
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const {
|
||||
loadbalance,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue