-
Notifications
You must be signed in to change notification settings - Fork 531
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
instrumentation-undici can throw "[ERR_INVALID_URL]: Invalid URL" in 'undici:request:create' handler #2471
Comments
@neo1parekh the support statement on |
@neo1parekh does that answer the question? 🙂 |
Hi @pichlermarc sorry couldn't reply earlier, Thanks for reminding message. In @opentelemetry/instrumentation-undici package.json undici version is 6.11.1 using and I want to start using opentelementry version, using older version might cause feature updation. I understand to build for older version. |
@neo1parekh as said earlier this should still work. Is there anything that I'm missing that leads you to believe that this wouldn't work? |
@pichlermarc Have question if you can help. by installing solr-client which install undici version 4.16.0. Which raise following error.
This error is only because of this feature is currently not supported for older version of undici. If yes, this help me where should I have to do changes. otherwise explain more on this. Thanks. |
@neo1parekh ah, I see - looks like something inside the instrumentation is throwing here. I'm not sure though if this is related
Looking at the error above - would you mind providing some additional info that's logged to the console (other than the stack trace)? This is what an error thrown by the
it's the |
I'm re-categorizing this as a possible bug that is in need for a reproducer - I've tried to reproduce this by passing various inputs to |
reproHere is my repro:
const solr = require('solr-client');
async function main() {
const client = solr.createClient(
{ host: '127.0.0.1', port: 8983, path: '/solr', core: 'gettingstarted' }
);
const res = await client.ping();
console.log('solr response: ', res);
}
main() Using that: # start solr
mkdir -p solrdata
docker run -d -v "$PWD/solrdata:/var/solr" -p 8983:8983 --name my_solr solr:8 solr-precreate gettingstarted
node use-solr.js That works without instrumentation:
Now add instrumentation:
the issue in instr-undiciinstr-undici is failing on: private onRequestCreated({ request }: RequestMessage): void {
// ...
const requestUrl = new URL(request.origin + request.path); In the above example, courtesy of debugging prints, the
That
However, instr-undici needs to be defensive. an issue in solr-client?The solr-client passing a
I'm not sure if this is for some sort of proxying by Solr to multiple nodes or just a mis-usage by the Node.js solr-client. |
fix optionsFirst, the However, should it do better than the current: const requestUrl = new URL(request.origin + request.path); ? If request.origin is We could change the code to: const requestUrl = new URL(request.path, request.origin); Then we get these cases: // The usual case:
> new URL('/some/path', 'http://example1.com').href
'http://example1.com/some/path'
// The case on this issue where request.path is a full URL
> new URL('http://example2.com:8001/some/path', 'http://example1.com:8000').href
'http://example2.com:8001/some/path' I think this could work with the HTTP client span semantics (https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client). Ideally we would get these span attributes:
|
… is a full URL Closes: open-telemetry#2471
Hi Folks, Thank you so much for looking into it on, and provided best solution on my small query. Really appreciated for time you all have put in 👍 |
Hi Folks,
I have been using solr-node-client for a long time, I have started using new package opentelemetry JAVASCRIPT packages.
"@opentelemetry/auto-instrumentations-node": "^0.50.0"
"@opentelemetry/exporter-trace-otlp-http": "^0.53.0"
"@opentelemetry/sdk-node": "^0.53.0"
under this opentelemetry-js-contrib package uses undici dependencies package.
which required unidici version greater than 5.2
reference link
But solr-client package required unidici version 4.11.1.
Can someone help how would I run both npm opentelementry and solr-node-client together or any other solution which can work out.
Any help would really appreciated.
The text was updated successfully, but these errors were encountered: