Skip to content

Commit 3d876e0

Browse files
yossiovadiaclaude
andcommitted
feat(openshift): add Jaeger distributed tracing integration
Add comprehensive distributed tracing support for OpenShift demos: - Add Jaeger all-in-one deployment manifest - Add deployment script with configuration instructions - Add toggle script to enable/disable tracing easily - Update DEMO-README.md with tracing documentation - Add DEMO-URLS.md quick reference for all demo URLs The tracing integration uses OpenTelemetry with OTLP exporters and provides end-to-end visibility into request flows including: - Request ingress through Envoy - ExtProc classification pipeline - Security checks (jailbreak, PII) - Category classification - Model routing decisions - Cache hits/misses - Per-span latency breakdown This leverages the tracing capabilities added in PR vllm-project#434. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Yossi Ovadia <[email protected]>
1 parent 9c0fc2b commit 3d876e0

File tree

5 files changed

+525
-13
lines changed

5 files changed

+525
-13
lines changed

deploy/openshift/demo/DEMO-README.md

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ python3 deploy/openshift/demo/demo-semantic-router.py
3535

3636
**Features:**
3737

38-
1. **Single Classification** - Tests random prompt from golden set
38+
1. **Single Classification** - Tests cache with same prompt (fast repeated runs)
3939
2. **All Classifications** - Tests all 10 golden prompts
40-
3. **PII Detection Test** - Tests personal information filtering
41-
4. **Jailbreak Detection Test** - Tests security filtering
42-
5. **Run All Tests** - Executes all tests sequentially
40+
3. **Reasoning Showcase** - Chain-of-Thought vs Standard routing
41+
4. **PII Detection Test** - Tests personal information filtering
42+
5. **Jailbreak Detection Test** - Tests security filtering
43+
6. **Run All Tests** - Executes all tests sequentially
4344

4445
**Requirements:**
4546

@@ -55,6 +56,55 @@ python3 deploy/openshift/demo/demo-semantic-router.py
5556

5657
---
5758

59+
### 3. Distributed Tracing with Jaeger
60+
61+
Visualize the complete request flow with distributed tracing:
62+
63+
#### Deploy Jaeger
64+
65+
```bash
66+
./deploy/openshift/demo/deploy-jaeger.sh
67+
```
68+
69+
This deploys Jaeger all-in-one with:
70+
71+
- 📊 **Jaeger UI** for visualizing traces
72+
- 🔗 **OTLP collector** (gRPC and HTTP)
73+
- 💾 **In-memory storage** (demo-friendly)
74+
75+
#### Enable/Disable Tracing
76+
77+
```bash
78+
# Enable tracing
79+
./deploy/openshift/demo/toggle-tracing.sh enable
80+
81+
# Disable tracing
82+
./deploy/openshift/demo/toggle-tracing.sh disable
83+
84+
# Check status
85+
./deploy/openshift/demo/toggle-tracing.sh status
86+
```
87+
88+
#### What You'll See in Jaeger
89+
90+
After enabling tracing and running some requests:
91+
92+
1. Open Jaeger UI (URL shown by toggle-tracing.sh status)
93+
2. Select service: **vllm-semantic-router**
94+
3. Click **Find Traces**
95+
4. Click on a trace to see:
96+
- 📥 Request ingress through Envoy
97+
- 🔄 ExtProc classification pipeline
98+
- 🛡️ Security checks (jailbreak, PII)
99+
- 🎯 Category classification
100+
- 🧭 Model routing decisions
101+
- 💾 Cache hits/misses
102+
- ⏱️ End-to-end latency breakdown
103+
104+
**Tip:** Run some requests with `./deploy/openshift/demo/curl-examples.sh all` to generate multiple traces!
105+
106+
---
107+
58108
## Demo Flow Suggestion
59109

60110
### Setup (Before Demo)
@@ -67,41 +117,57 @@ python3 deploy/openshift/demo/demo-semantic-router.py
67117
# (don't run yet)
68118

69119
# Browser Tab 1: Open Grafana
70-
# http://grafana-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com
120+
# http://grafana-vllm-semantic-router-system.apps.cluster-xxx.opentlc.com
71121

72-
# Browser Tab 2: Open OpenWebUI
73-
# http://openwebui-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com
122+
# Browser Tab 2: Open Jaeger (if tracing enabled)
123+
# http://jaeger-vllm-semantic-router-system.apps.cluster-xxx.opentlc.com
124+
125+
# Browser Tab 3: Open Flow Visualization
126+
# http://flow-visualization-vllm-semantic-router-system.apps.cluster-xxx.opentlc.com
127+
128+
# Browser Tab 4: Open OpenWebUI
129+
# http://openwebui-vllm-semantic-router-system.apps.cluster-xxx.opentlc.com
74130
```
75131

76132
### During Demo
77133

78134
1. **Show the system overview**
135+
- Open Flow Visualization (Browser Tab 3)
136+
- Click "Start Animation" to show request flow
79137
- Explain semantic routing concept
80-
- Show the architecture diagram
81138

82139
2. **Run interactive demo** (Terminal 2)
83140

84141
```bash
85142
python3 deploy/openshift/demo/demo-semantic-router.py
86143
```
87144

88-
Choose option 2 (All Classifications)
145+
- Choose option 3 (Reasoning Showcase) to demonstrate CoT
146+
- Then option 2 (All Classifications)
89147

90148
3. **Point to live logs** (Terminal 1)
91149
- Show real-time classification
92150
- Highlight security checks (jailbreak: BENIGN)
93151
- Show routing decisions (Model-A vs Model-B)
94-
- Point out cache hits
152+
- Point out cache hits and reasoning mode activation
95153

96154
4. **Switch to Grafana** (Browser Tab 1)
97155
- Show request metrics appearing
98156
- Show classification category distribution
99157
- Show model usage breakdown
100158

101-
5. **Show OpenWebUI integration** (Browser Tab 2)
159+
5. **Show Jaeger traces** (Browser Tab 2) - *Optional but impressive!*
160+
- Select service: vllm-semantic-router
161+
- Click "Find Traces"
162+
- Click on a trace to show:
163+
- Full request flow timeline
164+
- Security checks, classification, routing
165+
- Latency breakdown per step
166+
167+
6. **Show OpenWebUI integration** (Browser Tab 4)
102168
- Type one of the golden prompts
103169
- Watch it appear in logs (Terminal 1)
104-
- Show the same routing happening
170+
- Check the trace in Jaeger (Browser Tab 2)
105171

106172
---
107173

@@ -135,7 +201,16 @@ python3 deploy/openshift/demo/demo-semantic-router.py
135201

136202
- Real-time logs with structured JSON
137203
- Grafana metrics and dashboards
138-
- Request tracing and debugging
204+
- **Distributed tracing** with Jaeger (OpenTelemetry)
205+
- End-to-end request flow visualization
206+
- Per-span latency breakdown
207+
208+
### Reasoning Capabilities
209+
210+
- **Chain-of-Thought (CoT)** for complex problems
211+
- Enabled for math, chemistry, physics
212+
- Standard routing for factual queries
213+
- Automatic reasoning mode detection
139214

140215
---
141216

@@ -231,6 +306,8 @@ Restarts semantic-router deployment to clear in-memory cache (~30 seconds).
231306
- `cache-management.sh` - Cache management helper
232307
- `flow-visualization.html` - **Interactive flow visualization** (open in browser)
233308
- `deploy-flow-viz.sh` - Deploy flow visualization to OpenShift
309+
- `deploy-jaeger.sh` - Deploy Jaeger distributed tracing
310+
- `toggle-tracing.sh` - Enable/disable tracing in semantic-router
234311
- `CATEGORY-MODEL-MAPPING.md` - Category to model routing reference
235312
- `demo-classification-results.json` - Test results (auto-generated)
236313

deploy/openshift/demo/DEMO-URLS.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Demo URLs - Quick Reference
2+
3+
**Last Updated:** 2025-10-16
4+
5+
## Quick Access Links
6+
7+
Copy and paste these URLs to access all demo components:
8+
9+
### Core Services
10+
11+
- **Envoy Gateway (HTTP):**
12+
`http://envoy-http-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
13+
14+
- **Semantic Router API:**
15+
`http://semantic-router-api-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
16+
17+
### Observability & Monitoring
18+
19+
- **Grafana Dashboard:**
20+
`https://grafana-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
21+
22+
- **Jaeger Tracing UI:**
23+
`https://jaeger-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
24+
25+
- **Envoy Admin:**
26+
`https://envoy-admin-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
27+
28+
### Demo Visualizations
29+
30+
- **Flow Visualization (Interactive):**
31+
`https://flow-visualization-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
32+
33+
- **OpenWebUI:**
34+
`http://openwebui-vllm-semantic-router-system.apps.cluster-pbd96.pbd96.sandbox5333.opentlc.com`
35+
36+
---
37+
38+
## Quick Commands
39+
40+
### Get All URLs Dynamically
41+
42+
```bash
43+
# List all routes
44+
oc get routes -n vllm-semantic-router-system
45+
46+
# Get specific URL
47+
oc get route jaeger -n vllm-semantic-router-system -o jsonpath='{.spec.host}'
48+
```
49+
50+
### Check Tracing Status
51+
52+
```bash
53+
./deploy/openshift/demo/toggle-tracing.sh status
54+
```
55+
56+
### Run Quick Test
57+
58+
```bash
59+
# Test all 10 golden prompts
60+
./deploy/openshift/demo/curl-examples.sh all
61+
62+
# Or run interactive demo
63+
python3 deploy/openshift/demo/demo-semantic-router.py
64+
```
65+
66+
---
67+
68+
## Pre-Demo Checklist
69+
70+
- [ ] All pods running: `oc get pods -n vllm-semantic-router-system`
71+
- [ ] Tracing enabled: `./deploy/openshift/demo/toggle-tracing.sh status`
72+
- [ ] Grafana accessible and showing data
73+
- [ ] Jaeger UI accessible (if tracing enabled)
74+
- [ ] Flow visualization deployed and accessible
75+
- [ ] Terminal 1 ready with log viewer
76+
- [ ] Terminal 2 ready with demo script
77+
- [ ] Browser tabs open for all observability tools
78+
79+
---
80+
81+
## Notes
82+
83+
- URLs are specific to your OpenShift cluster
84+
- Use `oc login` before running demo scripts
85+
- All scripts automatically discover routes dynamically
86+
- See [DEMO-README.md](DEMO-README.md) for detailed demo flow
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/bin/bash
2+
#
3+
# Deploy Jaeger Tracing to OpenShift
4+
#
5+
# This script deploys Jaeger all-in-one for distributed tracing visualization
6+
# and updates the semantic-router configuration to enable tracing.
7+
#
8+
9+
set -e
10+
11+
# Colors
12+
GREEN='\033[0;32m'
13+
CYAN='\033[0;36m'
14+
YELLOW='\033[1;33m'
15+
RED='\033[0;31m'
16+
BOLD='\033[1m'
17+
NC='\033[0m'
18+
19+
NAMESPACE="vllm-semantic-router-system"
20+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21+
22+
echo -e "${CYAN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
23+
echo -e "${CYAN}${BOLD} Deploying Jaeger Distributed Tracing${NC}"
24+
echo -e "${CYAN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
25+
26+
# Check if logged into OpenShift
27+
if ! oc whoami &>/dev/null; then
28+
echo -e "${RED}Error: Not logged into OpenShift${NC}"
29+
echo -e "${YELLOW}Please run: oc login${NC}"
30+
exit 1
31+
fi
32+
33+
# Deploy Jaeger
34+
echo -e "${CYAN}📊 Deploying Jaeger all-in-one...${NC}"
35+
oc apply -f "${SCRIPT_DIR}/../observability/jaeger-deployment.yaml" -n "$NAMESPACE"
36+
37+
# Wait for Jaeger to be ready
38+
echo -e "${CYAN}⏳ Waiting for Jaeger to be ready...${NC}"
39+
oc rollout status deployment/jaeger -n "$NAMESPACE" --timeout=90s
40+
41+
# Get Jaeger URL
42+
JAEGER_URL=$(oc get route jaeger -n "$NAMESPACE" -o jsonpath='{.spec.host}' 2>/dev/null)
43+
44+
if [ -z "$JAEGER_URL" ]; then
45+
echo -e "${RED}Warning: Could not retrieve Jaeger route${NC}"
46+
exit 1
47+
fi
48+
49+
echo -e "\n${GREEN}✅ Jaeger deployed successfully!${NC}\n"
50+
51+
# Check current tracing status
52+
CURRENT_CONFIG=$(oc get configmap semantic-router-config -n "$NAMESPACE" -o jsonpath='{.data.config\.yaml}' 2>/dev/null | grep -A 1 "tracing:" | grep "enabled:" | awk '{print $2}' || echo "false")
53+
54+
if [ "$CURRENT_CONFIG" = "true" ]; then
55+
echo -e "${GREEN}✓ Tracing is already enabled in config${NC}\n"
56+
else
57+
echo -e "${YELLOW}⚠️ Tracing is currently disabled in semantic-router config${NC}"
58+
echo -e "${YELLOW} To enable tracing, update the ConfigMap:${NC}\n"
59+
cat << EOF
60+
${CYAN}# Edit the ConfigMap:${NC}
61+
oc edit configmap semantic-router-config -n ${NAMESPACE}
62+
63+
${CYAN}# Change observability.tracing.enabled to true:${NC}
64+
observability:
65+
tracing:
66+
enabled: true # Change from false to true
67+
provider: "opentelemetry"
68+
exporter:
69+
type: "otlp"
70+
endpoint: "jaeger:4317" # Jaeger OTLP gRPC endpoint
71+
insecure: true
72+
sampling:
73+
type: "always_on"
74+
resource:
75+
service_name: "vllm-semantic-router"
76+
service_version: "v0.1.0"
77+
deployment_environment: "openshift-demo"
78+
79+
${CYAN}# Then restart semantic-router to apply changes:${NC}
80+
oc rollout restart deployment/semantic-router -n ${NAMESPACE}
81+
EOF
82+
echo ""
83+
fi
84+
85+
# Display URLs
86+
echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
87+
echo -e "${GREEN}${BOLD} Jaeger Tracing URLs${NC}"
88+
echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
89+
90+
echo -e "${CYAN}🔍 Jaeger UI:${NC}"
91+
echo -e " ${BOLD}https://${JAEGER_URL}${NC}\n"
92+
93+
echo -e "${YELLOW}💡 How to use for your demo:${NC}"
94+
echo -e " 1. Enable tracing in semantic-router config (see above)"
95+
echo -e " 2. Run some requests through the semantic router"
96+
echo -e " 3. Open Jaeger UI and select 'vllm-semantic-router' service"
97+
echo -e " 4. Click 'Find Traces' to see request flows"
98+
echo -e " 5. Click on a trace to see the detailed span timeline\n"
99+
100+
echo -e "${CYAN}📋 What you'll see in traces:${NC}"
101+
echo -e " • Request ingress through Envoy"
102+
echo -e " • ExtProc classification pipeline"
103+
echo -e " • Security checks (jailbreak, PII)"
104+
echo -e " • Category classification"
105+
echo -e " • Model routing decisions"
106+
echo -e " • Cache hits/misses"
107+
echo -e " • End-to-end latency breakdown\n"
108+
109+
echo -e "${GREEN}${BOLD}Ready for your demo! 🎉${NC}\n"

0 commit comments

Comments
 (0)