last9 / last9/openapm-nodejs

bug: OpenAPM not masking the path in some cases

Open
#49 1 comment 0 reactions 1 assignee View on GitHub

@chtushar is already working on this.

Since May 14, 2024.

waiting-for-reproduction
Dominant language
TypeScript
Stars
66
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

After instrumenting the express app. In some cases OpenAPM is not masking the paths using openapm.instrument('express') signature. The paths in the screenshot should be prefixed with /org/:orgId/

Screenshot 2024-05-13 at 5 58 26 PM

To Reproduce
Steps to reproduce the behavior:

  1. Generate a demo express application using npx express-generator
  2. Use openapm.instrument('express') as per the documentation
  3. Create a router and use a parameter in the base path
  4. Start the application and make calls to the paths initialized in the router.
  5. localhost:9097/metrics won't have a parameterised routes.

Expected behavior
The paths should be parameterized like it is in the screenshot. When the middleware is used directly like this
app.use(openapm.REDMiddleware); the behaviour seems to be as expected.

Screenshot 2024-05-13 at 6 08 35 PM

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.