-
Notifications
You must be signed in to change notification settings - Fork 4
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
Why tracer:http_headers_inject() instead of tracer:inject() passing type? #4
Comments
There was a decision to get rid of the extra format parameter in the inject/extract method and bundle them into the carrier (see discussion on opentracing/opentracing-go#127). The methods are similar to those in the C API, but I'm open to other designs. |
So I sort of liked the more abstract |
The carrier passed in just needs to store the key-values; it shouldn't do transformations. It's the responsibility of the tracer implementation to deal with the case sensitivity of header keys and ensure that they're valid. |
That doesn't answer the issue though: e.g. do they get stored with |
I would think |
It would be following an anti-pattern to have a dummy table that has |
The PHP and JavaScript APIs both use associative arrays for carriers. A carrier interface more like what's in Go is also a possibility. But given that you can always use an intermediary table to propagate to a custom data structure, is there much of a use case for custom carrier implementations? |
I think so: e.g. in LuaJIT, iterating over a table (with pairs/next) bails out of the JIT compiler: if the HTTP implementation wants to be fast, then they can't use a table for storing headers. A different use-case is in WAFs: you want to be able to track order of headers, and take action on multiple occurrences of the same field (sometimes you want to allow it; other times it needs to be blocked). Using a plain dictionary for this structure doesn't work. |
Other language seem to have a single
inject
method where you pass in the type. Why do we have different methods per type?The text was updated successfully, but these errors were encountered: