Skip to content

Commit

Permalink
Update session span start time per new clock (#48)
Browse files Browse the repository at this point in the history
## Goal

This services uses an OpenTelemetry-compatible clock now, so `now()` returns in nano seconds. Make sure interpret it as such. 

## Testing

Existing tests pass
  • Loading branch information
bidetofevil authored Nov 7, 2023
2 parents 143544f + 912279b commit 978a47a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ internal class SpansServiceImpl(
synchronized(completedSpans) {
if (appTerminationCause == null) {
currentSessionSpan.get().endSpan()
currentSessionSpan.set(startSessionSpan(TimeUnit.MILLISECONDS.toNanos(clock.now())))
currentSessionSpan.set(startSessionSpan(clock.now()))
} else {
currentSessionSpan.get()?.let {
it.setAttribute(appTerminationCause.keyName(), appTerminationCause.name)
Expand Down

0 comments on commit 978a47a

Please sign in to comment.