Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Support tails in Hapi #382

@DominicKramer

Description

@DominicKramer

As described by @AdriVanHoudt on PR PR 379:

"In hapi there is a concept of tails where you can still do stuff in your handler after you replied.
In this case you end the span when you call reply. I have some routes where I do some queries after replying for performance reasons and it would be great if those queries would also end up in the trace of that request.
Would it be possible to integrate this? You have access to the full request object on that event and it is fired only once per request.
See https://github.com/hapijs/hapi/blob/master/API.md#server-events and https://github.com/hapijs/hapi/blob/master/API.md#requesttailname for more info.
And https://pbs.twimg.com/media/CL-bp3_W8AAimRi.png:large for a nice overview of how the hapi lifecycle works"

Metadata

Metadata

Assignees

Labels

api: cloudtraceIssues related to the googleapis/cloud-trace-nodejs API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions