-
Notifications
You must be signed in to change notification settings - Fork 552
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
fix(instrumentation-redis): remove redis types from public API #1424
fix(instrumentation-redis): remove redis types from public API #1424
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1424 +/- ##
==========================================
- Coverage 96.13% 95.96% -0.18%
==========================================
Files 14 17 +3
Lines 906 1066 +160
Branches 197 217 +20
==========================================
+ Hits 871 1023 +152
- Misses 35 43 +8
|
The change itself is ok but it doesn't solve the problem that the redis instrumentation exposes the redis types. Could you replace |
Thanks for the feedback, I updated the PR with these changes (b86dc5e) 🙂 I feel like I still lack some understanding of the subject, though:
We're doing something similar in the express instrumentation (depending on |
Using the types in the user facing API is always a time bomb. We had this in several instrumentations in the past. You may fix one problem by removing If it is in the user facing API it needs to be in the dependencies otherwise users using typescript see issues because of missing types. The only safe variant is to keep the user facing API free of types of 3rd party modules. see also here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to update description a bit as it's now a bit more then do not use Callback
.
Callback
from @types/redis
@Flarna got it, thanks! 🙂 |
Which problem is this PR solving?
Having both @opentelemetry/instrumentation-redis and redis@^4.0.2 (common when using
@opentelemetry/autoinstrumentations-node
) installed causes typescript compilation errors.Fixes #1323
Short description of the changes
Callback
type in the public API.@types/redis
as a dependency and moves it to devDependencies instead