Skip to content

Commit

Permalink
Merge pull request #558 from vtex/add-handler-name-http-runtime
Browse files Browse the repository at this point in the history
Add handler name http runtime
  • Loading branch information
filafb authored May 15, 2024
2 parents 8defd37 + 11f195e commit 94f3dee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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()
}

0 comments on commit 94f3dee

Please sign in to comment.