Skip to content

Commit

Permalink
HPCC-30470 Change4
Browse files Browse the repository at this point in the history
- Fix mac build issues
- Fix REAME issues

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Dec 4, 2023
1 parent e4ab937 commit 5f787f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions helm/examples/tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions system/jlib/jtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::chrono::nanoseconds>(span->GetStartTime().time_since_epoch()).count());
out.appendf(", \"duration\": %ld", std::chrono::duration_cast<std::chrono::nanoseconds>(span->GetDuration()).count());

if (hasMask(logFlags, SpanLogFlags::LogParentInfo))
{
Expand All @@ -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))
Expand Down Expand Up @@ -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<std::chrono::nanoseconds>(event.GetTimestamp().time_since_epoch()).count());
printAttributes(out, event.GetAttributes());
out.append(" }");
}
Expand Down

0 comments on commit 5f787f4

Please sign in to comment.