Skip to content

Add/update instrumentation for @koa/router #1343

@lfk

Description

@lfk

Is your feature request related to a problem? Please describe.

The koa-router module seems to have become unmaintained as of late, resulting in a fork being made and placed under the "official" @koa namespace. See this ticket for details.

Due to how this module shims middleware, moving to @koa/router would cause breakage.

Describe the solution you'd like

Please consider including @koa/router in the instrumentation MODULES set.
Given how modules are required in the loader, there is sadly no straightforward way to link multiple entries to the same source file; symlinking might be dangerous, not sure how that'd work out cross-platform?

Describe alternatives you've considered

Made a quick attempt at using agent.addPatch(...) as suggested in #878. Had to tweak the validation logic in lib/instrumentation/modules/koa-router.js as well, as the (!semver.satisfies(version, '>=5.2.0 <8')) rejects @koa/router, which is at major version 8.

Would not consider this a permanent solution, regardless.

Edit: More details about the workaround, fixed typo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions