Skip to content

Commit

Permalink
Fix error removing Environment value in APM rules (#156212)
Browse files Browse the repository at this point in the history
Fixes #153085

Fixes the error shown when removing selected Environment value in the
following APM rules:
- Latency threshold
- Error count threshold
- Failed transaction rate threshold
  • Loading branch information
benakansara authored May 1, 2023
1 parent 7a7936e commit 61dad95
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ export function ErrorCountRuleType(props: Props) {
/>,
<EnvironmentField
currentValue={params.environment}
onChange={(value) => setRuleParams('environment', value)}
onChange={(value) =>
setRuleParams(
'environment',
value !== '' ? value : ENVIRONMENT_ALL.value
)
}
serviceName={params.serviceName}
/>,
<ErrorGroupingKeyField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ export function TransactionDurationRuleType(props: Props) {
/>,
<EnvironmentField
currentValue={params.environment}
onChange={(value) => setRuleParams('environment', value)}
onChange={(value) =>
setRuleParams(
'environment',
value !== '' ? value : ENVIRONMENT_ALL.value
)
}
serviceName={params.serviceName}
/>,
<TransactionNameField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ export function TransactionErrorRateRuleType(props: Props) {
/>,
<EnvironmentField
currentValue={params.environment}
onChange={(value) => setRuleParams('environment', value)}
onChange={(value) =>
setRuleParams(
'environment',
value !== '' ? value : ENVIRONMENT_ALL.value
)
}
serviceName={params.serviceName}
/>,
<TransactionNameField
Expand Down

0 comments on commit 61dad95

Please sign in to comment.