Skip to content

Inconsistent event.timestamp behavior when using SENTRY_RELEASE in serverless environments #16318

Open
@lucas-devx

Description

@lucas-devx

Environment

  • Runtime: AWS Lambda
  • SDK: @sentry/node v8.2.0
  • Node.js: v18.x
  • Region: us-west-2

Problem

When using SENTRY_RELEASE in combination with manual captureException(), the event.timestamp is sometimes skewed by several seconds (occasionally even into the future).

This leads to misordered events in the Sentry UI timeline and impacts alerting thresholds.

Steps to Reproduce

  1. Deploy a Lambda with SENTRY_RELEASE set via env.
  2. Trigger manual captureException() during cold start.
  3. Observe event timestamps.

Expected Result

Accurate event.timestamp aligned with actual execution time.

Actual Result

Timestamp offset (e.g. future-dated by 2–4s).

Notes

Seems related to lazy initialization of release context in async environments. May benefit from await Sentry.flush() or lazy-load guards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions