Description:
With utilities to encode and decode timeout in the syntax specified by gRPC.
This will be used by the otelarrow components to encode and decode timeout values.
In that sense, the new code could also be added into the pending internal/otelarrow package, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33579
As this code is derived from gRPC-Go, some text is added in NOTICE according to the license. The code that this was derived from contained a TODO, which was largely addressed by eliminating very short timeouts from being encoded. This code will encode timeouts in milliseconds, seconds, hours, and days but it will not encode microsecond/nanosecond durations, these are rounded to 0m. The decoder will handle all durations that gRPC specifies, so that this logic can change in the future.
Description: With utilities to encode and decode timeout in the syntax specified by gRPC. This will be used by the otelarrow components to encode and decode timeout values. In that sense, the new code could also be added into the pending internal/otelarrow package, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33579
As this code is derived from gRPC-Go, some text is added in
NOTICE
according to the license. The code that this was derived from contained a TODO, which was largely addressed by eliminating very short timeouts from being encoded. This code will encode timeouts in milliseconds, seconds, hours, and days but it will not encode microsecond/nanosecond durations, these are rounded to0m
. The decoder will handle all durations that gRPC specifies, so that this logic can change in the future.Link to tracking Issue: https://github.com/open-telemetry/otel-arrow/issues/227
Testing: Adds basic tests.