Closed garthk closed 4 years ago
This comment by @tsloughter in #43 suggests this is better clarified by fixing docs and typespecs rather than, say, the implementation of timestamp/0
:
The opentelemtry api timestamp is a native monotonic time and then also exports functions to make it easy for exporters to convert to any unit of system time they need (usually nanoseconds).
Spotted during #46, this Elixir-side documentation for
timestamp/0
:vs
I can't nut out why we're exporting all three of
timestamp/0
,timestamp_to_nano/1
, andconvert_timestamp/2
, nor in which structures we might expect monotonic time vs epoch time. If the API is supposed to “define the interfaces” and “function as a noop implementation”, I'm not sure of our reason to export anything that isn't in the spec.If we've got some clear reason for using monotonic time for a while before spans hit the network, I'd find it easier to nut out which we needed where if we used a different typespec. For extra clarity I'd be tempted to base epoch timestamps on
pos_integer
and monotonic timestamps onneg_integer
.