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: add express plugin #666 #685

Merged
merged 10 commits into from
Feb 20, 2020

Conversation

vmarchaud
Copy link
Member

@vmarchaud vmarchaud commented Jan 11, 2020

TODO:

  • add http.route in the http server span
  • add options to disable span for specific middlewares/router

@codecov-io
Copy link

codecov-io commented Jan 11, 2020

Codecov Report

Merging #685 into master will increase coverage by 3.46%.
The diff coverage is 98.7%.

@@            Coverage Diff             @@
##           master     #685      +/-   ##
==========================================
+ Coverage   91.11%   94.57%   +3.46%     
==========================================
  Files         232      217      -15     
  Lines       10444     9981     -463     
  Branches      958      857     -101     
==========================================
- Hits         9516     9440      -76     
+ Misses        928      541     -387
Impacted Files Coverage Δ
packages/opentelemetry-plugin-http/src/http.ts 97.72% <ø> (ø) ⬆️
...es/opentelemetry-plugin-express/test/utils.test.ts 100% <100%> (ø)
...ckages/opentelemetry-plugin-express/src/version.ts 100% <100%> (ø)
packages/opentelemetry-plugin-http/src/utils.ts 97.4% <100%> (+0.14%) ⬆️
...lemetry-plugin-http/test/functionals/utils.test.ts 99.4% <100%> (+0.03%) ⬆️
packages/opentelemetry-plugin-express/src/types.ts 100% <100%> (ø)
packages/opentelemetry-plugin-express/src/utils.ts 95.45% <95.45%> (ø)
...ckages/opentelemetry-plugin-express/src/express.ts 98.85% <98.85%> (ø)
.../opentelemetry-plugin-express/test/express.test.ts 99.14% <99.14%> (ø)
...ages/opentelemetry-plugin-http/test/utils/utils.ts 33.33% <0%> (-26.67%) ⬇️
... and 73 more

Copy link
Member

@OlivierAlbertini OlivierAlbertini left a comment

Choose a reason for hiding this comment

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

First pass, added few comments. Good job!

packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-http/src/utils.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

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

I added few comments, and have some questions too.
Last thing: could you please add some screenshots how the spans look like (for example from zipkin or something relevant etc.) ?

packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/express.ts Outdated Show resolved Hide resolved
@vmarchaud vmarchaud force-pushed the add-express-plugin branch 2 times, most recently from b020813 to 61088a7 Compare January 19, 2020 12:20
Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

Overall this looks ok, but I am very wary of the use of a mutilated request object. In my mind this not only has the chance to break a user's application (in the unlikely event they also try to set/modify a property with the same name), but makes the express plugin an implicit dependency of the http plugin. If someone unaware of this behavior modifies this plugin in the future and changes this property, it has the chance of breaking a seemingly unrelated non-dependent plugin.

packages/opentelemetry-plugin-express/src/types.ts Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/utils.ts Outdated Show resolved Hide resolved
@dyladan dyladan added enhancement New feature or request and removed feature-request labels Jan 22, 2020
@vmarchaud vmarchaud added the needs-more-reviewers PRs with this label are ready for review and needs more people to review to move forward. label Jan 26, 2020
@dyladan dyladan added size/XXL and removed size/XL labels Feb 10, 2020
README.md Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/README.md Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/README.md Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/README.md Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/package.json Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/package.json Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/package.json Outdated Show resolved Hide resolved
packages/opentelemetry-plugin-express/src/index.ts Outdated Show resolved Hide resolved
@mayurkale22
Copy link
Member

Somehow getting 500 (Server Error) on codecov report.

@vmarchaud vmarchaud added feature-request and removed needs-more-reviewers PRs with this label are ready for review and needs more people to review to move forward. labels Feb 15, 2020
@dyladan
Copy link
Member

dyladan commented Feb 18, 2020

@OlivierAlbertini since you had a lot of comments I would appreciate your review here before merge

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

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

I just miss some screenshots to show how the spans will look like when using this plugin, other than that lgtm

@vmarchaud
Copy link
Member Author

@obecny i will add examples in a seperate PRs and include screenshot in there

@dyladan
Copy link
Member

dyladan commented Feb 19, 2020

@vmarchaud I agree with mayur we should not have broken links in the readmes. We can add a link when there is an example to link to

@mayurkale22 once he does that I think we should merge this. seems like @OlivierAlbertini is busy

Copy link
Member

@OlivierAlbertini OlivierAlbertini left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I will test with some internal apps this week-end. I will give feedback if needed.
@vmarchaud good job!

| `ignoreLayers` | `IgnoreMatcher[]` | Express plugin will not trace all layers that match. |
| `ignoreLayersType`| `ExpressLayerType[]` | Express plugin will ignore the layers that match based on their type. |

For reference, here are the three different layer type:
Copy link
Member

Choose a reason for hiding this comment

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

👍

@vmarchaud
Copy link
Member Author

@dyladan I've rebased the PR and removed the link from the readme

@dyladan dyladan merged commit 5e0d2c9 into open-telemetry:master Feb 20, 2020
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants