Skip to content

Commit

Permalink
fix(alarm): exclude very low volume chains from 4xx alarm (no route)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv committed Aug 10, 2024
1 parent 35d347f commit c5f3f6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/stacks/routing-api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,10 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV3-4XXAlarm-ChainId: ${chainId.toString()}`
// We only want to alert if the volume is high enough over default period (5m) for 4xx errors (no route).
const invocationsThreshold = 500;
const metric = new MathExpression({
expression: '100*(response400/invocations)',
expression: `IF(invocations > ${invocationsThreshold}, 100*(response400/invocations), 0)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down

0 comments on commit c5f3f6e

Please sign in to comment.