Consider custom router ?
See original GitHub issueIs your feature request related to a problem? Please describe.
I’m using egg.js to develop project. In this project, I want to use apm to monitor performance which from fronted to backend service.
In this project apm can not naming transaction with pathname, because of apm use http module, but egg.js use a module forked from koa-router
Describe the solution you’d like
Egg.js fork koa-router
and rename egg-router, they add some additional features, but not change the property. So apm can use koa-router
module to parse request in egg.js in theory. I notice that, it do judge with package name in Instrumentation
. So can add a parameter like customRouterMap
, for exmaple:
customRouterMap: {
"@eggjs/router": {
name: "koa-router",
version: "7.4.0"
}
}
put it in start func, then apm can use koa-router
module to naming transaction.
There has a simple implementation in my fork.
Please checkout whether it is feasible .
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
The feature was just released in v2.7.0 😊
Check out the new documentation for adding custom patches here: https://www.elastic.co/guide/en/apm/agent/nodejs/current/agent-api.html#apm-add-patch
The patch registry has landed now and we will be releasing it soon. 😸