Skip to content

Commit

Permalink
[APM]Latency threshold rule's threshold context variable should use m…
Browse files Browse the repository at this point in the history
…illiseconds instead of microseconds (#150234)

closes #125323

I couldn't test it yet, since alerts are firing with any context
variable. I'll hold on to merge this until I can fully test it.

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
cauemarcondes and kibanamachine authored Feb 8, 2023
1 parent f935d06 commit 5f43b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('registerTransactionDurationRuleType', () => {
'Avg. latency is 5,500 ms in the last 5 mins for opbeans-java. Alert when > 3,000 ms.',
transactionType: 'request',
serviceName: 'opbeans-java',
threshold: 3000000,
threshold: 3000,
triggerValue: '5,500 ms',
viewInAppUrl:
'http://localhost:5601/eyr/app/apm/services/opbeans-java?transactionType=request&environment=ENVIRONMENT_ALL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function registerTransactionDurationRuleType({
[TRANSACTION_TYPE]: transactionType,
[PROCESSOR_EVENT]: ProcessorEvent.transaction,
[ALERT_EVALUATION_VALUE]: transactionDuration,
[ALERT_EVALUATION_THRESHOLD]: thresholdMicroseconds,
[ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold,
[ALERT_REASON]: reason,
...sourceFields,
},
Expand All @@ -292,7 +292,7 @@ export function registerTransactionDurationRuleType({
interval: `${ruleParams.windowSize}${ruleParams.windowUnit}`,
reason,
serviceName,
threshold: thresholdMicroseconds,
threshold: ruleParams.threshold,
transactionType,
triggerValue: transactionDurationFormatted,
viewInAppUrl,
Expand Down

0 comments on commit 5f43b49

Please sign in to comment.