Skip to content
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

Use sent_at instead of sentry_timestamp to reduce clock skew #1690

Merged
merged 18 commits into from Jul 22, 2022

Conversation

SimonCropp
Copy link
Contributor

fixes #1687

@SimonCropp
Copy link
Contributor Author

does it need to also be deserialized and exposed as a member?

@mattjohnsonpint
Copy link
Contributor

What happens when caching is enabled? Does sent_at still get set when the event is being sent? Or does it happen when the event is written to disk?

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jan-auer is this field new? Should we add this everywhere we have disk caching? I believe we don't have this on Java and cocoa either.

@SimonCropp
Copy link
Contributor Author

@mattjohnsonpint @bruno-garcia review please

@mattjohnsonpint
Copy link
Contributor

Sorry, but I still have doubts about this. If we are adding it, it should be as late as possible, but we already have that on the headers. See discussion on #1687. Thanks.

@SimonCropp
Copy link
Contributor Author

@mattjohnsonpint yep i took that discussion into account. but on re-evaluating the code, this PR will result in the sent_at being added at the point EnvelopeHttpContent does SerializeToStreamAsync.

@bruno-garcia
Copy link
Member

Turned into draft

@mattjohnsonpint
Copy link
Contributor

Investigation results: sentry_timestamp was removed from Sentry and Relay quite a long time ago, and was not used for clock skew correction anyway. After discussion with the TSC, we will just remove it from the dev docs, and it can optionally be removed from all SDKs. Several have already removed it long ago.

sent_at is the way to go, and should be added as close as possible to the event being sent. I think there may be a better way to do that here. I'll take a look.

@mattjohnsonpint mattjohnsonpint self-assigned this Jul 13, 2022
@mattjohnsonpint mattjohnsonpint changed the title add sent_at to event Use sent_at instead of sentry_timestamp to reduce clock skew Jul 21, 2022
@mattjohnsonpint
Copy link
Contributor

FYI, sent_at is supposed to be in the envelope header, not the payload. It also applies to several other envelope types, so I'm just going to always add it to the envelope header. Update coming to this PR shortly.

@mattjohnsonpint mattjohnsonpint marked this pull request as ready for review July 21, 2022 23:38
* add mock clock

* Update MockClock.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing parameter sent_at to the envelope header
3 participants