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(opentelemetry-instrumentation-fastify): Support Fastify V4 also #1164

Merged
merged 4 commits into from
Sep 26, 2022

Conversation

markrzen
Copy link
Contributor

@markrzen markrzen commented Sep 8, 2022

Which problem is this PR solving?

Short description of the changes

  • Upgrade to semver range to support Fastify 3+
  • Update dev dependencies and tests to test against Fastify 4.x

Checklist

  • Ran npm run test-all-versions for the edited package(s) on the latest commit if applicable.

@markrzen markrzen requested a review from a team September 8, 2022 21:05
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 8, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: markrzen / name: Mark Reynolds (d46f326)

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

overall lgtm, could you sign the CLA please ?

@codecov
Copy link

codecov bot commented Sep 10, 2022

Codecov Report

Merging #1164 (6a550ad) into main (cb83d30) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1164      +/-   ##
==========================================
- Coverage   96.08%   96.04%   -0.04%     
==========================================
  Files          14       19       +5     
  Lines         893     1113     +220     
  Branches      191      230      +39     
==========================================
+ Hits          858     1069     +211     
- Misses         35       44       +9     
Impacted Files Coverage Δ
...try-instrumentation-fastify/src/instrumentation.ts 97.41% <100.00%> (ø)
...tapackages/auto-instrumentations-node/src/utils.ts 98.03% <0.00%> (ø)
...telemetry-instrumentation-fastify/src/constants.ts 100.00% <0.00%> (ø)
...nstrumentation-fastify/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...opentelemetry-instrumentation-fastify/src/utils.ts 87.50% <0.00%> (ø)

@markrzen
Copy link
Contributor Author

@vmarchaud I am waiting on my Corp CLA manager.

@markrzen
Copy link
Contributor Author

@vmarchaud All done with the CLA.

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

@markrzen
Copy link
Contributor Author

@vmarchaud Yeah, good call. That's added.

@vmarchaud
Copy link
Member

@markrzen
Copy link
Contributor Author

@vmarchaud Sorry about that. I didn't know it was also documented on the README. Just pushed that change.

@vmarchaud
Copy link
Member

vmarchaud commented Sep 19, 2022

Sorry about that. I didn't know it was also documented on the README. Just pushed that change.

No worries :) I made a comment about it thats why i though you add forgotten it

@markrzen
Copy link
Contributor Author

@vmarchaud Thanks so much.

@markrzen
Copy link
Contributor Author

@vmarchaud What's our next step for this PR? Not trying to rush, just making sure I am not missing a step.

@vmarchaud
Copy link
Member

@markrzen Just getting more eyes to look at it to verify its fine, we generally require 2-3 reviews to merge

@vmarchaud vmarchaud requested a review from a team September 21, 2022 12:39
Comment on lines +342 to +343
!s.attributes[AttributeNames.PLUGIN_NAME] ||
s.attributes[AttributeNames.PLUGIN_NAME] === 'fastify'
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what changed so that now we need this extra check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely. Fastify reworked their namespacing of plugins. All plugins are now under the fastify top level namespace.

What used to be "plugin.name": "my-plugin" is now "plugin.name": "fastify -> my-plugin".

The extra check is there so that if you wanted to switch between fastify versions and run tests, you could and still have consistent results.

Fastify 3.x checking if the plugin name does not exist is enough, for Fastify 4.x the equivalent is to check if the plugin name is just fastify.

If you would like me to remove it from the tests as you don't think y'all will be switching versions, I am totally happy to.

Copy link
Member

Choose a reason for hiding this comment

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

@blumamir if the explaination is fine for you feel free to go ahead and merge this

@dyladan dyladan merged commit d932d3e into open-telemetry:main Sep 26, 2022
@dyladan dyladan mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants