forked from Healthy-Stellar/Healthy-Stellar-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-tracing.ps1
More file actions
73 lines (64 loc) · 2.64 KB
/
Copy pathinstall-tracing.ps1
File metadata and controls
73 lines (64 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Distributed Tracing Installation Script (PowerShell)
# This script installs OpenTelemetry dependencies and sets up the development environment
Write-Host "🚀 Installing OpenTelemetry Distributed Tracing..." -ForegroundColor Cyan
Write-Host ""
# Install npm dependencies
Write-Host "📦 Installing npm packages..." -ForegroundColor Yellow
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Failed to install npm packages" -ForegroundColor Red
exit 1
}
Write-Host "✅ npm packages installed successfully" -ForegroundColor Green
Write-Host ""
# Check if .env exists
if (-not (Test-Path .env)) {
Write-Host "📝 Creating .env file from .env.example..." -ForegroundColor Yellow
Copy-Item .env.example .env
Write-Host "✅ .env file created" -ForegroundColor Green
Write-Host ""
Write-Host "⚠️ Please configure the following variables in .env:" -ForegroundColor Yellow
Write-Host " - OTEL_SERVICE_NAME=healthy-stellar-backend"
Write-Host " - OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318/v1/traces"
Write-Host " - OTEL_SAMPLING_RATE=1.0"
Write-Host ""
} else {
Write-Host "✅ .env file already exists" -ForegroundColor Green
Write-Host ""
}
# Check if Docker is running
try {
docker info | Out-Null
$dockerRunning = $true
} catch {
$dockerRunning = $false
}
if (-not $dockerRunning) {
Write-Host "⚠️ Docker is not running. Please start Docker to use Jaeger." -ForegroundColor Yellow
Write-Host ""
} else {
Write-Host "🐳 Starting Jaeger with Docker Compose..." -ForegroundColor Yellow
docker-compose -f docker-compose.dev.yml up -d jaeger
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Jaeger started successfully" -ForegroundColor Green
Write-Host ""
Write-Host "📊 Jaeger UI available at: http://localhost:16686" -ForegroundColor Cyan
Write-Host ""
} else {
Write-Host "❌ Failed to start Jaeger" -ForegroundColor Red
Write-Host ""
}
}
Write-Host "✅ Distributed Tracing Installation Complete!" -ForegroundColor Green
Write-Host ""
Write-Host "📚 Next Steps:" -ForegroundColor Cyan
Write-Host " 1. Configure .env with OTEL_* variables (if not already done)"
Write-Host " 2. Start the application: npm run start:dev"
Write-Host " 3. Make some API requests to generate traces"
Write-Host " 4. View traces in Jaeger UI: http://localhost:16686"
Write-Host ""
Write-Host "📖 Documentation:" -ForegroundColor Cyan
Write-Host " - Quick Start: docs/TRACING_QUICK_START.md"
Write-Host " - Full Guide: docs/DISTRIBUTED_TRACING.md"
Write-Host " - Implementation Summary: TRACING_IMPLEMENTATION.md"
Write-Host ""