Skip to content

Commit

Permalink
Merge branch 'main' into xrsv/unirpc-polygon-arbitrum-100-pct
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv authored Oct 31, 2024
2 parents 365e7db + c8b8fdc commit 40791b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
12 changes: 9 additions & 3 deletions bin/stacks/routing-api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +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: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -481,8 +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: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down Expand Up @@ -529,8 +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: '100*(response200/(invocations-response400))',
expression: `IF((invocations - response400) > ${invocationsThreshold}, 100*(response200/(invocations-response400)), 100)`,
usingMetrics: {
invocations: new aws_cloudwatch.Metric({
namespace: 'Uniswap',
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@uniswap/router-sdk": "^1.14.0",
"@uniswap/sdk-core": "^5.9.0",
"@types/semver": "^7.5.8",
"@uniswap/smart-order-router": "4.7.5",
"@uniswap/smart-order-router": "4.7.6",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^4.6.1",
"@uniswap/v2-sdk": "^4.6.1",
Expand Down

0 comments on commit 40791b0

Please sign in to comment.