-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add DroppedAttributeCount field to Otel/STEF schema #22
Conversation
Just to clarify, why does the dropped attributes field need to be embedded in the |
@dmitryax it does not have to be embedded. We can make it a sibling of Attributes. The reason I embedded it is that we have a repeating pattern of AttributesList and DropedAttributeCount used as a pair in a few place. I was also a bit hesitant about introducing it, so I don't mind just making the fields siblings if you feel strong about it. |
@dmitryax BTW, one other somewhat related thing to keep in mind is how STEF handles wire format compatibility. Unlike ProtoBuf the only way to evolve STEF schema in a way that is backward compatible is by adding new fields at the very end of "struct" or "oneof" types. Adding new fields in the "middle" of a struct or oneof breaks wire compatibility in STEF (but is not a problem in ProtoBuf since the fields are numbered). STEF allows adding such fields at the end of any struct, including nested structs, not just the root struct. Because of this limitation it is beneficial to design the initial schema in a way that logically related fields are grouped into their own struct, so that if another logically related field needs to be added it can be added to the relevant nested struct, instead of being added as the last struct in a large flat root struct. I don't think we will want to adding any other fields that are related to Attributes in the future, but if we ever did then having "Attributes" as a separate struct would result in a bit nicer schema. Not a dealbreaker, just a nice to have thing. |
Thanks for clarifying. That sounds good to me, assuming that there is no performance overhead of introducing the wrapping struct |
27cba70
to
1777d40
Compare
There is a small performance penalty for adding a nested struct. Hard to benchmark, the difference is very small:
|
@dmitryax I spent a bit more time thinking about this and I think it is best to keep the Otel/STEF schema as close as possible to OTLP Protobufs. I will switch to the sibling schema for DroppedAttributesCount. |
7530ae2
to
8c8dd2d
Compare
Resolves #8 Otel/STEF schema changes: - Added "DroppedAttributeCount" field in the "Resource", "Scope", "Span", etc structs. Also updated testdata files (because the schema is now different) and renamed the incorrect ".tefz" to ".stefz" extension.
8c8dd2d
to
34deecb
Compare
Resolves #8
Otel/STEF schema changes:
Also updated testdata files (because the schema is now different) and renamed the incorrect ".tefz" to ".stefz" extension.