-
Notifications
You must be signed in to change notification settings - Fork 825
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
GrpcInstrumentation does not implement @opentelemetry/instrumentation InstrumentationBase #4201
Comments
grpc instrumenation has some history. Initially grpc and grpcjs had separate instrumentation libraries. Not 100% sure but I guess that time both of them used
As far as I can see the Do you miss anything specific or does the FWIW I think a cleanup step to remove the |
Ah yes, makes sense. So actually more a typescript caused issue then a functional one. I think typescript leaks to much of the internals here. A more compatible solution would be to export an We had similar issues caused by typescript in the past. @dyladan do we have the refactoring to move towards interfaces on the SDK 2.0 roadmap? But as said above for the |
Ah yeah, also I just realized that |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
I'll open a PR to do that, it's |
Context
As far as I can tell the other
@opentelemetry/<instrumentation-name-here>
libraries all implement theInstrumentationBase<any>
interface from the@opentelemetry/instrumentation
library. Including many of the 3rd party libraries, such as forkoa
,MongoDb
, and others.Ran into this particular problem when trying to work with the types for multiple instrumentation tools for my work project where we needed to provide overrides or create new instances when no override was available. Given the GRPC Instrumentation didn't use the interface of the others I wanted to see if this was intentional or not.
Question
Should the
GrpcInstrumentation
library also follow this convention or is there a reason why it does not use theInsturmentationBase
interface like many of the others?Example
You can see an example of this in the following files
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts
where it is different in this one:
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-grpc/src/instrumentation.ts
This only affects the JavaScript OpenTelemetry library
This may affect other libraries, but I would like to get opinions here first
The text was updated successfully, but these errors were encountered: