OpenTelemetry 可用于报告各种监控数据(包括指标、日志和追踪),并且是事实上的行业标准。
本模组为 OpenTelemetry JavaAgent 提供了额外的插桩支持,以便报告各种游戏指标。其整体功能与 fabric-exporter 类似。
已插桩/报告的指标
- MSPT/TPS
- 已加载区块
- 服务器状态
- 网络
- 连接数
- 握手次数
- 发送/接收的数据包数量
- 区块生成
- 实体
- 按类型、生成地面和世界/维度分组
- 玩家
- 按世界统计
- 在线人数
- 总经验值(分数)
- 经验等级
- 运行时信息
- 游戏版本
- Fabric 版本
- 来自 spark 的可选数据
设置
- 确保拥有一个可以接收 OpenTelemetry 数据的端点。
这可以是您自己或他人托管的 OpenTelemetry Collector(例如在 Grafana Cloud 中)。 - 配置 OpenTelemetry Java Agent,使其将数据发送到您的接收服务。
- 添加 OpenTelemetry Agent Helper Extension for Fabric。
- 这是必需的,以便 OpenTelemetry Agent 能够正确检测并利用该模组。
- 直接添加并(可选地)配置此模组即可。它应该开箱即用。
- 在 Grafana 中导入提供的仪表盘
展示整体基础设施外观的图表
您也可以查看相应的开发设置,其中包含完整基础设施的本地运行部署。
仪表盘外观

示例集成
- 对于
itzg/minecraft-server,请参见此处
配置
配置动态加载自以下位置(按优先级从高到低排序)
- 环境变量
- 前缀为
OIE_ - 所有属性均为大写,并使用
_代替.或-
- 前缀为
- 系统属性
- 前缀为
oie.
- 前缀为
- 位于
.config/oie.json的配置文件
完整的配置选项列表
请注意,预配置的值通常开箱即用。
进行修改时,请确保您清楚自己在做什么。
通用
| 属性 | 类型 | 默认值 | 备注 |
|---|---|---|---|
instrumentation-name |
String |
minecraft |
用作 instrumentationScopeName。用于唯一标识插桩作用域的名称,例如插桩库、包或完全限定的类名。不能为 null。 |
strip-identifier-namespaces |
bool |
true |
从 Identifier 中移除命名空间。禁用此项会导致标识符显示为 minecraft:overworld 而不是 overworld。通常仅重度魔改服务器需要。 |
指标
| 属性 | 类型 | 默认值 | 备注 |
|---|---|---|---|
metrics.freeze-when-server-paused |
bool |
true |
当服务器暂停时使用之前缓存的值停止获取某些指标。此优化通常可将受影响指标的采样速度提高 >10 倍。 结果因情况而异,取决于获取工作所需的量以及服务器进入空闲模式的频率。 如果服务器未使用 pauseWhenEmptySeconds(设置为 <= 0),则此优化将被忽略。 |
metrics.prefix |
String |
minecraft_ |
所有指标的前缀 |
metrics.counter-suffix |
String |
_total |
计数器的后缀 |
metrics.enabled-only |
List<String> |
- | 仅启用指定的指标。 其他所有指标将被禁用! |
metrics.enabled-additionally |
List<String> |
- | 额外启用指定的指标。 这仅对非默认启用的指标相关。 |
metrics.disabled |
List<String> |
- | 禁用指定的指标 |
metrics.enable-player-details-samplers |
bool |
true |
确定是否启用 PlayerDetailsSamplers(例如 Online, TotalXP, XPLevel) |
OpenTelemetry can be used to report various monitoring data (including metrics, logs and traces) and is a de-facto industry standard.
This mod provides additional instrumentation for the OpenTelemetry JavaAgent so that various game metrics can be reported. The overall functionality is similar to fabric-exporter.
Instrumented/Reported metrics
- MSPT/TPS
- Loaded chunks
- Server state
- Networking
- connections
- handshakes
- packets sent/received
- Chunk generation
- Entities
- grouped by type, spawn ground and world/dimension
- Players
- by world
- online
- total xp (score)
- xp level
- Runtime
- game version
- Fabric version
- Optional data from spark
Setup
- Make sure you have an endpoint where OpenTelemetry data can be ingested.
This could be a OpenTelemetry Collector hosted by you or by someone else (e.g. in the Grafana Cloud). - Setup the OpenTelemetry Java Agent so that it sends data to your ingestion service.
- Add the OpenTelemetry Agent Helper Extension for Fabric.
- This is required so that the OpenTelemetry Agent is correctly detecting and utilizing the mod.
- Simply add and (optionally) configure this mod. It should work out of the box.
- Import the provided dashboard into Grafana
- From Grafana Dashboards
- From the local demo in the repo
Diagram showcasing how the overall infrastructure can look
You may also have a look at the corresponding development setup as it contains an locally running deployment of the full infrastructure.
Dashboard look

Example integrations
- For
itzg/minecraft-serversee here
Configuration
The configuration is dynamically loaded from (sorted by highest priority)
- Environment variables
- prefixed with
OIE_ - all properties are in UPPERCASE and use
_instead of.or-
- prefixed with
- System properties
- prefixed with
oie.
- prefixed with
- A configuration file located in
.config/oie.json
Full list of configuration options
Please note that the preconfigured values usually work out of the box.
You should know exactly what you're doing when doing modifications.
General
| Property | Type | Default | Notes |
|---|---|---|---|
instrumentation-name |
String |
minecraft |
Used as instrumentationScopeName. A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null. |
strip-identifier-namespaces |
bool |
true |
Removes namespaces from Identifier. Disabling this causes identifiers to look like this minecraft:overworld instead of overworld.Usually only required for heavily modded servers. |
Metrics
| Property | Type | Default | Notes |
|---|---|---|---|
metrics.freeze-when-server-paused |
bool |
true |
Stop fetching certain metrics when the server is paused and uses previously cached values. This optimization usually improves the sampling speed for affected metrics by >10x. Outcomes vary and depend on the work required for fetching and how often the server enters idle mode. If the server is not using pauseWhenEmptySeconds (set to <= 0) this optimization will be ignored. |
metrics.prefix |
String |
minecraft_ |
Prefix for all metrics |
metrics.counter-suffix |
String |
_total |
Suffix for counters |
metrics.enabled-only |
List<String> |
- | Only enables the specified metrics. ALL OTHER METRICS WILL BE DISABLED! |
metrics.enabled-additionally |
List<String> |
- | Additionally enables the specified metrics. This is only relevant for metrics that are not enabled out of the box. |
metrics.disabled |
List<String> |
- | Disables the specified metrics |
metrics.enable-player-details-samplers |
bool |
true |
Determines if the PlayerDetailsSamplers (e.g. Online, TotalXP, XPLevel) are enabled |
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
下载 OpenTelemetry Instrumentation Extension
- 修复了
PlayersOnlineSampler中可能导致玩家快速加入并离开服务器时出现的错误
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧