-
Notifications
You must be signed in to change notification settings - Fork 569
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
addHeader removed in Undici request #3043
Comments
That method is unsafe and pretty much undefined in terms of behavior. A request object should not be mutated once queued. What are you trying to achieve? Maybe we can find a better way to deal with it. |
Our agent needs to propagate some headers before making an outbound request. This was a documented use case and removed in a minor release |
Diagnostics channels are experimental. Hence any breaking change to them is not qualitifed as semver major. I'm not opposed to deferring it as such but it was in this case decided that it's not necessary. What was/is it documented? We might need to fix that as well. |
And you can't achieve that with a dispatcher? Can you provide me with a full example? |
This propagation use case is a W3C standard. These were the docs I'm referring to as how to achieve this. |
Here's our code to propagate headers |
Maybe, I'm just not that familiar with the API. At the time of our instrumentation we just followed the docs that were removed in a semver minor. Experimental or not, this was quite abrupt |
Looking at dispatchers, it's not the appropriate use case as we're an agent. The diagnostics channel seems more apropos for this use case |
I can fix our instrumentation to just do |
Please don't do that. That should/will not work either. Diagnostic channels should not mutate the request state. |
We are having a meetup in London this week and I'll bring your use case up for discussion. |
@ronag why don't you suggest pushing headers, it works just fine and looking at the request code, that's what is happening? we also cannot wait for a meeting next week. We have 100s of customers relying on this instrumentation. |
if that's the thinking, then it needs to be revisited. That's a major use case for observability vendors |
@mcollina wdyt? Revert the remove addHeader part and defer to a semver major? |
Let's revert this. I guess we should not have been done that to begin with and modifying headers is a valid use case. |
@ronag the use case of APMs is to be able to do these kind of manipulations. |
Thanks @mcollina 🙏 |
Bug Description
Looks like addHeader was removed in https://github.com/nodejs/undici/pull/3024/files. The New Relic Node.js agent relies on this to propagate headers in our instrumentation.
Reproducible By
Expected Behavior
Adds
test-header
with value ofvalue
Logs & Screenshots
Environment
Any, undici 6.11.0
The text was updated successfully, but these errors were encountered: