Metrics Collection
Gate exposes operational metrics through OpenTelemetry, providing insights into proxy performance, player connections, and server health. Metrics can be exported to Prometheus, Grafana Cloud, or any OpenTelemetry-compatible backend.Enabling Metrics
Metrics collection is disabled by default. Enable it using theOTEL_METRICS_ENABLED environment variable:
Available Metrics
Gate exposes the following metrics (defined inpkg/edition/java/proxy/otel_meter.go:17):
Proxy Metrics
gate.player_count
- Type: Gauge (Int64)
- Description: Current total player count on the proxy
- Unit:
1(players) - Labels: Automatically includes
service.name,service.version
gate.registered_servers
- Type: Gauge (Int64)
- Description: Current total registered servers on the proxy
- Unit:
1(servers) - Labels: Automatically includes
service.name,service.version
Runtime Metrics
Gate automatically includes Go runtime metrics through the OpenTelemetry SDK:process.runtime.go.mem.heap_alloc- Heap memory allocatedprocess.runtime.go.mem.heap_inuse- Heap memory in useprocess.runtime.go.gc.count- Number of garbage collectionsprocess.runtime.go.gc.pause_ns- GC pause timeprocess.runtime.go.goroutines- Number of goroutines
Host Metrics
When using thehoneycombio/otel-config-go library, Gate includes host-level metrics:
- CPU usage -
system.cpu.utilization - Memory usage -
system.memory.usage,system.memory.utilization - Network I/O -
system.network.io - Disk I/O -
system.disk.io
Metric Export Formats
OTLP (Recommended)
Export metrics using OpenTelemetry Protocol to a collector or backend:Prometheus Remote Write
The OpenTelemetry Collector can convert OTLP metrics to Prometheus format:Prometheus Integration
Setup with OpenTelemetry Collector
- Configure Gate to send metrics to the collector:
- Configure the collector to export to Prometheus:
- Enable Prometheus remote write receiver:
Metric Name Translation
When metrics are exported to Prometheus:- OpenTelemetry
service.name→ Prometheusjoblabel - OpenTelemetry
service.instance.id→ Prometheusinstancelabel - Metric names keep their original format (e.g.,
gate.player_count)
Grafana Dashboards
Basic Player Monitoring
Advanced Proxy Metrics
Configuration Examples
Local Development
Production with Grafana Cloud
Self-Hosted Stack
Docker Compose Example
Alerting Rules
Example Prometheus alerting rules for Gate:Custom Metrics
To add custom metrics in your Gate plugins or extensions:Troubleshooting
Metrics Not Appearing
-
Verify metrics are enabled:
-
Check the metrics endpoint:
-
Review OpenTelemetry Collector logs:
High Cardinality Issues
- Avoid adding high-cardinality labels (e.g., player UUIDs, timestamps)
- Use resource attributes for static metadata
- Consider sampling for high-volume metrics
Performance Impact
- Metrics collection has minimal overhead (less than 1% CPU)
- Adjust
OTEL_EXPORTER_OTLP_METRICS_PERIODto balance freshness vs. load - Use batching in the OpenTelemetry Collector
Next Steps
Tracing
Set up distributed tracing for request flows
Logging
Configure structured logging and log aggregation

