Skip to content

Commit

Permalink
HPCC-30687 Code review1
Browse files Browse the repository at this point in the history
- Defines otel attribute names for globalid, and callerid
- No unittest since no exporter available to test locally

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexisrisk.com>
  • Loading branch information
rpastrana committed Nov 9, 2023
1 parent 2fa1c36 commit 67acc6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/jlib/jtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,10 @@ class CServerSpan : public CSpan
void setContextAttributes()
{
if (!isEmptyString(hpccGlobalId))
setSpanAttribute(kGlobalIdHttpHeaderName, hpccGlobalId.get());
setSpanAttribute(kGlobalIdOtelAttributeName, hpccGlobalId.get());

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

public:
Expand Down
2 changes: 2 additions & 0 deletions system/jlib/jtrace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ static constexpr const char *kGlobalIdHttpHeaderName = "Global-Id";
static constexpr const char *kCallerIdHttpHeaderName = "Caller-Id";
static constexpr const char *kLegacyGlobalIdHttpHeaderName = "HPCC-Global-Id";
static constexpr const char *kLegacyCallerIdHttpHeaderName = "HPCC-Caller-Id";
static constexpr const char *kGlobalIdOtelAttributeName = "hpcc.globalid";
static constexpr const char *kCallerIdOtelAttributeName = "hpcc.callerid";

enum class SpanFlags : unsigned
{
Expand Down

0 comments on commit 67acc6f

Please sign in to comment.