Python Space Engineers Prometheus Exporter
Installing
- Installing with pip:
pip3 install se-exporter
- Installing from source:
git clone https://github.com/akimrx/space-engineers-exporter.git --recursive
cd space-engineers-exporter
make install # or python3 setup.py install
Usage
Help output
Arguments:
-h host, --host host Space Engineers Server (API) host
-p port, --port port SE Remote API port. Default: 8080
-t key, --token key SE Remote API secret key
--listen-addr addr Address on which to expose metrics.
Default: 0.0.0.0
--listen-port port Port on which to expose metrics.
Default: 9122
--help Show this help message
--version Show exporter version
Options:
-c file, --config file Path to the config file
-a, --run-async Enable async collect metrics from SE.
It works much faster. If your se server
doesn't have good perfomance - don't
use this feature
--loglevel debug/info/warning/error Log facility. Default: info
Config example
host: localhost
port: 5000
token: xY12qwe6ZZx123==
loglevel: info
listen_addr: 0.0.0.0
listen_port: 9122
run_async: true
Examples
- Run with config file:
se-exporter --config /home/akimrx/config.yml
- Run with args:
se-exporter -h 0.0.0.0 -p 8080 --listen-port 9122 --token "XYZQWERty123-==" --run-async
Exported metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
players_count |
gauge | server, world |
Total online players on the server |
player_ping |
gauge | server, world, player_name, player_id, faction |
Player ping |
total_banned_players |
gauge | server, world |
Total banned players on the server |
total_kicked_players |
gauge | server, world |
Total kicked players on the server |
server_is_ready |
gauge | server, world |
The server is ready to connect players |
simulation_speed |
gauge | server, world |
Current world simulation speed |
simulation_cpu_load |
gauge | server, world |
Current CPU load by simulation |
server_game_uptime_seconds |
gauge | server, world |
Time during which the server is ready to play |
total_pcu_used |
gauge | server, world |
Total used PCU on the ingame world by all |
pirate_total_pcu_used |
gauge | server, world |
Total used PCU on the ingame world by pirates |
planets_count |
gauge | server, world |
Number of planets on the game world |
total_grids |
gauge | server, world |
Number of grids on the game world |
total_asteroids |
gauge | server, world |
Number of asteroids on the game world |
total_floating_objects |
gauge | server, world |
Number of floating objects on the game world |
characters_count |
gauge | server, world |
Count of total characters on the game world |
Example real metrics output
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 246.0
python_gc_objects_collected_total{generation="1"} 222.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 82.0
python_gc_collections_total{generation="1"} 7.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="7",patchlevel="4",version="3.7.4"} 1.0
# HELP se_request_processing Time spent collecting SE server data
# TYPE se_request_processing summary
se_request_processing_count 1.0
se_request_processing_sum 0.903450259
# HELP se_request_processing_created Time spent collecting SE server data
# TYPE se_request_processing_created gauge
se_request_processing_created 1.6086711216817129e+09
# HELP players_count Number of online players on the server
# TYPE players_count gauge
players_count{server="se by akimrx",world="star system"} 1.0
# HELP server_is_ready The server is ready to connect players
# TYPE server_is_ready gauge
server_is_ready{server="se by akimrx",world="star system"} 1.0
# HELP player_ping Just players ping
# TYPE player_ping gauge
player_ping{faction="FLEX",player_id="12345678910111213",player_name="akimrx",server="se by akimrx",world="star system"} 13.0
player_ping{faction="FLEX",player_id="12345678910111214",player_name="rust",server="se by akimrx",world="star system"} 26.0
# HELP planets_count Number of planets in the game world
# TYPE planets_count gauge
planets_count{server="se by akimrx",world="star system"} 8.0
# HELP simulation_speed Current simulation speed in the game world
# TYPE simulation_speed gauge
simulation_speed{server="se by akimrx",world="star system"} 1.02
# HELP simulation_cpu_load CPU load generated by the simulation
# TYPE simulation_cpu_load gauge
simulation_cpu_load{server="se by akimrx",world="star system"} 21.0
# HELP server_game_uptime_seconds Time during which the server is ready to play
# TYPE server_game_uptime_seconds gauge
server_game_uptime_seconds{server="se by akimrx",world="star system"} 16529.0
# HELP total_pcu_used Number of total used PCU on the server
# TYPE total_pcu_used gauge
total_pcu_used{server="se by akimrx",world="star system"} 51902.0
# HELP pirate_total_pcu_used Number of total used PCU by Pirates on the server
# TYPE pirate_total_pcu_used gauge
pirate_total_pcu_used{server="se by akimrx",world="star system"} 3729.0
# HELP total_grids Count of total grids on the game world
# TYPE total_grids gauge
total_grids{server="se by akimrx",world="star system"} 14.0
# HELP total_asteroids Count of total asteroids on the game world
# TYPE total_asteroids gauge
total_asteroids{server="se by akimrx",world="star system"} 119.0
# HELP total_floating_objects Count of total floating objects on the game world
# TYPE total_floating_objects gauge
total_floating_objects{server="se by akimrx",world="star system"} 84.0
# HELP characters_count Count of total characters (including disconnected, but are on the server) on the game world
# TYPE characters_count gauge
characters_count{server="se by akimrx",world="star system"} 3.0
# HELP total_banned_players Count of total banned players on the game world
# TYPE total_banned_players gauge
total_banned_players{server="se by akimrx",world="star system"} 1.0
# HELP total_kicked_players Count of total kicked players on the game world
# TYPE total_kicked_players gauge
total_kicked_players{server="se by akimrx",world="star system"} 2.0
Grafana Dashboard
For more details read this page
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
se-exporter-1.0.2.tar.gz
(11.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file se-exporter-1.0.2.tar.gz.
File metadata
- Download URL: se-exporter-1.0.2.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9f0991983d99e7ca1595c04f4576542ca6820e7edad57506c354d8d7add51f7
|
|
| MD5 |
377acc52557fa91a2c457b56770fa6e9
|
|
| BLAKE2b-256 |
c8b01ff9e9547f8df5d19ebd82237da9376f40e65f09ea213d6c58d56f25ff4a
|
File details
Details for the file se_exporter-1.0.2-py3-none-any.whl.
File metadata
- Download URL: se_exporter-1.0.2-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a06ae24501debeb8e488afe60ef0ce428719687c64856ba649d032b018af01c5
|
|
| MD5 |
8ddb94048ecb5bf18021e516920a17db
|
|
| BLAKE2b-256 |
8bb9636d565ffcb63adc273845e2be3d084dce48eba13b932bdd49d6c0ea4b42
|