aboutsummaryrefslogtreecommitdiff
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
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)
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenhttp/httpclient.cpp4
-rw-r--r--src/zenserver/sentryintegration.cpp5
3 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1addb5f1e..781b2fc03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- Improvement: If a zenserver instance is already using our named mutex - exit with error code instead of reporting error to Sentry
- Improvement: Gracefully handle scenarios where sponsor processes running status can not be checked
- Improvement: Split worker pools into "burst" and "background" to prevent background job from starving client requests that uses thread pools
+- Improvement: Add zenserver session id to Sentry context
- Bugfix: If we fail to get information on a cache chunk for a partial chunk request - treat it as a cache miss
- Bugfix: Set last GC time when we skip GC due to low disk space to avoid spam-running GC
- Bugfix: Make sure we lock project and verify directory exists before trying to iterate to find oplogs
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");