Monitoring & Diagnostics
AuthProxy provides comprehensive monitoring capabilities through OpenTelemetry integration and built-in health endpoints.
Telemetry Integration
OpenTelemetry
AuthProxy supports OpenTelemetry for distributed tracing and metrics:
{
"UptraceDsn": "https://TOKEN@api.uptrace.dev/PROJECT_ID",
"ServiceName": "AuthProxy",
"ServiceId": 10
}
Uptrace Dashboard
When configured, Uptrace provides:
- Request latency analysis
- Error rate tracking
- Dependency mapping
- Custom metrics
Health Endpoints
System Health
GET /health
Returns overall system status including:
- Database connectivity
- Memory usage
- Active sessions count
Detailed Info
GET /auth/v1/info
Returns:
- Version information
- Available authentication methods
- Server configuration (non-sensitive)
Key Metrics
Performance KPIs
| Metric | Description | Target |
|---|---|---|
| Latency (p50) | Median response time | < 50ms |
| Latency (p99) | 99th percentile | < 200ms |
| Error Rate | Failed requests percentage | < 0.1% |
| Throughput | Requests per second | 5000+ |
Authentication Metrics
| Metric | Description |
|---|---|
| Login Success Rate | Successful authentications / total attempts |
| Session Duration | Average active session time |
| Key Usage | Authentication method distribution |
| Failed Attempts | Blocked/failed login attempts |
Resource Metrics
| Metric | Description |
|---|---|
| CPU Usage | Processor utilization |
| Memory | RAM consumption |
| Connections | Active database connections |
| Cache Hit Rate | File cache effectiveness |
Logging
Structured Logging
All logs are output in JSON format for easy parsing:
{
"timestamp": "2024-01-15T10:30:00Z",
"level": "Information",
"message": "User authenticated",
"userId": "638412345678901234",
"method": "Fido2Key",
"ip": "203.0.113.10"
}
Log Levels
| Level | Usage |
|---|---|
| Debug | Detailed diagnostic information |
| Information | Normal operational events |
| Warning | Potential issues |
| Error | Failures requiring attention |
| Critical | System-level failures |
Authentication Logging
The authentication log captures user id, login method, client device details, source IP, and location enrichment. Operators normally review this data through the admin panel or connected observability stack rather than querying tables directly.
Alerting
Recommended Alerts
| Condition | Severity | Action |
|---|---|---|
| Error rate > 1% | Warning | Investigate logs |
| Latency p99 > 500ms | Warning | Check resources |
| Failed logins spike | High | Check for attack |
| Database connection failed | Critical | Immediate response |
| Memory > 90% | Warning | Scale or optimize |
Integration Options
- Email: SMTP notification support
- Webhooks: Custom HTTP callbacks
- Telegram: Bot notifications
- Uptrace: Built-in alerting
Troubleshooting
Common Issues
High Latency
- Check database query performance
- Verify cache hit rates
- Review active session count
Memory Growth
- Monitor file cache size
- Check for session leaks
- Review route configuration
Authentication Failures
- Verify key configuration
- Check FIDO2 origin settings
- Review rate limiting thresholds
Debug Mode
Enable detailed logging in development:
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Warning"
}
}
}