gsoc-swift-tracing icon indicating copy to clipboard operation
gsoc-swift-tracing copied to clipboard

Allow nanos in timestamps

Open ktoso opened this issue 3 years ago • 3 comments

While it's debatable if nanoseconds make sense in distributed traces... (a few nanos here or there are not likely going to lead you down to "aha this is the slow request!" etc), but yeah the topic comes up from time to time and the current otel spec suggests allowing nanos: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-status

A timestamp is the time elapsed since the Unix epoch.

  • The minimal precision is milliseconds.
  • The maximal precision is nanoseconds.

Related discussion in zipkin-js https://github.com/openzipkin/zipkin-js/issues/187

ktoso avatar Aug 12 '20 13:08 ktoso

lurker here: while I've not needed nano's very often to find what's accumulated slowest/problem path, I'd like to encourage you to keep/allow it as a precision instrument, as it enables re-use of the underlying data structures in some interesting ways beyond the strict trace-collection things.

heckj avatar Aug 12 '20 14:08 heckj

Thanks for chiming in! Right that makes sense... 👍

While usually nanosecond precision is more the domain of profiling, there's no reason for us to arbitrarily disallow nanos, maybe someone can make use of the same infra in some useful way to measure something quickly 👍

ktoso avatar Aug 12 '20 23:08 ktoso

related to https://github.com/slashmo/gsoc-swift-tracing/issues/118#issuecomment-674509054

pokryfka avatar Aug 16 '20 10:08 pokryfka