Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set name of middleware function to improve interop with monitor…
…ing tools (#159) Set name of middleware function to improve interop with monitoring tools. Tools like [@opentelemetry/instrumentation-koa](https://www.npmjs.com/package/@opentelemetry/instrumentation-koa) use function names to generate span names. These names appear in UI of monitoring tools, such as datadog. Because the returned function doesn't have a name, there's no hint about the actual middleware associated with that span. See below: <img width="227" alt="Screenshot 2024-03-24 at 13 03 42" src="https://github.com/koajs/bodyparser/assets/1017236/e60cad1c-d348-4d2b-baca-486d0396ed9e"> In v4 the returned middleware had a name but in v5 got removed, see: https://github.com/koajs/bodyparser/blob/5678a79e64d7833e0dd7734c9e9de40126e14d98/index.js#L63.
- Loading branch information