diff --git a/src/providers/on-chain-quote-provider.ts b/src/providers/on-chain-quote-provider.ts index cc22ac8dc..90bd7d28d 100644 --- a/src/providers/on-chain-quote-provider.ts +++ b/src/providers/on-chain-quote-provider.ts @@ -1223,6 +1223,60 @@ export class OnChainQuoteProvider implements IOnChainQuoteProvider { } attempt loops. Total calls made to provider: ${totalCallsMade}. Have retried for timeout: ${haveRetriedForTimeout}` ); + // Log total routes + metric.putMetric( + `${this.metricsPrefix( + this.chainId, + useMixedRouteQuoter, + mixedRouteContainsV4Pool, + protocol, + optimisticCachedRoutes + )}RoutesLength`, + routesQuotes.length, + MetricLoggerUnit.Count + ); + + // Log total quotes + metric.putMetric( + `${this.metricsPrefix( + this.chainId, + useMixedRouteQuoter, + mixedRouteContainsV4Pool, + protocol, + optimisticCachedRoutes + )}RoutesQuotesLength`, + routesQuotes + .map((routeWithQuotes) => routeWithQuotes[1].length) + .reduce((a, b) => a + b, 0), + MetricLoggerUnit.Count + ); + + // log successful quotes + metric.putMetric( + `${this.metricsPrefix( + this.chainId, + useMixedRouteQuoter, + mixedRouteContainsV4Pool, + protocol, + optimisticCachedRoutes + )}RoutesSuccessfulQuotesLength`, + successfulQuotes.length, + MetricLoggerUnit.Count + ); + + // log failed quotes + metric.putMetric( + `${this.metricsPrefix( + this.chainId, + useMixedRouteQuoter, + mixedRouteContainsV4Pool, + protocol, + optimisticCachedRoutes + )}RoutesFailedQuotesLength`, + failedQuotes.length, + MetricLoggerUnit.Count + ); + return { routesWithQuotes: routesQuotes, blockNumber,