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(koa): migrate koa example to opentelemetry-instrumentation-koa #1118

Merged
merged 9 commits into from
Aug 21, 2022

Conversation

haddasbronfman
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • The koa examples were moved from ./examples/koa to ./plugins/node/opentelemetry-instrumentation-koa/examples

Checklist

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

@haddasbronfman haddasbronfman requested a review from a team August 15, 2022 09:47
@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Merging #1118 (f13cace) into main (44f9527) will increase coverage by 0.68%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1118      +/-   ##
==========================================
+ Coverage   96.07%   96.75%   +0.68%     
==========================================
  Files          14       24      +10     
  Lines         892     1234     +342     
  Branches      191      270      +79     
==========================================
+ Hits          857     1194     +337     
- Misses         35       40       +5     
Impacted Files Coverage Δ
...trumentation-express/src/enums/ExpressLayerType.ts 100.00% <0.00%> (ø)
...opentelemetry-instrumentation-express/src/utils.ts 97.36% <0.00%> (ø)
...nstrumentation-express/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...ry-instrumentation-koa/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...opentelemetry-instrumentation-express/src/types.ts 100.00% <0.00%> (ø)
...tapackages/auto-instrumentations-node/src/utils.ts 98.00% <0.00%> (ø)
...ode/opentelemetry-instrumentation-koa/src/utils.ts 100.00% <0.00%> (ø)
...ode/opentelemetry-instrumentation-koa/src/types.ts 100.00% <0.00%> (ø)
...lemetry-instrumentation-koa/src/instrumentation.ts 97.53% <0.00%> (ø)
...try-instrumentation-express/src/instrumentation.ts 99.29% <0.00%> (ø)

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

Thanks, left few minor comments.

The PR is marked as fix which will trigger a release of a new patch version for the instrumentation and will go into the changelog and release notes.
Since this PR only changes example files, it should be marked as chore which will not affect the release :)

// Initialize the OpenTelemetry APIs to use the NodeTracerProvider bindings
provider.register();

return api.trace.getTracer(serviceName);
Copy link
Member

Choose a reason for hiding this comment

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

tracer name is usually set to a package name ( as set in the name field in package.json) which in our case is koa-example

Copy link
Member Author

Choose a reason for hiding this comment

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

Also here I took this behavior from here: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/939/files, see tracer.ts file, line 50. this PR appears in the issue as a reference, so I thought this is ok they will be aligned.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is an overlooked mistake in express example PR.
This is a minor issue but would love other opinions @open-telemetry/javascript-approvers

@haddasbronfman haddasbronfman changed the title fix(migrate-koa-example): migrate koa example to opentelemetry-instrumentation-koa chore(migrate-koa-example): migrate koa example to opentelemetry-instrumentation-koa Aug 17, 2022
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

left a few last optional comments which are not blockers on my end.
Great work and thanks for taking this task and contributing :)

plugins/node/opentelemetry-instrumentation-koa/README.md Outdated Show resolved Hide resolved
// Initialize the OpenTelemetry APIs to use the NodeTracerProvider bindings
provider.register();

return api.trace.getTracer(serviceName);
Copy link
Member

Choose a reason for hiding this comment

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

I think this is an overlooked mistake in express example PR.
This is a minor issue but would love other opinions @open-telemetry/javascript-approvers

@blumamir blumamir changed the title chore(migrate-koa-example): migrate koa example to opentelemetry-instrumentation-koa chore(koa): migrate koa example to opentelemetry-instrumentation-koa Aug 18, 2022
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

Thank you for addressing everything! great job :)
LGTM

@blumamir blumamir merged commit b406b1d into open-telemetry:main Aug 21, 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.

2 participants