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.sh
More file actions
68 lines (59 loc) · 1.94 KB
/
Copy pathinstall-tracing.sh
File metadata and controls
68 lines (59 loc) · 1.94 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
#!/bin/bash
# Distributed Tracing Installation Script
# This script installs OpenTelemetry dependencies and sets up the development environment
echo "🚀 Installing OpenTelemetry Distributed Tracing..."
echo ""
# Install npm dependencies
echo "📦 Installing npm packages..."
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install npm packages"
exit 1
fi
echo "✅ npm packages installed successfully"
echo ""
# Check if .env exists
if [ ! -f .env ]; then
echo "📝 Creating .env file from .env.example..."
cp .env.example .env
echo "✅ .env file created"
echo ""
echo "⚠️ Please configure the following variables in .env:"
echo " - OTEL_SERVICE_NAME=healthy-stellar-backend"
echo " - OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318/v1/traces"
echo " - OTEL_SAMPLING_RATE=1.0"
echo ""
else
echo "✅ .env file already exists"
echo ""
fi
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "⚠️ Docker is not running. Please start Docker to use Jaeger."
echo ""
else
echo "🐳 Starting Jaeger with Docker Compose..."
docker-compose -f docker-compose.dev.yml up -d jaeger
if [ $? -eq 0 ]; then
echo "✅ Jaeger started successfully"
echo ""
echo "📊 Jaeger UI available at: http://localhost:16686"
echo ""
else
echo "❌ Failed to start Jaeger"
echo ""
fi
fi
echo "✅ Distributed Tracing Installation Complete!"
echo ""
echo "📚 Next Steps:"
echo " 1. Configure .env with OTEL_* variables (if not already done)"
echo " 2. Start the application: npm run start:dev"
echo " 3. Make some API requests to generate traces"
echo " 4. View traces in Jaeger UI: http://localhost:16686"
echo ""
echo "📖 Documentation:"
echo " - Quick Start: docs/TRACING_QUICK_START.md"
echo " - Full Guide: docs/DISTRIBUTED_TRACING.md"
echo " - Implementation Summary: TRACING_IMPLEMENTATION.md"
echo ""