-
Notifications
You must be signed in to change notification settings - Fork 837
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
Remove pkg elastic / require-in-the-middle #3813
Comments
File system:
import "./env";
import "./telemetry";
import { CONFIG } from "@app/config";
import { createYoga } from "graphql-yoga";
import { createServer as createHTTPServer } from "node:http";
(async function () {
logger.info("⌛ Server is starting...");
const yoga = createYoga()
const httpServer = createHTTPServer(yoga);
httpServer.on("error", (e) => {
logger.error(e, "❌ Cannot start the server.");
process.exit(1);
});
const [hostname, port] = CONFIG.host.split(":");
httpServer.listen(parseInt(port!), hostname);
})(); |
Require in the middle is fundamental to the way most if not all of our instrumentations work and it isn't easy to just remove. I think this seems more like an issue with esbuild configuration. Maybe we can do something that improves the situation or maybe require-in-the-middle can do something? I think even if you get the application to load, opentelemetry is likely to be completely broken because we depend so heavily on the require patching provided by RITM |
Maybe we can drop this pkg and write another one similar in @opentelemetry org? Ex: |
No the problem is , browserfy/resolve try to load file from filesystem, but i have only 1 js file (bundle) without any node_modules. I do not understand, why require-in-the-middle use that pkg |
1 similar comment
No the problem is , browserfy/resolve try to load file from filesystem, but i have only 1 js file (bundle) without any node_modules. I do not understand, why require-in-the-middle use that pkg |
There are many other dependencies that are loaded properly. Why would that one fail? |
I'm looking through require-in-the-middle and I don't see any use of is-core-module. Are you sure that is the one causing the issue? |
|
@polRk I am trying to understand the history a little bit. It looks like the maintainer of So if you re-build cleanly so that you get Update: I said "Webpack", but I meant "esbuild". |
I'll echo this. If it helps for some background -- and apologies for the vendor-specific docs -- https://www.elastic.co/guide/en/apm/agent/nodejs/current/starting-the-agent.html#start-bundlers explains some of the issues with attempting to use bundlers with anything that uses |
Only instrumentations should be effected by removing RITM. One can still manual instrument and OTel works fine. |
Yes, fair. Thanks. |
@polRk Can you confirm that things work for you now that the maintainer of the I'll continue to follow up on browserify/resolve#297 and eventually update to |
In my environment "latest" and non exact tags a banned. It will be nice to fix |
thank you, works fine |
Thanks for getting back. I'll continue to follow up on the require-in-the-middle issue. @dyladan I think you can close this issue now. |
What happened?
Steps to Reproduce
@opentelemetry/[email protected]
Expected Result
Works fine
Actual Result
Crash app on startup
Additional Details
elastic/require-in-the-middle#71
browserify/resolve#302
browserify/resolve#297
OpenTelemetry Setup Code
package.json
Relevant log output
Cannot find module 'is-core-module/package.json'
The text was updated successfully, but these errors were encountered: