From 9195b7ce6a8d8212a8d0755c10d5d3b9381c6671 Mon Sep 17 00:00:00 2001 From: koekiebox Date: Wed, 20 Nov 2024 15:59:37 +0100 Subject: [PATCH] feat(2981): middleware stats. --- .../ilp/connector/core/middleware/balance.ts | 4 ++-- .../ilp/connector/core/middleware/error-handler.ts | 4 ++-- .../ilp/connector/core/middleware/stream-address.ts | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/payment-method/ilp/connector/core/middleware/balance.ts b/packages/backend/src/payment-method/ilp/connector/core/middleware/balance.ts index 190542fe40..49bf730e14 100644 --- a/packages/backend/src/payment-method/ilp/connector/core/middleware/balance.ts +++ b/packages/backend/src/payment-method/ilp/connector/core/middleware/balance.ts @@ -21,8 +21,8 @@ export function createBalanceMiddleware(): ILPMiddleware { }: ILPContext, next: () => Promise ): Promise => { - const stopTimer = services.telemetry.startTimer('balanceMiddleware', { - callName: 'balanceMiddleware' + const stopTimer = services.telemetry.startTimer('balance_middleware_next', { + callName: 'balanceMiddleware:next' }) const { amount } = request.prepare const logger = services.logger.child( diff --git a/packages/backend/src/payment-method/ilp/connector/core/middleware/error-handler.ts b/packages/backend/src/payment-method/ilp/connector/core/middleware/error-handler.ts index c8a9e1ae95..c3b030716c 100644 --- a/packages/backend/src/payment-method/ilp/connector/core/middleware/error-handler.ts +++ b/packages/backend/src/payment-method/ilp/connector/core/middleware/error-handler.ts @@ -12,9 +12,9 @@ export function createIncomingErrorHandlerMiddleware( ): ILPMiddleware { return async (ctx: ILPContext, next: () => Promise): Promise => { const stopTimer = ctx.services.telemetry.startTimer( - 'createIncomingErrorHandlerMiddleware', + 'create_incoming_error_handler_middleware_next', { - callName: 'createIncomingErrorHandlerMiddleware' + callName: 'createIncomingErrorHandlerMiddleware:next' } ) try { diff --git a/packages/backend/src/payment-method/ilp/connector/core/middleware/stream-address.ts b/packages/backend/src/payment-method/ilp/connector/core/middleware/stream-address.ts index 132429ec74..17b7ba5869 100644 --- a/packages/backend/src/payment-method/ilp/connector/core/middleware/stream-address.ts +++ b/packages/backend/src/payment-method/ilp/connector/core/middleware/stream-address.ts @@ -5,9 +5,12 @@ export function createStreamAddressMiddleware(): ILPMiddleware { { request, services: { streamServer, telemetry }, state }: ILPContext, next: () => Promise ): Promise => { - const stopTimer = telemetry.startTimer('createStreamAddressMiddleware', { - callName: 'createStreamAddressMiddleware' - }) + const stopTimer = telemetry.startTimer( + 'create_stream_address_middleware_decode_tag', + { + callName: 'createStreamAddressMiddleware:decodePaymentTag' + } + ) const { destination } = request.prepare // To preserve sender privacy, the accountId wasn't included in the original destination address. state.streamDestination = streamServer.decodePaymentTag(destination)