Skip to content

Commit

Permalink
moving trace_manager_ check to function call instead of inside StartT…
Browse files Browse the repository at this point in the history
…race
  • Loading branch information
KrishnanPrash committed Oct 1, 2024
1 parent b37dd97 commit 6786594
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/http_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3129,10 +3129,6 @@ HTTPAPIServer::StartTrace(
TRITONSERVER_InferenceTrace** triton_trace)
{
#ifdef TRITON_ENABLE_TRACING
if (trace_manager_ == nullptr) {
return nullptr;
}

HttpTextMapCarrier carrier(req->headers_in);
auto start_options =
trace_manager_->GetTraceStartOptions(carrier, model_name);
Expand Down Expand Up @@ -3242,8 +3238,11 @@ HTTPAPIServer::HandleGenerate(

// If tracing is enabled see if this request should be traced.
TRITONSERVER_InferenceTrace* triton_trace = nullptr;
std::shared_ptr<TraceManager::Trace> trace =
StartTrace(req, model_name, &triton_trace);
std::shared_ptr<TraceManager::Trace> trace;
if (trace_manager_) {
// If tracing is enabled see if this request should be traced.
trace = StartTrace(req, model_name, &triton_trace);
}

std::map<std::string, triton::common::TritonJson::Value> input_metadata;
triton::common::TritonJson::Value meta_data_root;
Expand Down

0 comments on commit 6786594

Please sign in to comment.