Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lucas-devx opened this issue May 16, 2025 · 1 comment
Labels

Comments

@lucas-devx
Copy link

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.

@getsantry
Copy link

getsantry bot commented May 16, 2025

Assigning to @getsentry/support for routing ⏲️

@getsantry getsantry bot moved this to Waiting for: Support in GitHub Issues with 👀 3 May 16, 2025
@cobyeastwood183 cobyeastwood183 transferred this issue from getsentry/sentry May 16, 2025
@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 May 16, 2025
@cobyeastwood183 cobyeastwood183 added the Package: node Issues related to the Sentry Node SDK label May 16, 2025
@cobyeastwood183 cobyeastwood183 added Node.js and removed Package: node Issues related to the Sentry Node SDK labels May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants