Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit 1746050

Browse files
committed
add more spans
Signed-off-by: sallyom <somalley@redhat.com>
1 parent 898b30e commit 1746050

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

internal/proxy/chat_completions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ var (
3232
)
3333

3434
func (s *Server) chatCompletionsHandler(w http.ResponseWriter, r *http.Request) {
35-
tracer := otel.GetTracerProvider().Tracer("llm-d-routing")
35+
tracer := otel.GetTracerProvider().Tracer("llm-d-routing-sidecar")
3636
ctx, span := tracer.Start(r.Context(), "routing_proxy.request")
3737
defer span.End()
3838

3939
// Add component attribute to distinguish this part of the system
4040
span.SetAttributes(
4141
attribute.String("component", "llm-d-routing-sidecar"),
4242
attribute.String("operation", "route_request"),
43+
attribute.String("llm_d.proxy.connector", s.config.Connector),
4344
)
4445

4546
prefillPodHostPort := r.Header.Get(requestHeaderPrefillHostPort)

internal/proxy/connector_nixlv2.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,23 @@ import (
2323
"strings"
2424

2525
"github.com/google/uuid"
26+
"go.opentelemetry.io/otel"
27+
"go.opentelemetry.io/otel/attribute"
2628
)
2729

2830
func (s *Server) runNIXLProtocolV2(w http.ResponseWriter, r *http.Request, prefillPodHostPort string) {
31+
// Create span for NIXL V2 protocol execution
32+
tracer := otel.GetTracerProvider().Tracer("llm-d-routing-sidecar")
33+
ctx, span := tracer.Start(r.Context(), "routing_proxy.nixl_v2_protocol")
34+
defer span.End()
35+
36+
span.SetAttributes(
37+
attribute.String("component", "llm-d-routing-sidecar"),
38+
attribute.String("operation", "nixl_v2_disaggregation"),
39+
attribute.String("llm_d.proxy.connector", "nixlv2"),
40+
attribute.String("llm_d.prefill.target_host", prefillPodHostPort),
41+
)
42+
2943
s.logger.V(4).Info("running NIXL protocol V2", "url", prefillPodHostPort)
3044

3145
// Read request body
@@ -57,6 +71,12 @@ func (s *Server) runNIXLProtocolV2(w http.ResponseWriter, r *http.Request, prefi
5771
uuidStr := uuid.String()
5872

5973
// Prefill Stage
74+
_, prefillSpan := tracer.Start(ctx, "routing_proxy.nixl_v2_prefill")
75+
prefillSpan.SetAttributes(
76+
attribute.String("component", "llm-d-routing-sidecar"),
77+
attribute.String("operation", "nixl_v2_prefill_stage"),
78+
attribute.String("llm_d.nixl.stage", "prefill"),
79+
)
6080

6181
// 1. Prepare prefill request
6282
preq := r.Clone(r.Context())

0 commit comments

Comments
 (0)