From 0e441d7c87603a9860deb9fc198406210315bb7c Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Fri, 21 Feb 2025 08:50:40 -0800 Subject: [PATCH 1/2] fix(dashboard): attempt to fix testnets widgets with errors --- bin/stacks/routing-dashboard-stack.ts | 29 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/bin/stacks/routing-dashboard-stack.ts b/bin/stacks/routing-dashboard-stack.ts index 9b9871f33a..521b957ae2 100644 --- a/bin/stacks/routing-dashboard-stack.ts +++ b/bin/stacks/routing-dashboard-stack.ts @@ -106,11 +106,18 @@ export class RoutingDashboardStack extends cdk.NestedStack { type: 'metric', properties: { metrics: chains.map((chainId) => [ - NAMESPACE, - `GET_QUOTE_REQUESTED_CHAINID: ${chainId}`, - 'Service', - 'RoutingAPI', - { id: `mreqc${chainId}`, label: `Requests on ${ID_TO_NETWORK_NAME(chainId)}` }, + { + expression: `FILL(mreqc${chainId}, 0)`, + label: `Requests on ${ID_TO_NETWORK_NAME(chainId)}`, + id: `e1c${chainId}`, + }, + [ + NAMESPACE, + `GET_QUOTE_REQUESTED_CHAINID: ${chainId}`, + 'Service', + 'RoutingAPI', + { id: `mreqc${chainId}`, visible: false }, + ], ]), view: 'timeSeries', stacked: false, @@ -399,7 +406,8 @@ export class RoutingDashboardStack extends cdk.NestedStack { metrics: _.flatMap(chains, (chainId) => [ [ { - expression: `(m200c${chainId} / (mreqc${chainId} - m400c${chainId})) * 100`, + expression: `IF(FILL(mreqc${chainId}, 0) == 0, 0, + (m200c${chainId} / (mreqc${chainId} - m400c${chainId})) * 100)`, label: `Success Rate on ${ID_TO_NETWORK_NAME(chainId)}`, id: `e1c${chainId}`, }, @@ -449,7 +457,8 @@ export class RoutingDashboardStack extends cdk.NestedStack { metrics: _.flatMap(chains, (chainId) => [ [ { - expression: `(m200c${chainId} / mreqc${chainId}) * 100`, + expression: `IF(FILL(mreqc${chainId}, 0) == 0, 0, + (m200c${chainId} / mreqc${chainId}) * 100)`, label: `Success Rate (w. 4XX) on ${ID_TO_NETWORK_NAME(chainId)}`, id: `e1c${chainId}`, }, @@ -492,7 +501,8 @@ export class RoutingDashboardStack extends cdk.NestedStack { metrics: _.flatMap(chains, (chainId) => [ [ { - expression: `(m500c${chainId} / mreqc${chainId}) * 100`, + expression: `IF(FILL(mreqc${chainId}, 0) == 0, 0, + (m500c${chainId} / mreqc${chainId}) * 100)`, label: `5XX Error Rate on ${ID_TO_NETWORK_NAME(chainId)}`, id: `e1c${chainId}`, }, @@ -535,7 +545,8 @@ export class RoutingDashboardStack extends cdk.NestedStack { metrics: _.flatMap(chains, (chainId) => [ [ { - expression: `(m400c${chainId} / mreqc${chainId}) * 100`, + expression: `IF(FILL(mreqc${chainId}, 0) == 0, 0, + (m400c${chainId} / mreqc${chainId}) * 100)`, label: `4XX Error Rate on ${ID_TO_NETWORK_NAME(chainId)}`, id: `e2c${chainId}`, }, From bbb0b63c1d6e37f8e7b97df73569d9e4351caddf Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Fri, 21 Feb 2025 11:34:20 -0800 Subject: [PATCH 2/2] fix build error --- bin/stacks/routing-dashboard-stack.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/stacks/routing-dashboard-stack.ts b/bin/stacks/routing-dashboard-stack.ts index 521b957ae2..ad44770c4c 100644 --- a/bin/stacks/routing-dashboard-stack.ts +++ b/bin/stacks/routing-dashboard-stack.ts @@ -105,12 +105,14 @@ export class RoutingDashboardStack extends cdk.NestedStack { width: 24, type: 'metric', properties: { - metrics: chains.map((chainId) => [ - { - expression: `FILL(mreqc${chainId}, 0)`, - label: `Requests on ${ID_TO_NETWORK_NAME(chainId)}`, - id: `e1c${chainId}`, - }, + metrics: _.flatMap(chains, (chainId) => [ + [ + { + expression: `FILL(mreqc${chainId}, 0)`, + label: `Requests on ${ID_TO_NETWORK_NAME(chainId)}`, + id: `e1c${chainId}`, + }, + ], [ NAMESPACE, `GET_QUOTE_REQUESTED_CHAINID: ${chainId}`,