Skip to content

Commit

Permalink
HPCC-29332 Interface cleanup
Browse files Browse the repository at this point in the history
- Provides simple clear interface definition
- Provides traceman init and query
- Migrate ALL OT imports to implementation
- Add appropriate interface methods
- Provides manual parent span injection
- Does not yet use LogTrace
- Does not yet defint helm/k8s schema

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Aug 26, 2023
1 parent ec8d04c commit 3a71c97
Show file tree
Hide file tree
Showing 4 changed files with 522 additions and 447 deletions.
23 changes: 13 additions & 10 deletions esp/bindings/http/platform/httpservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,19 @@ int CEspHttpServer::processRequest()
mockHTTPHeadersSA.append("HPCC-Caller-Id:IncomingCID");

//This span tracks processing of httprequest
//Owned<ISpan> reqProcessSpan = queryTraceManager("esp")->createTransactionSpan("ProcessingHTTPRequest", mockHTTPHeaders);
Owned<ISpan> reqProcessSpan = queryTraceManager("esp")->createTransactionSpan("ProcessingHTTPRequest", mockHTTPHeadersSA);
//Owned<ISpan> reqProcessSpan = queryTraceManager("esp")->createServerSpan("ProcessingHTTPRequest", mockHTTPHeaders);

reqProcessSpan->setAttribute("http.request_port", "8010");
reqProcessSpan->setAttribute("app.name", "esp");
reqProcessSpan->setAttribute("app.version", "1.0.0");
reqProcessSpan->setAttribute("app.instance", "esp1");
reqProcessSpan->setAttribute("http.method", m_request->queryMethod());
reqProcessSpan->setAttribute("http.url", m_request->queryPath());
reqProcessSpan->setAttribute("http.host", m_request->queryHost());
StringArray mockEmptyHTTPHeaders;
Owned<ISpan> rootSpan = queryTraceManager().createServerSpan("rootProcessingHTTPRequest", mockEmptyHTTPHeaders, nullptr);
Owned<ISpan> reqProcessSpan = queryTraceManager().createServerSpan("childProcessingHTTPRequest", mockHTTPHeadersSA, rootSpan.get());

reqProcessSpan->setSpanAttribute("http.request_port", "8010");
reqProcessSpan->setSpanAttribute("app.name", "esp");
reqProcessSpan->setSpanAttribute("app.version", "1.0.0");
reqProcessSpan->setSpanAttribute("app.instance", "esp1");
reqProcessSpan->setSpanAttribute("http.method", m_request->queryMethod());
reqProcessSpan->setSpanAttribute("http.url", m_request->queryPath());
reqProcessSpan->setSpanAttribute("http.host", m_request->queryHost());

IEspContext* ctx = m_request->queryContext();
StringBuffer errMessage;
Expand Down Expand Up @@ -270,7 +273,7 @@ int CEspHttpServer::processRequest()
m_request->updateContext();
ctx->setServiceName(serviceName.str());
ctx->setHTTPMethod(method.str());
reqProcessSpan->setAttribute("http.method", method.str());
reqProcessSpan->setSpanAttribute("http.method", method.str());
ctx->setServiceMethod(methodName.str());
ctx->addTraceSummaryValue(LogMin, "app.protocol", method.str(), TXSUMMARY_GRP_ENTERPRISE);
ctx->addTraceSummaryValue(LogMin, "app.service", serviceName.str(), TXSUMMARY_GRP_ENTERPRISE);
Expand Down
5 changes: 1 addition & 4 deletions system/jlib/jptree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9068,10 +9068,7 @@ jlib_decl IPropertyTree * loadConfiguration(IPropertyTree *componentDefault, con
if (monitor)
configFileUpdater->startMonitoring();

DBGLOG("Initializing OpenTel based tracing for component: '%s'", componentTag);
//Owned<CTraceManager> tracer =
queryTraceManager(componentTag); //inits opentel singleton internals

initTraceManager(componentTag, componentConfiguration.get());
return componentConfiguration.getLink();
}

Expand Down
Loading

0 comments on commit 3a71c97

Please sign in to comment.