-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uptime] [Synthetics Integration] add new advanced options #112454
Merged
dominiqueclarke
merged 19 commits into
elastic:master
from
dominiqueclarke:feature/109732-synthetics-integration-new-advanced-options
Oct 12, 2021
Merged
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a9557d8
refactor common fields
dominiqueclarke 1ed6bcb
add ignore_https_errors and journey filters options
dominiqueclarke 6990707
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine c5bae16
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine 8be094f
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine 3bbae82
Merge branch 'master' of github.com:elastic/kibana into feature/10973…
dominiqueclarke cc1b3c4
adjust formatters and normalizers
dominiqueclarke 4172924
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine a6063e9
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine 73bda4e
adjust content and hide fields when zip url is not defined
dominiqueclarke 07254e1
Merge branch 'feature/109732-synthetics-integration-new-advanced-opti…
dominiqueclarke a9c660d
adjust content again
dominiqueclarke e258540
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine 2bc472f
update tests
dominiqueclarke 44f2f94
Merge branch 'feature/109732-synthetics-integration-new-advanced-opti…
dominiqueclarke 3b437ba
Merge branch 'master' into feature/109732-synthetics-integration-new-…
kibanamachine 234a3b4
adjust tests
dominiqueclarke 8359b80
Merge branch 'feature/109732-synthetics-integration-new-advanced-opti…
dominiqueclarke ab9ee88
adjust tests
dominiqueclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,6 +10,8 @@ import { FormattedMessage } from '@kbn/i18n/react'; | |||||
import { | ||||||
EuiAccordion, | ||||||
EuiSelect, | ||||||
EuiFieldText, | ||||||
EuiCheckbox, | ||||||
EuiFormRow, | ||||||
EuiDescribedFormGroup, | ||||||
EuiSpacer, | ||||||
|
@@ -39,6 +41,73 @@ export const BrowserAdvancedFields = () => { | |||||
data-test-subj="syntheticsBrowserAdvancedFieldsAccordion" | ||||||
> | ||||||
<EuiSpacer size="m" /> | ||||||
<EuiDescribedFormGroup | ||||||
title={ | ||||||
<h4> | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.filtering.title" | ||||||
defaultMessage="Synthetics agent filtering" | ||||||
/> | ||||||
</h4> | ||||||
} | ||||||
description={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.filtering.description" | ||||||
defaultMessage="Filter tests using match or tags options." | ||||||
/> | ||||||
} | ||||||
> | ||||||
<EuiSpacer size="s" /> | ||||||
<EuiFormRow | ||||||
label={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersMatch.label" | ||||||
defaultMessage="Filter match" | ||||||
/> | ||||||
} | ||||||
labelAppend={<OptionalLabel />} | ||||||
helpText={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersMatch.helpText" | ||||||
defaultMessage="Run only journeys with a name or tags that matches the provided glob." | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Think this is cleaner copy. |
||||||
/> | ||||||
} | ||||||
> | ||||||
<EuiFieldText | ||||||
value={fields[ConfigKeys.JOURNEY_FILTERS_MATCH]} | ||||||
onChange={(event) => | ||||||
handleInputChange({ | ||||||
value: event.target.value, | ||||||
configKey: ConfigKeys.JOURNEY_FILTERS_MATCH, | ||||||
}) | ||||||
} | ||||||
data-test-subj="syntheticsBrowserJourneyFiltersMatch" | ||||||
/> | ||||||
</EuiFormRow> | ||||||
<EuiFormRow | ||||||
label={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersTags.label" | ||||||
defaultMessage="Filter tags" | ||||||
/> | ||||||
} | ||||||
labelAppend={<OptionalLabel />} | ||||||
helpText={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersTags.helpText" | ||||||
defaultMessage="Run only journeys with the given tag(s), or globs." | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Think we can skip this since globs is plural. |
||||||
/> | ||||||
} | ||||||
> | ||||||
<ComboBox | ||||||
selectedOptions={fields[ConfigKeys.JOURNEY_FILTERS_TAGS]} | ||||||
onChange={(value) => | ||||||
handleInputChange({ value, configKey: ConfigKeys.JOURNEY_FILTERS_TAGS }) | ||||||
} | ||||||
data-test-subj="syntheticsBrowserJourneyFiltersTags" | ||||||
/> | ||||||
</EuiFormRow> | ||||||
</EuiDescribedFormGroup> | ||||||
<EuiDescribedFormGroup | ||||||
title={ | ||||||
<h4> | ||||||
|
@@ -56,6 +125,34 @@ export const BrowserAdvancedFields = () => { | |||||
} | ||||||
> | ||||||
<EuiSpacer size="s" /> | ||||||
<EuiFormRow | ||||||
helpText={ | ||||||
<> | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.ignoreHttpsErrors.helpText" | ||||||
defaultMessage="Set this option to true to disable TLS/SSL validation in the synthetics browser. This is useful for testing sites that use self-signed certs." | ||||||
/> | ||||||
</> | ||||||
} | ||||||
data-test-subj="syntheticsBrowserIgnoreHttpsErrors" | ||||||
> | ||||||
<EuiCheckbox | ||||||
id="syntheticsBrowserIgnoreHttpsErrorsCheckbox" | ||||||
checked={fields[ConfigKeys.IGNORE_HTTPS_ERRORS]} | ||||||
label={ | ||||||
<FormattedMessage | ||||||
id="xpack.uptime.createPackagePolicy.stepConfigure.browserAdvancedSettings.ignoreHttpsErrors.label" | ||||||
defaultMessage="Ignore HTTPS errors" | ||||||
/> | ||||||
} | ||||||
onChange={(event) => | ||||||
handleInputChange({ | ||||||
value: event.target.checked, | ||||||
configKey: ConfigKeys.IGNORE_HTTPS_ERRORS, | ||||||
}) | ||||||
} | ||||||
/> | ||||||
</EuiFormRow> | ||||||
<EuiFormRow | ||||||
label={ | ||||||
<FormattedMessage | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
x-pack/plugins/uptime/public/components/fleet_package/common/common_fields.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiFormRow, EuiFieldText, EuiFieldNumber } from '@elastic/eui'; | ||
import { ConfigKeys, Validation, ICommonFields } from '../types'; | ||
import { ComboBox } from '../combo_box'; | ||
import { OptionalLabel } from '../optional_label'; | ||
|
||
interface Props { | ||
validate: Validation; | ||
fields: ICommonFields; | ||
onChange: ({ value, configKey }: { value: string | string[]; configKey: ConfigKeys }) => void; | ||
} | ||
|
||
export function CommonFields({ fields, onChange, validate }: Props) { | ||
return ( | ||
<> | ||
<EuiFormRow | ||
label={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.APMServiceName.label" | ||
defaultMessage="APM service name" | ||
/> | ||
} | ||
labelAppend={<OptionalLabel />} | ||
helpText={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.APMServiceName.helpText" | ||
defaultMessage="APM service name for this monitor. Corresponds to the service.name ECS field. Set this when monitoring an app that is also using APM to enable integrations between Uptime and APM data in Kibana." | ||
/> | ||
} | ||
> | ||
<EuiFieldText | ||
value={fields[ConfigKeys.APM_SERVICE_NAME]} | ||
onChange={(event) => | ||
onChange({ | ||
value: event.target.value, | ||
configKey: ConfigKeys.APM_SERVICE_NAME, | ||
}) | ||
} | ||
data-test-subj="syntheticsAPMServiceName" | ||
/> | ||
</EuiFormRow> | ||
<EuiFormRow | ||
label={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.timeout.label" | ||
defaultMessage="Timeout in seconds" | ||
/> | ||
} | ||
isInvalid={!!validate[ConfigKeys.TIMEOUT]?.(fields)} | ||
error={ | ||
parseInt(fields[ConfigKeys.TIMEOUT], 10) < 0 ? ( | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.timeout.moreThanZeroError" | ||
defaultMessage="Timeout must be greater than or equal to 0" | ||
/> | ||
) : ( | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.timeout.lessThanIntervalError" | ||
defaultMessage="Timeout must be less than the monitor interval" | ||
/> | ||
) | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.timeout.helpText" | ||
defaultMessage="The total time allowed for testing the connection and exchanging data." | ||
/> | ||
} | ||
> | ||
<EuiFieldNumber | ||
min={0} | ||
value={fields[ConfigKeys.TIMEOUT]} | ||
onChange={(event) => | ||
onChange({ | ||
value: event.target.value, | ||
configKey: ConfigKeys.TIMEOUT, | ||
}) | ||
} | ||
step={'any'} | ||
/> | ||
</EuiFormRow> | ||
<EuiFormRow | ||
label={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.tags.label" | ||
defaultMessage="Tags" | ||
/> | ||
} | ||
labelAppend={<OptionalLabel />} | ||
helpText={ | ||
<FormattedMessage | ||
id="xpack.uptime.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.tags.helpText" | ||
defaultMessage="A list of tags that will be sent with the monitor event. Press enter to add a new tag. Displayed in Uptime and enables searching by tag." | ||
/> | ||
} | ||
> | ||
<ComboBox | ||
selectedOptions={fields[ConfigKeys.TAGS]} | ||
onChange={(value) => onChange({ value, configKey: ConfigKeys.TAGS })} | ||
data-test-subj="syntheticsTags" | ||
/> | ||
</EuiFormRow> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should clarify somewhere that this is for when you're running a suite of tests vs using the recorder of inline. I was a bit confused. I also think perhaps we should look at a different word than filter. Something about "Selective Tests" "Use this option to apply these monitor settings to a subset of the tests in your suite". (or something along those lines)
As I understand this, you're not really filtering per-se, you more choosing a subset to apply an action to (in this case, the monitor frequency, name etc that you set above) WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewpost That makes sense. I can hide these settings when inline or recorder is selected.
I think the statement about "not really filtering" is generally correct, though it will filter in the sense that only that subset will be run. Maybe add an additional sentence: "Only the configured subset will be run by this monitor."