Skip to content

Commit

Permalink
Include the query set name in the roxie server span
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Dec 13, 2023
1 parent 749673f commit 7349b29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions roxie/ccd/ccdlistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ class RoxieProtocolMsgContext : implements IHpccProtocolMsgContext, public CInte
return *cascade;
}

virtual void startSpan(const char * id, const char * queryName, const IProperties * headers) override
virtual void startSpan(const char * id, const char * querySetName, const char * queryName, const IProperties * headers) override
{
Linked<const IProperties> allHeaders = headers;
SpanFlags flags = (ensureGlobalIdExists) ? SpanFlags::EnsureGlobalId : SpanFlags::None;
Expand All @@ -1456,7 +1456,11 @@ class RoxieProtocolMsgContext : implements IHpccProtocolMsgContext, public CInte

ensureContextLogger();

const char * spanName = !isEmptyString(queryName) ? queryName : "run_query";
const char * spanQueryName = !isEmptyString(queryName) ? queryName : "run_query";
StringBuffer spanName(querySetName);
if (spanName.length())
spanName.append('/');
spanName.append(spanQueryName);
Owned<ISpan> requestSpan = queryTraceManager().createServerSpan(spanName, allHeaders, flags);
//The span has a lifetime the same length as the logctx, so no need to restore it at the end of the query
logctx->setActiveSpan(requestSpan);
Expand Down
2 changes: 1 addition & 1 deletion roxie/ccd/ccdprotocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ class RoxieSocketWorker : public ProtocolQueryWorker
uid = NULL;
sanitizeQuery(queryPT, queryName, sanitizedText, httpHelper, uid, isBlind, isDebug);

msgctx->startSpan(uid, queryName, httpHelper.queryRequestHeaders());
msgctx->startSpan(uid, querySetName, queryName, httpHelper.queryRequestHeaders());

if (!uid)
uid = "-";
Expand Down
2 changes: 1 addition & 1 deletion roxie/ccd/hpccprotocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface IHpccProtocolMsgContext : extends IInterface
virtual bool getIntercept() = 0;
virtual void outputLogXML(IXmlStreamFlusher &out) = 0;
virtual void writeLogXML(IXmlWriter &writer) = 0;
virtual void startSpan(const char * uid, const char * queryName, const IProperties * headers) = 0;
virtual void startSpan(const char * uid, const char * querySetName, const char * queryName, const IProperties * headers) = 0;
};

interface IHpccProtocolResultsWriter : extends IInterface
Expand Down

0 comments on commit 7349b29

Please sign in to comment.