Skip to content

Commit

Permalink
100
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv committed Oct 29, 2024
1 parent 9f84494 commit 09b4737
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,9 +438,10 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV2-SuccessRate-Alarm-ChainId: ${chainId.toString()}`
// We only want to alert if the volume besides 400 errors is high enough over default period (5m) for 5xx errors.
const invocationsThreshold = 50
const metric = new MathExpression({
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -482,9 +483,10 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV2-SuccessRate-Alarm-RequestSource: ${requestSource.toString()}`
// We only want to alert if the volume besides 400 errors is high enough over default period (5m) for 5xx errors.
const invocationsThreshold = 50
const metric = new MathExpression({
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -531,9 +533,10 @@ export class RoutingAPIStack extends cdk.Stack {
return
}
const alarmName = `RoutingAPI-SEV3-SuccessRate-Alarm-RequestSource-ChainId: ${requestSource.toString()} ${chainId}`
// We only want to alert if the volume besides 400 errors is high enough over default period (5m) for 5xx errors.
const invocationsThreshold = 50
const metric = new MathExpression({
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 0)`,
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down

0 comments on commit 09b4737

Please sign in to comment.