-
Notifications
You must be signed in to change notification settings - Fork 814
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
Issue with gRPC while using auto instrumentation #4145
Comments
Is this still reproducible with latest versions of Otel modules? |
Yes it does. I think the problem is here - the SDK loads the OTLP GRPC exporter which in turn loads grpc-js. Workaround is to call |
It is reproducible on latest versions of Otel modules as well.
This worked! Here's updated tracing.js:
|
Closing this issue as I guess calling |
I'm having this same problem. I tried the solution in this thread but it isn't working. Here's my code: const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const autoInstrumentations = getNodeAutoInstrumentations({
'@opentelemetry/instrumentation-fs': {
enabled: false,
},
});
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { diag } = require('@opentelemetry/api');
const { PrismaInstrumentation } = require('@prisma/instrumentation');
const { TELEMETRY_SERVICE_NAME } = require("./config");
const {
trace,
} = require('@opentelemetry/api');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc');
const exporter = new OTLPTraceExporter();
const sdk = new NodeSDK({
traceExporter: exporter,
instrumentations: [autoInstrumentations, new PrismaInstrumentation()],
});
if (process.env.OTEL_EXPORTER_OTLP_HEADERS && process.env.OTEL_EXPORTER_OTLP_ENDPOINT) {
try {
sdk.start();
diag.info('OpenTelemetry automatic instrumentation started successfully');
} catch (error) {
diag.error(
'Error initializing OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry',
error
);
}
} else {
diag.info('OpenTelemetry automatic instrumentation disabled');
}
export const tracer = trace.getTracer(TELEMETRY_SERVICE_NAME); Any recommendations for how to debug this? I'm trying to clean up our log pollution and this one is particularly annoying :D |
Set a breakpoint in the file |
I'll look into doing so when I have a minute -- I don't have much experience with JS so figuring out how to hold the debugger right is probably beyond my available time today. @Flarna can we re-open this issue as it appears to not have been fixed? |
According to #4145 (comment) it is solved. Seems you have a new problem which looks similar but this doesn't imply it's the same problem. What about creating a new issue once you verified that call sequence is correct in your setup? |
Should the README be updated then, as currently it still states that |
What happened?
Steps to Reproduce
While auto instrumenting a node.js app with node auto instrumentation library
Using below command to install OTLP:
Here's tracing.js:
Then running the App:
Expected Result
No errors in logs.
Actual Result
I am seeing below warning/error related to gRPC even though my app doesn't has any gRPC imports:
Additional Details
OpenTelemetry Setup Code
No response
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: