diff --git a/include/xrpl/telemetry/TraceContextPropagator.h b/include/xrpl/telemetry/TraceContextPropagator.h index b897541267..26c9651c00 100644 --- a/include/xrpl/telemetry/TraceContextPropagator.h +++ b/include/xrpl/telemetry/TraceContextPropagator.h @@ -43,15 +43,14 @@ extractFromProtobuf(protocol::TraceContext const& proto) auto const* rawTraceId = reinterpret_cast(proto.trace_id().data()); auto const* rawSpanId = reinterpret_cast(proto.span_id().data()); - trace::TraceId traceId(opentelemetry::nostd::span(rawTraceId, 16)); - trace::SpanId spanId(opentelemetry::nostd::span(rawSpanId, 8)); - // Default to not-sampled (0x00) per W3C Trace Context spec when - // the trace_flags field is absent. - trace::TraceFlags flags( + trace::TraceId const traceId( + opentelemetry::nostd::span(rawTraceId, 16)); + trace::SpanId const spanId(opentelemetry::nostd::span(rawSpanId, 8)); + trace::TraceFlags const flags( proto.has_trace_flags() ? static_cast(proto.trace_flags()) : static_cast(0)); - trace::SpanContext spanCtx(traceId, spanId, flags, /* remote = */ true); + trace::SpanContext const spanCtx(traceId, spanId, flags, /* remote = */ true); return opentelemetry::context::Context{}.SetValue( trace::kSpanKey, @@ -68,7 +67,7 @@ injectToProtobuf(opentelemetry::context::Context const& ctx, protocol::TraceCont { namespace trace = opentelemetry::trace; - auto span = trace::GetSpan(ctx); + auto const span = trace::GetSpan(ctx); if (!span) return;