-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-32248 Add tracing to rowservice #19314
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1114,10 +1114,9 @@ class CRemoteRequest : public CSimpleInterfaceOf<IInterface> | |
const char* fullTraceContext = requestTree->queryProp("_trace/traceparent"); | ||
|
||
// We only want to compare the trace-id & span-id, so remove the last "sampling" group | ||
const char* traceParent = fullTraceContext ? fullTraceContext : ""; | ||
traceParent = strrchr(traceParent, '-'); | ||
|
||
if (strlen(traceParent) != 0 && requestTraceParent != traceParent) | ||
std::string traceParent = fullTraceContext; | ||
traceParent = traceParent.substr(0, traceParent.find_last_of('-')); | ||
if (!traceParent.empty() && requestTraceParent != traceParent) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: I am checking if the traceParent has changed every time process is called here because the client side may use multiple spans during the lifetime a single CRemoteRequest. See below screenshots for an example. |
||
{ | ||
// Check to see if we have an existing span that needs to be marked successful before close | ||
if (requestSpan != nullptr) | ||
ghalliday marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -1134,7 +1133,7 @@ class CRemoteRequest : public CSimpleInterfaceOf<IInterface> | |
else | ||
requestSpanName = "WriteRequest"; | ||
|
||
requestSpan.set(queryTraceManager().createServerSpan(requestSpanName, traceHeaders)); | ||
requestSpan.setown(queryTraceManager().createServerSpan(requestSpanName, traceHeaders)); | ||
requestTraceParent = traceParent; | ||
} | ||
|
||
|
@@ -5008,7 +5007,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface | |
Owned<IProperties> traceHeaders = createProperties(); | ||
traceHeaders->setProp("traceparent", traceParent); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this also have the sampling suffix removed? |
||
|
||
closeSpan.set(queryTraceManager().createServerSpan("CloseRequest", traceHeaders)); | ||
closeSpan.setown(queryTraceManager().createServerSpan("CloseRequest", traceHeaders)); | ||
} | ||
|
||
if (0 == cursorHandle) | ||
|
@@ -5053,7 +5052,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface | |
Owned<IProperties> traceHeaders = createProperties(); | ||
traceHeaders->setProp("traceparent", traceParent); | ||
|
||
versionSpan.set(queryTraceManager().createServerSpan("VersionRequest", traceHeaders)); | ||
versionSpan.setown(queryTraceManager().createServerSpan("VersionRequest", traceHeaders)); | ||
} | ||
|
||
if (outFmt_Binary == outputFormat) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-ve leak. Needs to be a getPropTree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, right, I need to pay more attention to query/get and set/setown, it is slightly unituitive to me for some reason. So, is the following correct: get* methods will increase the reference count, query* methods will not. Owned constructor does NOT increase reference count, set increases reference count while setown does not.