From 67933b7993b1ad0a7bb40e2803754e7353674b41 Mon Sep 17 00:00:00 2001 From: Filadelfo Date: Tue, 19 Mar 2024 21:15:34 -0300 Subject: [PATCH 1/2] Add requestHandlerName on runtime http handlers --- src/service/worker/runtime/builtIn/handlers.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/service/worker/runtime/builtIn/handlers.ts b/src/service/worker/runtime/builtIn/handlers.ts index f817e9a9..9d815cc9 100644 --- a/src/service/worker/runtime/builtIn/handlers.ts +++ b/src/service/worker/runtime/builtIn/handlers.ts @@ -4,7 +4,8 @@ export const whoAmIHandler = ({ events, routes, }: ServiceJSON) => (ctx: ServiceContext) => { - ctx.tracing?.currentSpan?.setOperationName('builtin:whoami') + ctx.requestHandlerName = 'builtin:whoami' + ctx.tracing?.currentSpan?.setOperationName(ctx.requestHandlerName) ctx.status = 200 ctx.body = { events, @@ -17,7 +18,8 @@ export const healthcheckHandler = ({ events, routes, }: ServiceJSON) => (ctx: ServiceContext) => { - ctx.tracing?.currentSpan?.setOperationName('builtin:healthcheck') + ctx.requestHandlerName = 'builtin:healthcheck' + ctx.tracing?.currentSpan?.setOperationName(ctx.requestHandlerName) ctx.status = 200 ctx.body = { events, @@ -26,7 +28,8 @@ export const healthcheckHandler = ({ } export const metricsLoggerHandler = (ctx: ServiceContext) => { - ctx.tracing?.currentSpan?.setOperationName('builtin:metrics-logger') + ctx.requestHandlerName = 'builtin:metrics-logger' + ctx.tracing?.currentSpan?.setOperationName(ctx.requestHandlerName) ctx.status = 200 ctx.body = ctx.metricsLogger.getSummaries() } From 11f195eace2f453d81f72469180d138fa918e2d3 Mon Sep 17 00:00:00 2001 From: Filadelfo Date: Tue, 19 Mar 2024 21:19:10 -0300 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e70d4d2..951a9780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## Fixed +- Add handler name for runtime http handlers + ## [6.46.1] - 2024-01-31 ### Fixed