aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/gc.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-12-11 16:12:02 +0100
committerGitHub Enterprise <[email protected]>2025-12-11 16:12:02 +0100
commit567293ab1baa8cb0eca843977c520e5b8f400b4d (patch)
tree1f54f12d3fb19b91695bbfea33fa9abd8de49f69 /src/zenstore/gc.cpp
parent5.7.14 (diff)
downloadzen-567293ab1baa8cb0eca843977c520e5b8f400b4d.tar.xz
zen-567293ab1baa8cb0eca843977c520e5b8f400b4d.zip
add otel instrumentation (#581)
this change adds OTEL tracing to a few places * Top-level application lifecycle (config/init/cleanup, main loop) * http.sys requests it also brings some otlptrace optimizations and dynamic configuration of tracing. OTLP tracing is currently always disabled
Diffstat (limited to 'src/zenstore/gc.cpp')
-rw-r--r--src/zenstore/gc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index a4a141577..f5b1577c9 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -19,6 +19,7 @@
#include <zencore/workthreadpool.h>
#include <zenstore/cidstore.h>
#include <zenstore/scrubcontext.h>
+#include <zentelemetry/otlptrace.h>
#include <zenutil/workerpools.h>
#include "cas.h"
@@ -2746,6 +2747,8 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
const auto _ = MakeGuard([&] { ReclaimDiskReserve(); });
{
+ zen::otel::ScopedSpan GcSpan("CollectGarbage");
+
Stopwatch Timer;
const auto __ = MakeGuard([&] { ZEN_INFO("garbage collection DONE in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); });
@@ -2753,8 +2756,9 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
switch (UseGCVersion)
{
case GcVersion::kV1_Deprecated:
- ZEN_WARN("GCV1: Depreated - no GC will be executed");
+ ZEN_WARN("GCV1: Deprecated - no GC will be executed");
break;
+
case GcVersion::kV2:
{
std::string GcId = Oid::NewOid().ToString();