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

grpc instrumentation requires @grpc/grpc-js types but doesn't depend on it #3548

Closed
Flarna opened this issue Jan 18, 2023 · 4 comments · Fixed by #3551
Closed

grpc instrumentation requires @grpc/grpc-js types but doesn't depend on it #3548

Flarna opened this issue Jan 18, 2023 · 4 comments · Fixed by #3551
Assignees
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc

Comments

@Flarna
Copy link
Member

Flarna commented Jan 18, 2023

This results in build failures if consumer has @grpc/grpc-js not installed for other reasons.

Refs: open-telemetry/opentelemetry-js-contrib#1358 (comment)

@Flarna Flarna added bug Something isn't working triage labels Jan 18, 2023
@pichlermarc pichlermarc added priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc and removed triage labels Jan 18, 2023
@pichlermarc pichlermarc self-assigned this Jan 18, 2023
@pichlermarc
Copy link
Member

pichlermarc commented Jan 19, 2023

Thinking that #3386 could be causing this issue, as it uses the types from grpc and grpc-js in the instrumentation's public API.
I am doing some tests locally to verify.

Edit: looks like it is not actually using it in its public API, continuing to investigate.

@Flarna
Copy link
Member Author

Flarna commented Jan 19, 2023

Took a look into the generated .d.ts files:

  • index.d.ts imports ./types
  • types.d.ts type imports @grpc/grpc-js and grpc

As a result any consumer requires @grpc/grpc-js and @types/grpc.

moving metadataCaptureType away into internal-types.ts as described here should solve this.

@Flarna
Copy link
Member Author

Flarna commented Jan 19, 2023

I can create a PR as I have the changes already done local.

@pichlermarc
Copy link
Member

Took a look into the generated .d.ts files:

* `index.d.ts` imports  `./types`

* `types.d.ts` type imports `@grpc/grpc-js` and `grpc`

As a result any consumer requires @grpc/grpc-js and @types/grpc.

moving metadataCaptureType away into internal-types.ts as described here should solve this.

Ah, right. Just came to the same conclusion, you beat me to it. Thanks for taking a look.

I can create a PR as I have the changes already done local.

Please do, I'll give it a review right away. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants