slashmo / gsoc-swift-tracing

WIP collection of Swift libraries enabling Tracing on Swift (Server) systems.
https://summerofcode.withgoogle.com/projects/#6092707967008768
Apache License 2.0
20 stars 1 forks source link

Allow nanos in timestamps #123

Open ktoso opened 4 years ago

ktoso commented 4 years ago

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

heckj commented 4 years ago

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.

ktoso commented 4 years ago

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 👍

pokryfka commented 4 years ago

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