Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handler name http runtime #558

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/service/worker/runtime/builtIn/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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()
}
Loading