This project defines metrics for Prometheus from game data of the Game NS2 provided by ns2-stat-api
from project NS2-Stat.
- Run
pip install -r requirements.txt
- Go into file
/src/util/config.py
and set config valuesns2_stats_api_url
is the location for the runningns2-stat-api
instance form project NS2-Statserver-port
is the hosting location where Prometheus can scrape the data
Run python src/__init__.py
You can find all defined metrics in the folder src/metrics_handler/metrics/
. Every file is a single metric. You can read the descriptions defined in the files if you need more information.
Note that you have to run NS2-Stat that provided the game data as api. Just go to the project and read their docu for help.
Add the following configuration in the scrape_configs
-block into your prometheus.yml
file. The targets
port has to be the same as the server-port
above.
- job_name: "ns2"
static_configs:
- targets: ["localhost:8000"]
If you want to use Grafana to virtualise the metrics, you can find a ready-made dashboard in grafana/dashboard.json