spandex-project / spandex

A platform agnostic tracing library
MIT License
335 stars 53 forks source link

Allow passing in a custom `:start` in trace/span `opts` #147

Open ggiill opened 1 year ago

ggiill commented 1 year ago

This is helpful for "retroactive" traces/spans, where a completion event is emitted with a duration.

An example is Oban, which emits :stop and :exception telemetry events with :duration as a measure.

We can use that duration to calculate and set the :start time (with now being the :completion_time).