aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-08-22 16:24:37 +0200
committerGitHub Enterprise <[email protected]>2024-08-22 16:24:37 +0200
commit4e843f8ddcd36ad1510d514099a690053292cf7d (patch)
tree047f39008173b58161eed00c033b9e34cc0a4387 /src
parentseparate worker pools into burst/background to avoid background jobs blocking... (diff)
downloadzen-4e843f8ddcd36ad1510d514099a690053292cf7d.tar.xz
zen-4e843f8ddcd36ad1510d514099a690053292cf7d.zip
Add zenserver session id to Sentry context (#133)
Diffstat (limited to 'src')
-rw-r--r--src/zenhttp/httpclient.cpp4
-rw-r--r--src/zenserver/sentryintegration.cpp5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index 1874b34eb..7ac0028cc 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -558,9 +558,7 @@ HttpClient::HttpClient(std::string_view BaseUri, const HttpClientSettings& Conne
, m_ConnectionSettings(Connectionsettings)
, m_Impl(new Impl(m_Log))
{
- StringBuilder<32> SessionId;
- GetSessionId().ToString(SessionId);
- m_SessionId = SessionId;
+ m_SessionId = GetSessionIdString();
}
HttpClient::~HttpClient()
diff --git a/src/zenserver/sentryintegration.cpp b/src/zenserver/sentryintegration.cpp
index 255030b2b..a0225fb0a 100644
--- a/src/zenserver/sentryintegration.cpp
+++ b/src/zenserver/sentryintegration.cpp
@@ -4,6 +4,8 @@
#include <zencore/config.h>
#include <zencore/logging.h>
+#include <zencore/session.h>
+#include <zencore/uid.h>
#include <stdarg.h>
#include <stdio.h>
@@ -273,6 +275,9 @@ SentryIntegration::Initialize(std::string SentryDatabasePath,
sentry_value_set_by_key(SentryUserObject, "cmd", sentry_value_new_string(CommandLine.c_str()));
sentry_set_user(SentryUserObject);
+ sentry_value_set_by_key(SentryUserObject, "session", sentry_value_new_string(std::string(GetSessionIdString()).c_str()));
+ sentry_set_user(SentryUserObject);
+
m_SentryLogger = spdlog::create<sentry::sentry_sink>("sentry");
logging::SetErrorLog("sentry");