-
Notifications
You must be signed in to change notification settings - Fork 1
Prometheus & Grafana Setup
This guide walks you through setting up metrics collection for VelocityNavigator using Prometheus to gather real-time data and Grafana to visualize it on a beautiful, interactive dashboard.
flowchart LR
VN["Velocity Proxy\n(VelocityNavigator)"] -- Exposes /metrics --> Prom["Prometheus Server\n(Time Series Database)"]
Prom -- Queries --> Graf["Grafana Dashboard\n(Visualization)"]
Admin["Admin Browser"] -- Views Panels --> Graf
- VelocityNavigator exposes statistics (active players, server states, circuit breaker statuses, connection rates) in a format Prometheus understands.
- Prometheus visits your proxy periodically to collect these statistics.
- Grafana reads from Prometheus to generate visual charts and timelines.
Open your navigator.toml file and look for the [metrics] block. Configure it as follows:
[metrics]
enabled = true
[metrics.prometheus]
enabled = true
bind_host = "0.0.0.0" # Use 0.0.0.0 to listen on all interfaces
port = 9225 # Choose a free port (e.g. 9225 or 30042)
bearer_token = "" # Optional: add a token to protect metrics (e.g. "my-secret-token")Important
Pterodactyl & Game Panel Users: Docker container environments block non-allocated ports. To use the Prometheus exporter, you must:
- Request an extra Port Allocation (e.g.,
25582) in your panel under the Network tab. - Set
port = 25582in yournavigator.tomlto match that exact allocated port.
After updating the config, restart your proxy or reload the config using /vn reload.
If you are running your own Prometheus instance (either on the same VPS, docker host, or a central metrics server), add your Velocity proxy as a scrape target in your prometheus.yml configuration:
scrape_configs:
- job_name: 'velocity_navigator'
scrape_interval: 5s # Scraping frequency
metrics_path: '/metrics' # Default path
static_configs:
- targets: ['<PROXY_IP>:<METRICS_PORT>'] # E.g., '13.126.225.90:9225'If you set a bearer_token in your navigator.toml, you must tell Prometheus to pass that token when scraping:
scrape_configs:
- job_name: 'velocity_navigator'
scrape_interval: 5s
metrics_path: '/metrics'
authorization:
credentials: 'your-secret-token' # Replace with your actual bearer_token
static_configs:
- targets: ['<PROXY_IP>:<METRICS_PORT>']Restart Prometheus to apply the configuration.
- Open your Grafana dashboard in your browser (usually
http://<vps-ip>:3000). - Navigate to Connections -> Data Sources -> Add data source.
- Select Prometheus.
- In the Connection settings, enter your Prometheus server URL (e.g.
http://localhost:9090). - Scroll to the bottom and click Save & test.
Run this command on your Velocity proxy console to generate the pre-built dashboard JSON configuration file:
vn setup grafana
This will write a file named grafana-dashboard.json into your plugins/VelocityNavigator folder.
- Download
grafana-dashboard.jsonfrom your proxy server files to your computer. - In the Grafana web panel, click Dashboards in the left menu.
- Click the New dropdown button in the top right and select Import.
- Click Upload JSON file and select the
grafana-dashboard.jsonfile (or paste the JSON from the Troubleshooting Guide in the raw text box). - Select your Prometheus data source at the bottom and click Import.
Here are the key metrics you can use to build custom charts:
| Metric Name | Type | Description |
|---|---|---|
velocitynavigator_player_joins_total |
Counter | Total player connection attempts to the proxy. |
velocitynavigator_player_leaves_total |
Counter | Total player disconnects. |
velocitynavigator_server_online |
Gauge | Online state of tracked backend servers (1 = Online, 0 = Offline). |
velocitynavigator_server_players |
Gauge | Player count currently connected to each backend server. |
velocitynavigator_server_latency_ms |
Gauge | Latency/Ping of health checks to backend servers (ms). |
velocitynavigator_server_circuit_breaker |
Gauge | State of each circuit breaker (0=CLOSED, 1=HALF_OPEN, 2=OPEN). |
velocitynavigator_server_drained |
Gauge | Drained state of backend servers (1=Drained, 0=Active). |
velocitynavigator_routed_connections_total |
Counter | Total successful connections routed to each server. |
velocitynavigator_redirects_total |
Counter | Total count of redirects grouped by reason. |
-
Failed to bind to port: Check if another service is using the port, or change it in
navigator.toml. -
Cannot assign requested address: If you are hosted on Pterodactyl or container networks, set
bind_hostto0.0.0.0instead of a public IP. -
Connection Timed Out: Make sure you have opened your metrics port (e.g.
9225or30042) in your cloud provider's firewall (like AWS Lightsail, DigitalOcean, or panel firewall).
For detailed steps, see the Troubleshooting Guide.
🏠 Home · ⚙️ Configuration · 🔌 Developer API · 📋 Operations Runbook · ❓ FAQ
GitHub · Support / Discord · 🐛 Report a Bug
VelocityNavigator v4.2.0 · by DemonZ Development
![]()
Getting Started
Routing
Configuration
Features
Operations
Developer
Maintained by DemonZ Development