Skip to content
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-31570 SoapCall to propagate client span headers #18522

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions common/thorhelper/thorsoapcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ interface IWSCAsyncFor: public IInterface
virtual void processException(const Url &url, ConstPointerArray &inputRows, IException *e) = 0;
virtual void checkTimeLimitExceeded(unsigned * _remainingMS) = 0;

virtual void createHttpRequest(Url &url, StringBuffer &request) = 0;
virtual void createHttpRequest(StringBuffer &request, const Url &url, const IProperties * traceHeaders) = 0;
virtual int readHttpResponse(StringBuffer &response, ISocket *socket, bool &keepAlive, StringBuffer &contentType) = 0;
virtual void processResponse(Url &url, StringBuffer &response, ColumnProvider * meta, const char *contentType) = 0;

Expand Down Expand Up @@ -1958,7 +1958,7 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
}
}

void createHttpRequest(Url &url, StringBuffer &request)
void createHttpRequest(StringBuffer &request, const Url &url, const IProperties * traceHeaders)
{
// Create the HTTP POST request
if (master->wscType == STsoap)
Expand Down Expand Up @@ -1992,7 +1992,6 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
if (!httpHeaderBlockContainsHeader(httpheaders, ACCEPT_ENCODING))
request.appendf("%s: gzip, deflate\r\n", ACCEPT_ENCODING);
#endif
Owned<IProperties> traceHeaders = ::getClientHeaders(master->activitySpanScope);
if (traceHeaders)
{
Owned<IPropertyIterator> iter = traceHeaders->getIterator();
Expand Down Expand Up @@ -2454,7 +2453,6 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
unsigned retryInterval = 0;

Url &url = master->urlArray.item(idx);
createHttpRequest(url, request);
unsigned startidx = idx;
while (!master->aborted)
{
Expand Down Expand Up @@ -2563,6 +2561,10 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo
checkRoxieAbortMonitor(master->roxieAbortMonitor);
OwnedSpanScope socketOperationSpan = master->activitySpanScope->createClientSpan("Socket Write");
setSpanURLAttributes(socketOperationSpan, url);

Owned<IProperties> traceHeaders = ::getClientHeaders(socketOperationSpan);
createHttpRequest(request, url, traceHeaders);

socket->write(request.str(), request.length());

if (soapTraceLevel > 4)
Expand Down
Loading