- Real-time Monitoring: Live updates via WebSocket
- OpenTelemetry OTLP Support: Direct telemetry receiver for real-time traces from Traefik
- Hybrid Data Sources: Support both log file parsing and OTLP traces
- IP Geolocation: Track requests by country and city with MaxMind GeoIP2 support
- Comprehensive Analytics: Request rates, response times, status codes, error monitoring
- Modern UI: Built with Shadcn UI components and real-time charts
- Advanced Filtering: Hide unknown services, private IPs, with pagination support
- IPv6 Support: Proper handling of IPv6 addresses
- Multiple Log Sources: Monitor multiple Traefik instances simultaneously
- Containerized: Easy deployment with Docker Compose
# Clone repository
git clone https://github.com/hhftechnology/traefik-log-dashboard.git
cd traefik-log-dashboard
# Configure for OTLP
cp .env.example .env
# Edit .env: Set OTLP_ENABLED=true
# Start with OTLP support
docker compose -f docker-compose-otlp.yml up -d
# Access dashboard
open http://localhost:3000
# Configure for log files
cp .env.example .env
# Edit .env: Set TRAEFIK_LOG_PATH=/path/to/logs
# Start with standard setup
docker compose up -d
# Enable both data sources
# .env: OTLP_ENABLED=true AND TRAEFIK_LOG_PATH=/path/to/logs
docker compose -f docker-compose-otlp.yml up -d
traefik-log-dashboard/
├── README.md
├── .env.example # Environment configuration template
├── docker-compose.yml # Standard deployment (log files)
├── docker-compose-otlp.yml # Enhanced deployment with OTLP
├── traefik-otlp-config.yaml # Traefik configuration with OTLP
├── backend/
│ ├── Dockerfile
│ ├── main.go
│ ├── logParser.go
│ ├── otlp.go # OpenTelemetry receiver
│ ├── websocket.go
│ ├── geoLocation.go
│ └── fileWatcher.go
├── frontend/
│ ├── Dockerfile
│ ├── src/
│ │ ├── components/
│ │ │ ├── Dashboard.tsx
│ │ │ ├── LogTable.tsx
│ │ │ ├── StatsCards.tsx
│ │ │ └── GeoMap.tsx
│ │ └── hooks/
│ │ └── useWebSocket.tsx
└── scripts/
└── dashboard-preview images
# Traefik Log Files (optional if using OTLP only)
TRAEFIK_LOG_PATH=/path/to/traefik/logs
# OpenTelemetry Configuration
OTLP_ENABLED=true
OTLP_GRPC_PORT=4317
OTLP_HTTP_PORT=4318
# Basic Settings
PORT=3001
FRONTEND_PORT=3000
# MaxMind GeoIP (optional but recommended)
USE_MAXMIND=true
MAXMIND_DB_PATH=/maxmind/GeoLite2-City.mmdb
MAXMIND_FALLBACK_ONLINE=true
# Performance Tuning
GOGC=50
GOMEMLIMIT=500MiB
Create traefik.yml
with OpenTelemetry support:
# traefik.yml
api:
dashboard: true
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
providers:
docker:
exposedByDefault: false
# OpenTelemetry Tracing
tracing:
otlp:
http:
endpoint: "http://dashboard-backend:4318/v1/traces"
# Alternative: GRPC for better performance
# grpc:
# endpoint: "dashboard-backend:4317"
# insecure: true
sampleRate: 1.0 # Adjust for production (0.1 = 10%)
# Traditional JSON logging (optional alongside OTLP)
accessLog:
filePath: "/logs/access.log"
format: json
# Full tracing with debug logs
docker compose -f docker-compose-otlp.yml -f docker-compose.dev.yml up -d
# Optimized with reduced sampling
docker compose -f docker-compose-otlp.yml -f docker-compose.prod.yml up -d
# Start with sample applications
docker compose -f docker-compose-otlp.yml --profile testing up -d
# Generate test traffic
curl -H "Host: app.localhost" http://localhost/
-
Get MaxMind License Key
- Sign up at https://www.maxmind.com/en/geolite2/signup
- Generate a license key
-
Download Database
# Set your license key export MAXMIND_LICENSE_KEY=your_license_key_here # Download database make maxmind-download
-
Configure
USE_MAXMIND=true MAXMIND_DB_PATH=/maxmind/GeoLite2-City.mmdb
GET /api/otlp/status
- Check OTLP receiver statusPOST /api/otlp/start
- Start OTLP receiverPOST /api/otlp/stop
- Stop OTLP receiver
GET /api/stats
- Get aggregated statisticsGET /api/logs
- Get paginated logs with filtersGET /api/geo-stats
- Geographic statisticsWebSocket /ws
- Real-time log streaming
GET /health
- Application health status
- Check OTLP status:
curl http://localhost:3001/api/otlp/status
- Verify Traefik configuration points to correct endpoint
- Ensure sampling rate > 0 in Traefik config
- Check network connectivity between containers
- Verify log file path in
.env
- Ensure Traefik outputs JSON format
- Check container logs:
docker compose logs backend
- Reduce sampling rate in Traefik:
sampleRate: 0.1
- Use GRPC instead of HTTP for OTLP
- Optimize backend settings:
MAX_LOGS_IN_MEMORY=5000 GOGC=20
- Check firewall settings
- Verify proxy supports WebSocket connections
- Review nginx configuration in frontend container
# Backend
cd backend
go run *.go
# Frontend
cd frontend
npm install && npm run dev
Development: Full tracing, debug logs
docker compose -f docker-compose-otlp.yml -f docker-compose.dev.yml up
Production: Optimized performance, reduced sampling
docker compose -f docker-compose-otlp.yml -f docker-compose.prod.yml up -d
- High Traffic: Use GRPC OTLP endpoint and reduce sampling rate
- Memory Usage: Limit logs in memory with
MAX_LOGS_IN_MEMORY
- GeoIP: Use MaxMind offline database for better performance
- WebSocket: Monitor connection count and implement rate limiting
- Production: Disable API dashboard and use HTTPS
- Network: Use internal Docker networks for OTLP endpoints
- Privacy: Set
MAXMIND_FALLBACK_ONLINE=false
to prevent external calls - Sampling: Use low sampling rates for sensitive applications
┌─────────────────┐ OTLP ┌─────────────────┐ WebSocket ┌──────────────┐
│ Traefik │──────────▶ │ Dashboard │ ──────────────▶ │ Frontend │
│ (Traces) │ HTTP/GRPC │ Backend │ Real-time │ (React) │
└─────────────────┘ │ (Go) │ └──────────────┘
│ │
┌─────────────────┐ Files │ ┌─────────────┤
│ Log Files │──────────▶ │ │ OTLP │
│ (Optional) │ Parsing │ │ Receiver │
└─────────────────┘ │ │ │
│ └─────────────┤
┌─────────────────┐ Cache │ │
│ MaxMind │◀───────────▶│ Log Parser │
│ (GeoIP) │ Lookup │ (Unified) │
└─────────────────┘ └────────────────┘
For issues or questions:
- Check troubleshooting section
- Review logs:
docker compose logs -f
- Test endpoints manually
- Open GitHub issue with logs and configuration
MIT License - See LICENSE file for details.
- Fork the repository
- Create feature branch
- Make changes with tests
- Submit pull request