elastic / elastic/apm-agent-nodejs

is apm.currentTransaction set inside a hapi `server.events.on('response'` event?

Open
#2,353 6 comments 0 reactions 1 assignee Claimed by @trentm View on GitHub
8.3-candidate agent-nodejs kibana
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

In discussion with @mshustov working on https://github.com/elastic/kibana/issues/102699 the `apm.currentTraceIds` inside a hapi server 'response' event are empty. Has the transaction already ended? Or is the run context just not bound to the 'response' server event. From a glance at the hapi instrumentation, I'm thinking the latter, but I need to play a bit to confirm.

If that is the case can we and do we want the transaction run context to be bound to the server 'response' event? How about to [other core server events](https://hapi.dev/api?v=20.2.0#-serverevents)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.