Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set name of middleware function to improve interop with monitoring tools #159

Merged
merged 1 commit into from Mar 25, 2024

Conversation

satazor
Copy link
Contributor

@satazor satazor commented Mar 24, 2024

Set name of middleware function to improve interop with monitoring tools.

Tools like @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:

Screenshot 2024-03-24 at 13 03 42

In v4 the returned middleware had a name but in v5 got removed, see:

return async function bodyParser(ctx, next) {
.

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@fengmk2 fengmk2 merged commit 9c18179 into koajs:master Mar 25, 2024
6 checks passed
@fengmk2
Copy link
Member

fengmk2 commented Mar 25, 2024

  • @koa/bodyparser@5.1.0

@satazor
Copy link
Contributor Author

satazor commented Mar 25, 2024

@fengmk2 thanks for the quick merge and release 🙏

@satazor satazor deleted the patch-1 branch March 25, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants