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

Express example doesn't work as expected #376

Closed
bokjo opened this issue Mar 4, 2021 · 5 comments · Fixed by #413
Closed

Express example doesn't work as expected #376

bokjo opened this issue Mar 4, 2021 · 5 comments · Fixed by #413
Labels
bug Something isn't working

Comments

@bokjo
Copy link

bokjo commented Mar 4, 2021

What version of OpenTelemetry are you using?

v0.18.0

What version of Node are you using?

v14.15.4 (npm v6.14.10)

What did you do?

If possible, provide a recipe for reproducing the error.

  1. Try to run the express example from => https:/open-telemetry/opentelemetry-js-contrib/tree/main/examples/express

Running the zipkin:client npm script thrown an error!

npm run zipkin:client

> [email protected] zipkin:client /Users/bojanche/private/opentelemetry-js-contrib/examples/express
> cross-env EXPORTER=zipkin node ./client.js
(node:35519) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'ERROR' of undefined
    at /Users/bojanche/private/opentelemetry-js-contrib/examples/express/client.js:19:45
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:35519) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:35519) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Easy fix tho StatusCode should be SpanStatusCode

span.setStatus({ code: api.StatusCode.ERROR, message: e.message });

However, after fixing the issue above I'm still not getting the desired outcome with trace and propper express spans...

What did you expect to see?

Something like the example expected images for Express
https:/open-telemetry/opentelemetry-js-contrib/blob/main/examples/express/images/zipkin.jpg

What did you see instead?

Only one client.makeRequest span
image

Additional context

Willing to help and create PR during the weekend for the SpanStatusCode issue and the example partially not working... however will need some guidance for the Express plugin and why it is not working properly (maybe some changes introduced with 0.17.0 or 0.18.0?)

@bokjo bokjo added the bug Something isn't working label Mar 4, 2021
@Flarna
Copy link
Member

Flarna commented Mar 4, 2021

Unfortunately examples on current master here are in an inconsistent state.

The instrumentations/plugins here have been updated to use 0.18.0 just recently (see #371) but there was no release made yet therefore samples have not yet been updated.

OTel API is close to go GA and therefore quite a lot is moving. I assume the modules hosted here are published soon and then examples can be updated.

@kudlatyamroth
Copy link

kudlatyamroth commented Mar 5, 2021

@Flarna i see that there is recent release 0.13.1 of plugins
but plugins like pluign-pg plugin-pg-pool doesnt have new release as they have 0.13.1 since 23 days (as of today 05.03.21)

any plans for release all plugins with support for 0.18.0 ?

@Flarna
Copy link
Member

Flarna commented Mar 5, 2021

#371 to move to 0.18.0 landed 3 days ago. I assume a release will be made soon.

As usual some helping hands could speed things up ;o)

@bokjo
Copy link
Author

bokjo commented Mar 8, 2021

#371 to move to 0.18.0 landed 3 days ago. I assume a release will be made soon.

As usual some helping hands could speed things up ;o)

Hello @Flarna,

Happy Monday!

As fairly new to OTel can you point me to some places where a helping hand is needed?

I'm willing to help with code and non-code-related stuff, aligning the examples with 0.18.x maybe?

I've read the Contributing Guide, is there a rule for the Issues marked with up-for-grabs and good first issue to what to pick first, older-newer or it is up to you?

Kind Regards,
Bojanche S.

@Flarna
Copy link
Member

Flarna commented Mar 8, 2021

I would say it's completely up to you.

Maybe @open-telemetry/javascript-maintainers can chime in here as well as they have a better overview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants