Add client session id
This commit is contained in:
1 parent
8eb300a1a0
commit
b9d9b8f8ca
2 files changed
+8
-10
No files matched your search
@@ -21,7 +21,7 @@ namespace Sentry
|
|||||||
payload += `{"type":"event"}` + `\n`
|
payload += `{"type":"event"}` + `\n`
|
||||||
|
|
||||||
if StringUtils.IsNullOrEmpty(event.event_id)
|
if StringUtils.IsNullOrEmpty(event.event_id)
|
||||||
event.event_id = GenerateEventId()
|
event.event_id = m.deviceInfo.GetRandomUUID().Replace("-", "")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if StringUtils.IsNullOrEmpty(event.timestamp)
|
if StringUtils.IsNullOrEmpty(event.timestamp)
|
||||||
@@ -116,15 +116,6 @@ namespace Sentry
|
|||||||
return 0
|
return 0
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GenerateEventId() as string
|
|
||||||
hexChars = "0123456789abcdef"
|
|
||||||
eventId = ""
|
|
||||||
for i = 0 to 31
|
|
||||||
eventId = eventId + hexChars.Mid(rnd(16) - 1, 1)
|
|
||||||
end for
|
|
||||||
return eventId
|
|
||||||
end function
|
|
||||||
|
|
||||||
function GetFingerprint(message as dynamic) as dynamic
|
function GetFingerprint(message as dynamic) as dynamic
|
||||||
if StringUtils.IsNullOrEmpty(message)
|
if StringUtils.IsNullOrEmpty(message)
|
||||||
return invalid
|
return invalid
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function Init() as void
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function OnNodeReady() as void
|
function OnNodeReady() as void
|
||||||
|
m.deviceInfo = CreateObject("roDeviceInfo")
|
||||||
m.tags = GetTags()
|
m.tags = GetTags()
|
||||||
m.release = GetRelease(m.tags)
|
m.release = GetRelease(m.tags)
|
||||||
m.dist = GetDist(m.tags)
|
m.dist = GetDist(m.tags)
|
||||||
@@ -160,6 +161,12 @@ function GetTags() as object
|
|||||||
tags[key] = ToString(tags[key])
|
tags[key] = ToString(tags[key])
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
' A session ID in this case acts as single trace ID for all events sent during a single app session
|
||||||
|
' For example, to understand why a requested hit a 403, it could be explained by a previous
|
||||||
|
' refresh token failure event that happened earlier in the same session
|
||||||
|
tags["session_id"] = m.deviceInfo.GetRandomUUID()
|
||||||
|
|
||||||
return tags
|
return tags
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user