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

chore: Attached specs to the Shim.prototype for use in custom instrumentation and instrumentation outside of the agent #2038

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

bizob2828
Copy link
Member

Description

We need to attach the specs to shim if we are going to require customers and ourselves in external repos to instantiante specs at the instrumentation source. This PR assigns specs to Shim.prototype. They then can be access in instrumentation hooks as such:

module.exports = function initialize(shim, Koa) {
  const spec = new shim.specs.MiddlewareSpec({
    req,
    res,
    route: '/foo'
  })

Related Issues

Closes #2036

…umentation and instrumentation outside of the agent
mrickard
mrickard previously approved these changes Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.15%. Comparing base (ead8c25) to head (6fcb5e5).
Report is 1 commits behind head on main.

❗ Current head 6fcb5e5 differs from pull request most recent head 414f788. Consider uploading reports for the commit 414f788 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2038   +/-   ##
=======================================
  Coverage   97.15%   97.15%           
=======================================
  Files         247      247           
  Lines       41494    41495    +1     
=======================================
+ Hits        40312    40313    +1     
  Misses       1182     1182           
Flag Coverage Δ
integration-tests-16.x 78.72% <100.00%> (+<0.01%) ⬆️
integration-tests-18.x 78.70% <100.00%> (+<0.01%) ⬆️
integration-tests-20.x 78.69% <100.00%> (-0.01%) ⬇️
unit-tests-16.x 91.04% <100.00%> (+<0.01%) ⬆️
unit-tests-18.x 91.02% <100.00%> (+<0.01%) ⬆️
unit-tests-20.x 91.02% <100.00%> (+<0.01%) ⬆️
versioned-tests-16.x 75.10% <100.00%> (-0.03%) ⬇️
versioned-tests-18.x 75.32% <100.00%> (-0.03%) ⬇️
versioned-tests-20.x 75.32% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jsumners-nr
jsumners-nr previously approved these changes Feb 22, 2024
Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@bizob2828 bizob2828 dismissed stale reviews from jsumners-nr and mrickard via 414f788 February 22, 2024 20:10
@bizob2828 bizob2828 merged commit 2c97488 into main Feb 22, 2024
44 checks passed
@bizob2828 bizob2828 deleted the expose-specs branch February 22, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Expose the spec classes on shim
3 participants