Download and install InfluxDB from https://influxdata.com/downloads/#influxdb for your platform
Create n user and a database for TC using the Influx CLI
- Download and install Grafana from http://docs.grafana.org/installation/
- Open the dashboard at http://localhost:3000
- Login with username admin and password admin (defaults can be changed in Grafana's .ini files)
- Go to
+ Add Data Source
Database: worldserver User: grafana Password: grafana
- Go to
Importand import each .json file in TrinityCore's /contrib/grafana
- Edit the worldserver.conf file
Metric.Enable = 1
Metric.ConnectionInfowith connection details (e.g
- Start worldserver, the dashboard should now start receiving values
Implemented and planned metrics
- I/O networking traffic:
- Packets sent
- Packets received
- Average ping
- Traffic in
- Traffic out
- World session update time
- Map update time
- Map loads/unloads
- MMap queries
- Database async queries queued count
- Server uptime (through world initialize and world shutdown events)
- Active connections
- Queued connections
- Players online
- Logins per hour, per day, day of week, etc
- Mails sent
- Auction house usage
- Character levels
- Gold earn/spend
- LFG queues
We'd like help implementing these and other metrics, feel free to send us a pull request.
Adding new metrics
There are two kinds of metrics that can be logged: values and events.
Values correspond to measurements of a certain quantity, like number of online players or the update diff time.
Events are something that occurs in an instant of time, e.g, a player login, worldserver shutdown, etc..
To log new metrics, call
TC_METRIC_VALUE and add a new graph to the dashboard.
TC_METRIC_EVENT(category, title, description)
- category: Arbitrary string, table where the values and events are stored. By convention, event logs should be suffixed by "_events";
- title: Name of the event log;
- description: Additional info about a log event;
- category: Same as above;
- value: A measurement, it can have one of the following types: bool, std::string, float, double or any integral type (int, int32, uint, etc).
Additional visualizations and metrics collection
InfluxDB is part of a bigger set of projects by InfluxData which integrate nicely with the DB:
- Telegraf can be used to collect system metrics like CPU, I/O, memory usage and other services such as MySQL – to display this info next to the TC metrics.
- Chronograf is an alternative to Grafana to graph and visualize time-series metrics.
- Kapacitator is able to process streaming data from InfluxDB to provide alerts, trigger events, detect anomalies or transform data.
Learn more about InfluxDB and Grafana: