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 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() }