-
Notifications
You must be signed in to change notification settings - Fork 812
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
Instrumenting a Remix V2 application to have automatic incoming/outgoing tracing #4990
Comments
I am seeing this too. since 0.53 incoming/outgoing are not longer instrumented. The opt-opt/in properties appear to not change behaviour. Rolling back to 0.52.0 the span on incoming/outcoming requests work again |
At a stab, something in this PR seems to have changed behaviour |
This is most likely the problem. Because Remix is required before the instrumentation is initialized, it is already in the cache. We instrument by intercepting the
I'm not sure, I don't know anything about Remix. If it used |
An option might be to initialize OpenTelemetry in a separate file and then set |
I quickly played with a Remix app (via npm run build
NODE_DEBUG=http npm start
curl -i http://localhost:3000 # to hit the Remix service Using npm install @opentelemetry/auto-instrumentations-node
NODE_OPTIONS=--require=@opentelemetry/auto-instrumentations-node/register OTEL_TRACES_EXPORTER=console OTEL_NODE_DISABLED_INSTRUMENTATIONS=fs OTEL_NODE_RESOURCE_DETECTORS=none npm start
curl -i http://localhost:3000 # to hit the Remix service (The The result is that you can see HTTP spans being created, so it is possible here. |
Ahh, I just saw this in the
When running it, do you add the ESM loader hook when calling the |
Just to add a little context in case it was missed Single fetch in remix (whicb will be the default in remix v3/react-router v7, and I’m guessing that’s what the author of this is setup with) you are most certainly using undici under the hood @trentm I'm guessing the reason you see HTTP being used in your experiment is because you are running a vanilla remix setup and havn’t setup single fetch Given this, I’m curious what it would actually take to correctly instrument a remix app using undici? |
I think this one may be a separate question from the original post, but could be related. For undici there is a specific undici instrumentation that should be used, not just the http instrumentation. The auto-instrumentations-node package can be used directly to include all packages ( One thing to check is whether this |
@ademartini-czi Is this still an issue for you? If so, if you could provide enough code to fully reproduce what you are seeing, that would help us to identify what you are hitting. |
I got Honeycomb working just by placing the telemetry code into |
What happened?
Steps to Reproduce
Is it possible to automatically instrument HTTP incoming and outgoing spans when using Remix 2? I'm trying to do this with a regular auto-generated Remix 2 app (
npx create-remix@latest
). I'm running the latest (2.12.0) with both"@opentelemetry/instrumentation-http": "^0.53.0"
and"opentelemetry-instrumentation-remix": "^0.7.1"
and it doesn't seem to create any spans. It only works if I start manually making spans in my routes.I know the remix instrumentation library isn't working because it keeps saying:
RemixInstrumentation Module @remix-run/server-runtime has been loaded before RemixInstrumentation so it might not work, please initialize it before requiring @remix-run/server-runtime
. And@opentelemetry/instrumentation-http
doesn't seem to produce anything on its own either. Maybe Remix isn't using node HTTP?Expected Result
It should be possible to automatically create trace spans for incoming/outgoing HTTP without pain using Remix V2.
Actual Result
No spans unless I manually create them.
Additional Details
OpenTelemetry Setup Code
Relevant log output
No response
The text was updated successfully, but these errors were encountered: