Skip to content

Commit

Permalink
HPCC-30697 Track passthrough data as attributes
Browse files Browse the repository at this point in the history
- Creates new setContextAttributes function
- Utilizes new setContextAttributes

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Oct 31, 2023
1 parent e09fb04 commit 2fa1c36
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions system/jlib/jtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,23 @@ class CServerSpan : public CSpan
return success;
}

void setContextAttributes()
{
if (!isEmptyString(hpccGlobalId))
setSpanAttribute(kGlobalIdHttpHeaderName, hpccGlobalId.get());

if (!isEmptyString(hpccCallerId))
setSpanAttribute(kCallerIdHttpHeaderName, hpccCallerId.get());
}

public:
CServerSpan(const char * spanName, const char * tracerName_, const IProperties * httpHeaders, SpanFlags flags)
: CSpan(spanName, tracerName_)
{
opts.kind = opentelemetry::trace::SpanKind::kServer;
setSpanContext(httpHeaders, flags);
init();
setContextAttributes();
}

void toLog(StringBuffer & out) const override
Expand Down

0 comments on commit 2fa1c36

Please sign in to comment.