You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will directly simplify this problem with sample code.
Once I delved into the code a bit I simplified it to this level.
I also reviewed instrumentation here. It looks inside the request object in the Express Route, but if there is a route in the form of Express.Use (which may not be the best practice, but Express performs all route operations related to it without any problems.) Then, if a response is returned in any of the middleware except the last one, APM cannot capture the transaction name there. It appears as an unnamed transaction - unknown route.
As you can see kibana logs here:
And the source code which you can reproduce.
I may contribute it
Thanks for giving implementation details for the issue, it is really helpful :)
From your example we noticed express is required before agent starts. In that specific case we cannot guarantee the correct instrumentation of the module.
I've placed the agent start at the top and run the code again
require('elastic-apm-node').start({// config here...);constexpress=require('express');constlogger=require('morgan');constapp=express();// ...rest of the code
The result is what I think you're expecting. Transaction has the path in their name (as shown in the following screenshot)
I will directly simplify this problem with sample code.
Once I delved into the code a bit I simplified it to this level.
I also reviewed instrumentation here. It looks inside the request object in the Express Route, but if there is a route in the form of Express.Use (which may not be the best practice, but Express performs all route operations related to it without any problems.) Then, if a response is returned in any of the middleware except the last one, APM cannot capture the transaction name there. It appears as an unnamed transaction - unknown route.
As you can see kibana logs here:
And the source code which you can reproduce.
I may contribute it
app.js
www
package.json
The text was updated successfully, but these errors were encountered: