4个稳定版本
1.3.0 | 2020年5月4日 |
---|---|
1.2.0 | 2020年4月30日 |
1.1.2 | 2020年4月14日 |
#33 in #prometheus-exporter
27KB
658 行
rs-minecraft-exporter
这是对joshi425/minecraft-exporter的无耻Rust插件,适用于minecraft 1.15.2及以上版本。
用法
Docker
docker run -p 8000:8000 \
-v /opt/server/world:/world
imarv/rs_minecraft_exporter
二进制文件
可以克隆仓库并使用cargo自行构建项目,或者通过crates.io安装
cargo install rs-minecraft-exporter
然后简单地运行
rs-minecraft-exporter /opt/server/world
更改要监听的IP地址
如果您只想在私有网络或类似环境中公开度量标准,您可以更改web服务器监听的IP地址。这可以通过将环境变量HOST_IP
设置为所需的IP地址来完成。
如果没有设置,则服务器将默认为0.0.0.0
。
日志级别
您可以通过将以下任何字符串作为参数追加到docker命令或二进制文件中来调整日志级别。
- 错误
- 警告
- 信息
- 调试
- 跟踪
docker示例
docker run -p 8000:8000 \
-v /opt/server/world:/world
imarv/rs_minecraft_exporter debug
二进制文件示例
rs-minecraft-exporter /opt/server/world debug
度量标准
# HELP mc_broken collected stats for category `broken`
# TYPE mc_broken counter
# HELP mc_crafted collected stats for category `crafted`
# TYPE mc_crafted counter
# HELP mc_custom collected stats for category `custom`
# TYPE mc_custom counter
# HELP mc_dropped collected stats for category `dropped`
# TYPE mc_dropped counter
# HELP mc_food_level current player food level
# TYPE mc_food_level gauge
# HELP mc_health current player health
# TYPE mc_health gauge
# HELP mc_killed collected stats for category `killed`
# TYPE mc_killed counter
# HELP mc_killed_by collected stats for category `killed_by`
# TYPE mc_killed_by counter
# HELP mc_mined collected stats for category `mined`
# TYPE mc_mined counter
# HELP mc_picked_up collected stats for category `picked_up`
# TYPE mc_picked_up counter
# HELP mc_score current player score
# TYPE mc_score gauge
# HELP mc_used collected stats for category `used`
# TYPE mc_used counter
# HELP mc_xp_level current player level
# TYPE mc_xp_level gauge
# HELP mc_xp_total total collceted xp
# TYPE mc_xp_total gauge
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
依赖项
~17MB
~340K SLoC