Health Checks
Gate provides a gRPC health service for Kubernetes liveness/readiness probes and load balancer health checks.Enabling Health Service
1
Configure health service
Enable the gRPC health service in your configuration.
config.yml
The health service uses the gRPC health probe protocol standard.
2
Kubernetes probes
Configure liveness and readiness probes in your deployment.Probe configuration:
deployment.yaml
- Liveness: Restarts pod if Gate becomes unresponsive
- Readiness: Removes pod from load balancer if not ready
- initialDelaySeconds: Wait time before first probe
- periodSeconds: How often to perform the probe
- failureThreshold: Consecutive failures before action
3
Load balancer health checks
Configure your load balancer to use the health endpoint.AWS Application Load Balancer:Google Cloud Load Balancer:
terraform
4
Manual health check
Test health endpoint manually using grpc_health_probe.
Metrics & Telemetry
Gate integrates with OpenTelemetry for comprehensive metrics and distributed tracing.OpenTelemetry Configuration
1
Enable OpenTelemetry
Configure Gate to export telemetry data.
docker-compose.yml
2
Deploy OpenTelemetry Collector
Set up a collector to receive and process telemetry.
otel-collector-config.yaml
3
Add to Docker Compose
Include the collector in your stack.
docker-compose.yml
Key Metrics to Monitor
Gate exports various metrics through OpenTelemetry:Connection Metrics
gate.connections.active- Current active player connectionsgate.connections.total- Total connections since startgate.connections.failed- Failed connection attemptsgate.connections.rate_limited- Connections blocked by rate limiting
Server Metrics
gate.servers.players- Players per backend servergate.servers.connection_failures- Backend connection failuresgate.servers.latency- Backend server latency
Performance Metrics
gate.packets.received- Incoming packet countgate.packets.sent- Outgoing packet countgate.bandwidth.in- Incoming bandwidth usagegate.bandwidth.out- Outgoing bandwidth usage
System Metrics
process.runtime.go.mem.heap_alloc- Memory usageprocess.runtime.go.goroutines- Active goroutinesprocess.cpu.utilization- CPU usage percentage
Prometheus Configuration
prometheus.yml
Grafana Dashboards
Create dashboards to visualize Gate metrics:grafana/dashboards/gate-overview.json
Logging
Gate outputs structured logs that can be collected and analyzed.Log Configuration
config.yml
Log Collection
- Kubernetes
- Docker
Use a log aggregator like Loki, Elasticsearch, or cloud provider logging.
fluent-bit-config.yaml
Important Log Messages
Monitor for these log patterns: Errors:HTTP API Monitoring
Gate provides an optional HTTP API for monitoring and management.Enable API
config.yml
API Endpoints
The Gate API uses gRPC with Connect protocol, accessible via HTTP:Secure API Access
Use nginx as a reverse proxy with authentication:nginx.conf
Alerting
Set up alerts for critical conditions.Prometheus Alerts
alerts.yml
Alert Manager Configuration
alertmanager.yml
Distributed Tracing
Use tracing to debug performance issues and understand request flow.View Traces in Jaeger
docker-compose.yml
http://localhost:16686 to:
- View player connection traces
- Analyze backend server latency
- Debug timeout issues
- Identify bottlenecks
Monitoring Checklist
Ensure you have:- Health checks configured (port 9090)
- OpenTelemetry enabled and exporting
- Prometheus scraping metrics
- Grafana dashboards created
- Log aggregation configured
- Alerts defined for critical conditions
- Alert routing to appropriate channels
- On-call rotation established
- Runbooks created for common issues
- Regular review of metrics and logs
Troubleshooting
Health check failing
No metrics appearing
High memory usage
Next Steps
Production Checklist
Complete pre-deployment verification
Configuration Reference
Explore all configuration options

