Merge branch 'pratik/otel-phase1b-telemetry-infra' into pratik/otel-phase1c-rpc-integration

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2026-05-29 14:51:12 +01:00
10 changed files with 68 additions and 74 deletions

View File

@@ -2,7 +2,7 @@
/** Thread-local flag for span discard signaling.
SpanGuard::discard() sets tl_discardCurrentSpan to true before calling
SpanGuard::discard() sets gTlDiscardCurrentSpan to true before calling
Span::End(). The OTel SDK calls SpanProcessor::OnEnd() synchronously on
the same thread, so FilteringSpanProcessor checks and clears this flag
in OnEnd() to drop the span before it enters the batch export queue.
@@ -16,12 +16,10 @@
@see SpanGuard::discard(), FilteringSpanProcessor (Telemetry.cpp)
*/
namespace xrpl {
namespace telemetry {
namespace xrpl::telemetry {
/** When true, the FilteringSpanProcessor drops the current span in
OnEnd(). Set by SpanGuard::discard(), cleared by OnEnd(). */
inline thread_local bool tl_discardCurrentSpan = false;
inline thread_local bool gTlDiscardCurrentSpan = false;
} // namespace telemetry
} // namespace xrpl
} // namespace xrpl::telemetry

View File

@@ -4,7 +4,7 @@
Provides the Telemetry base class that all components use to create trace
spans. Three concrete implementations exist, selected at construction time
by make_Telemetry():
by makeTelemetry():
- TelemetryImpl (Telemetry.cpp): real OTel SDK integration, compiled
only when XRPL_ENABLE_TELEMETRY is defined and enabled at runtime.
@@ -111,7 +111,7 @@ class Telemetry
the initialization thread, factory methods load on worker threads.
@see setInstance(), getInstance()
*/
inline static std::atomic<Telemetry*> instance_{nullptr};
inline static std::atomic<Telemetry*> instance{nullptr};
public:
/** Get the global Telemetry instance.
@@ -120,7 +120,7 @@ public:
static Telemetry*
getInstance()
{
return instance_.load(std::memory_order_acquire);
return instance.load(std::memory_order_acquire);
}
/** Set the global Telemetry instance.
@@ -131,7 +131,7 @@ public:
static void
setInstance(Telemetry* t)
{
instance_.store(t, std::memory_order_release);
instance.store(t, std::memory_order_release);
}
/** Configuration parsed from the [telemetry] section of xrpld.cfg.
@@ -313,7 +313,7 @@ public:
@param journal Journal for log output during initialization.
*/
std::unique_ptr<Telemetry>
make_Telemetry(Telemetry::Setup const& setup, beast::Journal journal);
makeTelemetry(Telemetry::Setup const& setup, beast::Journal journal);
/** Parse the [telemetry] config section into a Setup struct.
@@ -325,7 +325,7 @@ make_Telemetry(Telemetry::Setup const& setup, beast::Journal journal);
@return A populated Setup struct with defaults for missing values.
*/
Telemetry::Setup
setup_Telemetry(
setupTelemetry(
Section const& section,
std::string const& nodePublicKey,
std::string const& version,