Skip to content

Commit

Permalink
fix(alerts): adjust noisy very low volume traffic alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv committed Oct 29, 2024
1 parent 1f99389 commit 9f84494
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/stacks/routing-api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV2-SuccessRate-Alarm-ChainId: ${chainId.toString()}`
const invocationsThreshold = 50
const metric = new MathExpression({
expression: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -481,8 +482,9 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV2-SuccessRate-Alarm-RequestSource: ${requestSource.toString()}`
const invocationsThreshold = 50
const metric = new MathExpression({
expression: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -529,8 +531,9 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV3-SuccessRate-Alarm-RequestSource-ChainId: ${requestSource.toString()} ${chainId}`
const invocationsThreshold = 50
const metric = new MathExpression({
expression: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down

0 comments on commit 9f84494

Please sign in to comment.