Closed MrAlias closed 1 year ago
The SDK MUST handle numerical limits in a graceful way according to Error handling in OpenTelemetry.
OpenTelemetry implementations MUST NOT throw unhandled exceptions at run time.
The [...] SDK SHOULD provide safe defaults for missing or invalid arguments.
Whenever the library suppresses an error that would otherwise have been exposed to the user, the library SHOULD log the error using language-specific conventions.
The specification only calls out aggregation_cardinality_limit
which is not implemented (it is experimental).
If the SDK receives float/double values from Instruments, it MUST handle all the possible values. For example, if the language runtime supports IEEE 754, the SDK needs to handle NaNs and Infinites.
Exploratory tested with NaN, Inf+, Inf-. Results: https://github.com/open-telemetry/opentelemetry-go/pull/4209. Everything works as expected.
It is unspecified how the SDK should handle the input limits. The SDK authors MAY leverage/follow the language runtime behavior for better performance, rather than perform a check on each value coming from the API.
This is explicitly not normative.
It is unspecified how the SDK should handle the output limits (e.g. integer overflow). The SDK authors MAY rely on the language runtime behavior as long as errors/exceptions are taken care of.
This is not normative. However, there is a requirement that "OpenTelemetry implementations MUST NOT throw unhandled exceptions at run time." that needs to be checked.
Integer overflows are not causing runtime panic at runtime. The value is simply overflown. Reference: https://go.dev/ref/spec#Integer_overflow
It looks like we comply with this fragment of the specification.
@MrAlias Can you please double-check and close if you agree with my verification?
LGTM