Merge branch 'pratik/otel-phase6-statsd' into pratik/otel-phase7-native-metrics

# Conflicts:
#	src/test/csf/Peer.h
This commit is contained in:
Pratik Mankawde
2026-07-20 15:28:38 +01:00
6 changed files with 92 additions and 29 deletions

View File

@@ -170,6 +170,10 @@
#include <string_view>
#include <utility>
namespace protocol {
class TraceContext;
} // namespace protocol
namespace xrpl::telemetry {
/**
@@ -436,6 +440,20 @@ public:
[[nodiscard]] TraceBytes
getTraceBytes() const;
/**
* Inject the calling thread's currently-active OTel context into a
* protobuf TraceContext message for cross-node propagation.
*
* Encapsulates `RuntimeContext::GetCurrent()` + `injectToProtobuf`
* so callers in app-layer code (e.g. RCLConsensus broadcasting
* TMProposeSet / TMValidation) don't depend on any OTel headers.
* No-op if telemetry is disabled or no span is active.
*
* @param proto The protobuf TraceContext to populate.
*/
static void
injectCurrentContextToProtobuf(protocol::TraceContext& proto);
// --- Attribute setters (explicit overloads, no OTel types) ---------
/**
@@ -613,6 +631,11 @@ public:
{
return {};
}
static void
injectCurrentContextToProtobuf(protocol::TraceContext&)
{
}
// NOLINTEND(readability-convert-member-functions-to-static)
void