-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlog_setup.sh
More file actions
executable file
·68 lines (52 loc) · 1.63 KB
/
log_setup.sh
File metadata and controls
executable file
·68 lines (52 loc) · 1.63 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
echo "🔧 Fixed OpenTelemetry Setup"
# Stop existing services
echo "🛑 Stopping existing services..."
docker-compose down -v
echo "🚀 Starting fixed observability stack..."
docker-compose up -d
echo "⏳ Waiting for services to start..."
sleep 5
echo "🧪 Testing Collector Config..."
# Check if collector started without errors
if docker-compose logs otel-collector | grep -q "Everything is ready"; then
echo "✅ Collector started successfully"
elif docker-compose logs otel-collector | grep -q "Error:"; then
echo "❌ Collector has errors:"
docker-compose logs --tail=10 otel-collector
exit 1
else
echo "⏳ Collector is starting..."
sleep 3
fi
echo ""
echo "🔍 Testing endpoints..."
# Test collector
if curl -s -f -X POST -H "Content-Type: application/json" -d '{}' http://localhost:4318/v1/logs > /dev/null 2>&1; then
echo "✅ Collector HTTP endpoint is working"
else
echo "⚠️ Collector endpoint test failed, but it might still work"
fi
# Test other services
services=(
"http://localhost:3000:Grafana"
"http://localhost:3100/ready:Loki"
)
for service in "${services[@]}"; do
url="${service%:*}"
name="${service#*:}"
if curl -s -f "$url" > /dev/null 2>&1; then
echo "✅ $name is ready"
else
echo "⏳ $name is starting..."
fi
done
echo "🌐 Access UIs:"
echo " - Grafana: http://localhost:3000 (admin/admin)"
echo ""
echo "📝 View logs in Grafana:"
echo " 1. Go to Explore → Select Loki"
echo " 2. Query: {job=\"duva\"}"
echo ""
echo "🛑 To stop everything:"
echo " docker-compose down && pkill -f multi-process-logging"