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

instrumentation-grpc: Undefined path attribute in clientMethodTrace #2160

Closed
jorgelbg opened this issue Apr 26, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@jorgelbg
Copy link

What version of OpenTelemetry are you using?

0.19.0 from the main branch

What version of Node are you using?

v14.16.1 / macOS 10.15.7

Please provide the code you used to setup the OpenTelemetry SDK

example from examples/grpc.

What did you do?

Running the grpc instrumentation example:

# shell 1
npm run zipkin:server

and

# shell 2
npm run zipkin:client

What did you expect to see?

I expected the example using the instrumentation-grpc library to work similarly to the plugin-grpc one.

What did you see instead?

❯❯❯ npm run zipkin:client

> grpc-example@0.19.0 zipkin:client
> cross-env EXPORTER=zipkin node ./client.js

Client traceId  18602ad094e9fb4f943f9031aac4eb54
/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/node_modules/@opentelemetry/instrumentation-grpc/build/src/grpc/index.js:170
                const name = `grpc.${original.path.replace('/', '')}`;
                                                   ^

TypeError: Cannot read property 'replace' of undefined
    at ServiceClient.clientMethodTrace [as sayHello] (/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/node_modules/@opentelemetry/instrumentation-grpc/build/src/grpc/index.js:170:52)
    at /Users/jbetancourt/Code/opentelemetry-js/examples/grpc/client.js:33:12
    at async_hooks.js:313:14
    at AsyncResource.runInAsyncScope (async_hooks.js:197:9)
    at AsyncLocalStorage.run (async_hooks.js:311:35)
    at AsyncLocalStorageContextManager.with (/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)
    at ContextAPI.with (/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/node_modules/@opentelemetry/api/build/src/api/context.js:71:54)
    at main (/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/client.js:18:19)
    at Object.<anonymous> (/Users/jbetancourt/Code/opentelemetry-js/examples/grpc/client.js:47:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)

Additional context

We ran into the same issue in a bigger project that uses (among other things) Apollo for providing a GraphQL server. We were trying to remove the old plugins in favor of the new instrumentation libraries.

Initially, we thought that the issue was related to something specific about our project but I was able to reproduce it with the code from examples/grpc.

@jorgelbg jorgelbg added the bug Something isn't working label Apr 26, 2021
vmarchaud added a commit to vmarchaud/opentelemetry-js that referenced this issue May 2, 2021
dyladan added a commit that referenced this issue May 3, 2021
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
@dyladan
Copy link
Member

dyladan commented May 5, 2021

Closed in #2179

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

No branches or pull requests

3 participants