Skip to main content
Proper monitoring is essential for maintaining a healthy Gate proxy deployment. This guide covers health checks, metrics collection, logging, and alerting strategies.

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.
deployment.yaml
Probe configuration:
  • 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:
terraform
Google Cloud Load Balancer:
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 connections
  • gate.connections.total - Total connections since start
  • gate.connections.failed - Failed connection attempts
  • gate.connections.rate_limited - Connections blocked by rate limiting

Server Metrics

  • gate.servers.players - Players per backend server
  • gate.servers.connection_failures - Backend connection failures
  • gate.servers.latency - Backend server latency

Performance Metrics

  • gate.packets.received - Incoming packet count
  • gate.packets.sent - Outgoing packet count
  • gate.bandwidth.in - Incoming bandwidth usage
  • gate.bandwidth.out - Outgoing bandwidth usage

System Metrics

  • process.runtime.go.mem.heap_alloc - Memory usage
  • process.runtime.go.goroutines - Active goroutines
  • process.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

Use a log aggregator like Loki, Elasticsearch, or cloud provider logging.
fluent-bit-config.yaml

Important Log Messages

Monitor for these log patterns: Errors:
Warnings:
Info:

HTTP API Monitoring

Gate provides an optional HTTP API for monitoring and management.

Enable API

config.yml
Bind to localhost in production. If external access is needed, use a reverse proxy with authentication.

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
Access Jaeger UI at 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