Skip to content

Commit

Permalink
Added request id to span attributes (#6667)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandreeva-nv authored Dec 6, 2023
1 parent 4ac7f37 commit 817428a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,20 @@ TraceManager::Trace::StartSpan(

if (activity == TRITONSERVER_TRACE_REQUEST_START) {
int64_t model_version;
const char* request_id;
LOG_TRITONSERVER_ERROR(
TRITONSERVER_InferenceTraceModelVersion(trace, &model_version),
"getting model version");
LOG_TRITONSERVER_ERROR(
TRITONSERVER_InferenceTraceRequestId(trace, &request_id),
"getting request id");
span->SetAttribute("triton.model_name", model_name);
span->SetAttribute("triton.model_version", model_version);
span->SetAttribute("triton.trace_id", trace_id);
span->SetAttribute("triton.trace_parent_id", parent_id);
if (std::string(request_id) != "") {
span->SetAttribute("triton.request_id", request_id);
}
}

otel_context_ = otel_context_.SetValue(span_key, span);
Expand Down

0 comments on commit 817428a

Please sign in to comment.