-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Validate new Members only once, when they are added to the Baggage #2505
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2505 +/- ##
=======================================
- Coverage 76.0% 75.9% -0.1%
=======================================
Files 174 174
Lines 12084 12081 -3
=======================================
- Hits 9189 9180 -9
- Misses 2651 2656 +5
- Partials 244 245 +1
|
Note about the changelog failure: this isn't changing any outside behavior. |
I'm hesitant to accept this approach. It will indeed accommodate the related issues use case, but I worry users that want to be informed early about invalid data will not appreciate this. Instead, could we utilize a If we decide to go this route, we can also do the same for the |
That makes sense. But |
TraceState has a similar "excessive validation" problem, shown in open-telemetry/opentelemetry-go-contrib#1379 benchmarks. In general, I support implementations that "trust the user" not to make mistakes in cases where excessive validation is a problem. @dmathieu would you be happy with an alternate constructor that "trusts the user" for baggage to avoid double validation? I favor this approach for the problem w/ TraceState double validation mentioned above. |
You mean keep doing the validation in |
We are somewhat limited in how far we can trust users because we are attempting to stay compliant with both the OTEL and the W3C spec for baggage. Mainly we can't output invalid data, even if the receivers are supposed to accept it. So I think we are in this bind because we don't want to handle a special case in most of our baggage logic. There are two ways to make a So if we push the validation to only at creation ( An alternative position is that instead of doing a |
Agreed. Set |
I suppose this approach can be closed in favor of #2522. |
This is an attempt at improving the number of calls to
validate()
inbaggage.Member
, calling it only when the member is added to the baggage.Right now, we call it twice. Once within
baggage.NewMember
, and another time withinbaggage.New
.Closes #2498
I chose to remove the
validate()
withinNewMember
, as we create members in a couple other places, which could not too hardly end up with members which are never validated.