Skip to content

Span start and end timestamps recorded in the past after system wakes from sleep (Ubuntu 20.04 & 24.04) #3091

@shaunak-10

Description

@shaunak-10

Describe the bug

Span timestamps are being recorded incorrectly after the laptop resumes from sleep. Specifically, both the span start time and span end time are shifted into the past — close to the time when the laptop lid was closed. After a full system restart, the issue disappears and timestamps are correct again.

Environment

  • OS: Ubuntu 20.04
  • Go Version: 1.22.0
  • Version: opentelemetry-go-instrumentation 0.22.1

To Reproduce

  1. Open the laptop and generate any trace (timestamps are correct at this point).
  2. Close the laptop lid and let the system enter sleep mode.
  3. Resume the system the next morning (or after several hours).
  4. Generate another trace immediately after waking the system.
  5. Observe that the span start/end timestamps are near the time the laptop went to sleep, instead of the current time.
  6. Restart the system.
  7. Generate another trace and see that timestamps are now correct.

Expected behavior

Span start and end times should reflect the real current system time when the trace is generated, regardless of whether the system recently resumed from sleep.

Actual behaviour

After waking from sleep, spans are assigned timestamps far in the past, typically close to the moment when the system entered sleep mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions