-
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
Problem with grpc instrumentation in v0.41.2 #4053
Comments
Hi @mydea, thanks for opening this issue: Would you mind trying to instantiate the Moving it to |
OK, I see the problem now I think, it happens if you instantiate the GRPC instrumentation before you setup Otel. This works: const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
//traceExporter: new ConsoleSpanExporter(),
instrumentations: [
new GrpcInstrumentation(),
new HttpInstrumentation(),
new ExpressInstrumentation(),
], This doesn't: const grpc = new GrpcInstrumentation();
const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
//traceExporter: new ConsoleSpanExporter(),
instrumentations: [
grpc,
new HttpInstrumentation(),
new ExpressInstrumentation(),
], I wonder, is there a reason why the initialization happens in the constructor, not in |
Most likely it is just a historical thing. The gRPC instrumentation actually predates the |
Is this resolved? |
Any update here? Facing the same issue, http instrumentation seems to be working, but not able to see any grpc data.
|
@priyanshu-gautam I think the bug you're describing is actually #4151, where the gRPC exporter requires I was planning for the work on the exporter rewrite to be on track sooner which also aims to fix that bug, but it looks like it'll take a while until the rewrite is a viable solution. I'll pick up work on #4151 ASAP as we've had a lot of people that are in the same boat with this issue and I don't think we should wait. With a manual setup, there was actually a workaround of changing the import order and enabling instrumentations early, but when using NodeSDK there is no way to do that as instrumentations are enabled by NodeSDK itself, which also needs the exporter added in the constructor. |
I think this was fixed, so closing this! thank you 🙏 |
What happened?
Steps to Reproduce
npm install
npm run start
If you comment the line:
And then run
npm run start
, you'll see the log@opentelemetry/instrumentation-http http instrumentation incomingRequest
Expected Result
Should work with grpc instrumentation
Actual Result
Does not work with grpc instrumentation
Additional Details
I've done some digging, and it seems to me to work if I move this (from built output, but you get the idea):
into
init
:Not sure if that has other implications, though...
OpenTelemetry Setup Code
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: