Description
Description
As a user of Baggage, whether it's via OTEL Baggage API or OpenTracing Bridge, the value of a baggage entry is not supposed to be restricted, i.e. the following should be valid code:
// via OpenTracing Bridge
span.SetBaggageItem("someKey", "any value I want /#%")
// via baggage package
mem, err := baggage.NewMember("someKey", "any value I want /#%")
require.NoError(t, err)
bag.SetMember(mem)
However, the NewMember
function invokes url.QueryUnescape(value)
and fails if that returns an error. And even if I URL-escape the value first, when baggage is used via OpenTracing Bridge, at some point the same NewMember
function is called with unescaped value and fails again.
I think this is the wrong behavior. There may be reasons to store the value internally as url-encoded so that serialization is more efficient (since baggage is generally accessed less frequently than it is passed around and serialized). However, that is the internal implementation detail, which is between Baggage and Propagator, it should not be spilling out to the API that the user is exposed to. A user should only deal with unencoded strings that makes sense in the application.
Unit test tat illustrates the issue: #3689
This seems similar to the issue #2523.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status