From 5f787f429a2c21230f4e945852aa2b424ac1ef53 Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Mon, 4 Dec 2023 12:25:44 -0500 Subject: [PATCH] HPCC-30470 Change4 - Fix mac build issues - Fix REAME issues Signed-off-by: Rodrigo Pastrana --- helm/examples/tracing/README.md | 4 ++-- system/jlib/jtrace.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/helm/examples/tracing/README.md b/helm/examples/tracing/README.md index 271c637be55..e525663ce8c 100644 --- a/helm/examples/tracing/README.md +++ b/helm/examples/tracing/README.md @@ -14,8 +14,8 @@ All configuration options detailed here are part of the HPCC Systems Helm chart, - logSpanStart - If true, generate a log entry whenever a span is started (default: false) - logSpanFinish - If true, generate a log entry whenever a span is finished (default: false) - exporter - Defines The type of exporter in charge of forwarding span data to target back-end - - type - (defalt: NONE) "OTLP-HTTP" | "OTLP-GRCP" | "OS" | "JLog" | "NONE" - - JLog + - type - (defalt: NONE) "OTLP-HTTP" | "OTLP-GRCP" | "OS" | "JLOG" | "NONE" + - JLOG - logSpanDetails - Log span details such as description, status, kind - logParentInfo - Log the span's parent info such as ParentSpanId, and TraceState - logAttributes - Log the span's attributes diff --git a/system/jlib/jtrace.cpp b/system/jlib/jtrace.cpp index fafa8f3ba5e..a9324121941 100644 --- a/system/jlib/jtrace.cpp +++ b/system/jlib/jtrace.cpp @@ -202,8 +202,8 @@ class JLogSpanExporter final : public opentelemetry::sdk::trace::SpanExporter out.setf("{ \"name\": \"%s\"", span->GetName().data()); out.append(", \"trace_id\": \"").append(32, traceID).append("\""); out.append(", \"span_id\": \"").append(16, spanID).append("\""); - out.appendf(", \"start\": %ld", span->GetStartTime().time_since_epoch().count()); - out.appendf(", \"duration\": %ld", span->GetDuration().count()); + out.appendf(", \"start\": %ld", std::chrono::duration_cast(span->GetStartTime().time_since_epoch()).count()); + out.appendf(", \"duration\": %ld", std::chrono::duration_cast(span->GetDuration()).count()); if (hasMask(logFlags, SpanLogFlags::LogParentInfo)) { @@ -214,9 +214,7 @@ class JLogSpanExporter final : public opentelemetry::sdk::trace::SpanExporter out.append(", \"parent_span_id\": \"").append(16, parentSpanID).append("\""); } - const char * traceState = span->GetSpanContext().trace_state()->ToHeader().c_str(); - if (!isEmptyString(traceState)) - out.appendf(", \"trace_state\": \"%s\"", traceState); + out.appendf(", \"trace_state\": \"%s\"", span->GetSpanContext().trace_state()->ToHeader().c_str()); } if (hasMask(logFlags, SpanLogFlags::LogSpanDetails)) @@ -313,7 +311,7 @@ class JLogSpanExporter final : public opentelemetry::sdk::trace::SpanExporter first = false; out.append("{ \"name\": \"").append(event.GetName().data()).append("\""); - out.appendf(", \"time_stamp\": %ld", event.GetTimestamp().time_since_epoch().count()); + out.appendf(", \"time_stamp\": %ld", std::chrono::duration_cast(event.GetTimestamp().time_since_epoch()).count()); printAttributes(out, event.GetAttributes()); out.append(" }"); }