-
Notifications
You must be signed in to change notification settings - Fork 440
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
Only support signed 64 bit integers as attribute values #634
Comments
I think this is a disaster in the making. |
Let me elaborate: certain metrics flows rely on unsigned 64-bit integers. Most mature tracing systems support the full gamut of types. It is always easy to violently convert any other type to |
Also narrowing it down to just And if concrete exporter cannot express unsigned 64-bit integers - well, I guess then someone can come up with an exporter customization that can convert a From ETW exporter perspective that supports much wider typing system (and subsequently many other databases that may store strongly typed key-value pairs) - simple types here , I'd say that restricting this to just |
Agree @maxgolov typing information could to relevant to many telemetry systems, and loosing this at api level won't be good. As you mentioned, we need to find ways to preserve type in such scenarios. |
I see, so our policy will be to accept everything on the API side and let the exporters handle the details. In light of that, I don't see why we shouldn't include |
@pyohannes even with |
@pyohannes - makes sense to me! We can ensure that we add a snippet to our documentation, something like: Please make sure that the value types passed to attributes are compatible with your exporter. Default OTLP exporter implementation allows for the following types (link) ... API surface enables type casting, as in changing an variable of one data type into another when and if it makes sense. For example, 32-bit signed integers passed to API may be transformed to 64-bit signed integers. However, unsigned 64-bit integers are not supported by OTLP exporter. Please avoid passing types that are not compatible with the exporter of your choice. That should be sufficient. As long as the contract is clearly spelled out in the documentation, we are good with respect to remaining fully compliant with the mainline spec. |
Related issue about adding byte buffers on API: open-telemetry/opentelemetry-specification#780 If we "future-proof" the API surface for v1.0 C++ SDK now, then it's going to be easier for us to support new types in v1.1 or v1.2 without needing to rev-up. ABI compatibility is a pain for C++ SDK, so it's better if we future-proof. Easier to tell that we have types "reserved for future use" than trying to add them later. Other languages are not generally prone to ABI issues. And in lesser need for future proofing. We need to do what is best for C++ as a language. |
Does it mean that we would keep supporting all the types for attribute values at api surface, and let exporter decide how to handle these data? Won't that be non-compliance with api specs ? |
We can provide the list of types that are supported by OTLP exporter. And explain that any 'non-standard' type behavior is @TomRoSystems @pyohannes @ThomsonTan During the meeting yesterday, I promised to follow-up with the list of practical reasons to advocate for inclusion of:
These are the reasons:
I would say we should I hope we can get the byte arrays support added in the nearest update of spec, e.g. in Why future-proofing? Because without it we are going to be trapped in perpetual ABI compatibility hassle, that hassle is unique to C++ SDK, and committee should be able to respect and understand our desire to provide a stable, long-term usable, ABI surface, with no ABI compatibility issues on it. ... extending variant in future rev with new types presents ABI backwards-compatibility challenge. @jsuereth - we discussed it once before. |
For attribute values, the specification only asks for one integer value: signed 64 bit integers.
However, currently our API currently supports four integer types:
uint32_t
uint64_t
int32_t
int64_t
OTLP also only supports signed 64 bit integers, so we will run into problems with unsigned 64 bit integers there.
I recommend aligning with the specification and to only support
int64_t
. I can put up a PR for that, but this is breaking change, so please give your opinions here.The text was updated successfully, but these errors were encountered: