-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support optional fields in proto #4258
Comments
Gogo has been looking for a new owner for some time now, would be better just to use the official protobuf lib for go? |
There have now been 3 prototypes to attempt at adding support for optional fields:
With options 1 & 2, the burden of maintenance moving forward continues to be high, in addition to continuing a dependency on a library which is no longer maintained. The performance of option 3 essentially means we'll have to spend significant amounts of effort in another library (vtproto). As mentioned in the SIG call on Jan 12, as a result of the previous 3 prototypes, the current thinking is to move ahead with prototyping serialization/deserialization OTLP from/to pdata directly. This has been done by the Java SIG as per the discussion here Benefits
Drawbacks
|
Can we use the generated code as a starting point, which we then tweak to get rid of gogoproto dependency? This should significantly lower the implementation effort. I think Bogdan's idea of implementing a limited code generator just for our use-case is also worth exploring. If we decide to go with manually written serialization code (or with our own code generator) it will open some more optimization possibilities which are difficult/impossible with gogoproto today (e.g. I want to replace AnyValue by much faster Variant I wrote or experiment with changing AttributeMap key/value list into an open-addressing hashmap to improve performance with large maps, etc). My concern with manually written deserialization code is the potential to introduce bugs which can be very impactful since OTLP is an untrusted input. We need to look into fuzz testing and other verification measures if we go this route so that we have reasonable confidence in our implementation. |
@codeboten one option which I don't know if we thought/discuss about is to actually rely on
@codeboten: showed me, something similar suggested by @anuraaga, though I discovered this while working on a faster/lazy proto generator and reading the oneof description. I think this is a good short term and we can do this as we do the nullable, since this |
I think this achieved the goal, and we should focus on updating to 0.15.0. |
A change proposed in the opentelemetry-proto uses
optional
fields, which are not supported by the gogo proto library. A few options have been proposed on how to move forward:The text was updated successfully, but these errors were encountered: