getsentry / getsentry/sentry-dotnet

Batch session updates in a single envelope

Open
#1,221 0 comments 0 reactions 0 assignees View on GitHub
.NET Feature Product: Release Health
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

When a session ends due to a timeout (on `ResumeSessions`), two session updates out of as a result.
These two could be added to the same envelope and avoid 1 request to Sentry.

```
09-28 18:41:14.155 14814 14850 I Unity : Sentry: (Debug) Resuming session.
09-28 18:41:14.156 14814 14850 I Unity : Sentry: (Debug) Paused session has been paused for 00:06:03.6522460, which is longer than the configured timeout. Starting a new session instead of resuming this one.
09-28 18:41:14.157 14814 14850 I Unity : Sentry: (Info) Ended session (SID: 09fdd5b6626148c583f5254383b9b365; DID: 474bc867-1fe0-492f-8ee7-0eaaec51dafd) with status 'Exited'.
09-28 18:41:14.158 14814 14850 I Unity : Sentry: (Debug) Deleting persisted session file with contents: {"update":{"sid":"09fdd5b6626148c583f5254383b9b365","did":"474bc867-1fe0-492f-8ee7-0eaaec51dafd","init":false,"started":"2021-09-28T18:34:09.301737-04:00","timestamp":"2021-09-28T22:35:10.503792+00:00","seq":1,"duration":61,"errors":0,"attrs":{"release":"unity-of-bugs@0.1","environment":"production"}},"paused":"2021-09-28T22:35:10.503792+00:00"}
09-28 18:41:14.159 14814 14850 I Unity : Sentry: (Info) Deleted persisted session file '/storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/.session'.
09-28 18:41:14.160 14814 14850 I Unity : Sentry: (Info) Started new session (SID: b201103a35e240778850daf9f3e78c91; DID: 474bc867-1fe0-492f-8ee7-0eaaec51dafd).
09-28 18:41:14.160 14814 14850 I Unity : Sentry: (Debug) Persisting session (SID: 'b201103a35e240778850daf9f3e78c91') to a file.
09-28 18:41:14.160 14814 14850 I Unity : Sentry: (Debug) Created persistence directory for session file '/storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406'.
09-28 18:41:14.163 14814 14850 I Unity : Sentry: (Debug) Persisted session to a file '/storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/.session'.
09-28 18:41:14.164 14814 14850 I Unity : Sentry: (Info) Envelope queued up: ''
09-28 18:41:14.164 14814 14850 I Unity : Sentry: (Info) Envelope queued up: ''
09-28 18:41:14.179 14814 15070 I Unity : Sentry: (Debug) Storing file /storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/1632868874_8725__-1630256374.envelope.
09-28 18:41:14.183 14814 15070 I Unity : Sentry: (Debug) Envelope handed off to transport. #2 in queue.
09-28 18:41:14.190 14814 15071 I Unity : Sentry: (Debug) Storing file /storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/1632868874_-1942__876252862.envelope.
09-28 18:41:14.191 14814 15074 I Unity : Sentry: (Debug) Worker signal triggered: flushing cached envelopes.
09-28 18:41:14.194 14814 15071 I Unity : Sentry: (Debug) Envelope handed off to transport. #1 in queue.
09-28 18:41:14.200 14814 15072 I Unity : Sentry: (Debug) Reading cached envelope: /storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/__processing/1632868874_-1942__876252862.envelope
09-28 18:41:14.216 14814 15071 I Unity : Sentry: (Debug) Sending cached envelope:
09-28 18:41:14.501 14814 15074 I Unity : Sentry: (Debug) Envelope '' sent successfully. Payload:
09-28 18:41:14.501 14814 15074 I Unity : {"sdk":{"name":"Sentry","version":"3.9.3"}}
09-28 18:41:14.501 14814 15074 I Unity : {"type":"session","length":290}
09-28 18:41:14.501 14814 15074 I Unity : {"sid":"b201103a35e240778850daf9f3e78c91","did":"474bc867-1fe0-492f-8ee7-0eaaec51dafd","init":true,"started":"2021-09-28T18:41:14.159581-04:00","timestamp":"2021-09-28T22:41:14.160051+00:00","seq":0,"duration":0,"errors":0,"attrs":{"release":"unity-of-bugs@0.1","environment":"production"}}
09-28 18:41:14.501 14814 15074 I Unity :
09-28 18:41:14.501 14814 15074 I Unity : Sentry: (Debug) Successfully sent cached envelope:
09-28 18:41:14.505 14814 15074 I Unity : Sentry: (Debug) Reading cached envelope: /storage/emulated/0/Android/data/io.sentry.samples.unityofbugs/files/Sentry/618762E37120B6E01219C43B9076FFEC1ACE8406/__processing/1632868874_8725__-1630256374.envelope
09-28 18:41:14.520 14814 15074 I Unity : Sentry: (Debug) Sending cached envelope:
09-28 18:41:14.571 14814 15073 I Unity : Sentry: (Debug) Envelope '' sent successfully. Payload:
09-28 18:41:14.571 14814 15073 I Unity : {"sdk":{"name":"Sentry","version":"3.9.3"}}
09-28 18:41:14.571 14814 15073 I Unity : {"type":"session","length":310}
09-28 18:41:14.571 14814 15073 I Unity : {"sid":"09fdd5b6626148c583f5254383b9b365","did":"474bc867-1fe0-492f-8ee7-0eaaec51dafd","init":false,"started":"2021-09-28T18:34:09.301737-04:00","timestamp":"2021-09-28T22:35:10.503792+00:00","seq":2,"duration":61,"errors":0,"status":"exited","attrs":{"release":"unity-of-bugs@0.1","environment":"production"}}
09-28 18:41:14.571 14814 15073 I Unity :
09-28 18:41:14.571 14814 15073 I Unity : Sentry: (Debug) Successfully sent cached envelope:
09-28 18:41:14.573 14814 15073 I Unity : Sentry: (Debug) No cached file to process.
09-28 18:41:14.573 14814 15073 I Unity : Sentry: (Debug) Worker signal triggered: flushing cached envelopes.
09-28 18:41:14.573 14814 15073 I Unity : Sentry: (Debug) No cached file to process.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.