feat(metrics-exporter): add Prometheus metrics plugin#7
Open
sor4chi wants to merge 1 commit into
Open
Conversation
53b9de7 to
b3155c3
Compare
58edffc to
a825c93
Compare
…ventions Add metrics-exporter (core/bukkit/paper) with Phase 1 Prometheus metrics, mcRelease/mcPluginShadow build conventions, and ADR 0005/0006. Release workflow discovers distribution artifacts via Gradle; Prometheus is shaded and relocated. Drop Maximum-specific server-name defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
1a3e32e to
397c3b2
Compare
Member
|
😅 しばしお待ちを |
Member
Author
|
そんなに急いでないし破壊的なものでもないから大丈夫w |
|
自分も時間かかるかもです🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
どういう変更か
metrics-exporter/を追加し、Paper サーバーから Prometheus 形式の/metricsを HTTP 公開するMaximumMetricsExporter-Paperを実装(Phase 1: プレイヤー数・TPS・ワールド状態・join/quit/kick/death・JVM hotspot)core/bukkit/paperの 3 層構成。配布 JAR は:paperのみbuildSrcに Release 用 convention(mcRelease,mcPluginShadow)を追加。GHA の plugin 名分岐を廃止server-nameの Maximum 固有デフォルトを削除なぜ変更するのか
<details>参照追加の情報
metrics-exporter-v0.1.0タグを push して Release 作成MC 用語: Paper / Bukkit / モジュール名 `bukkit`・`paper`
metrics-exporter/bukkit/: Bukkit API だけで取れる指標(library。Release 対象外)metrics-exporter/paper/: Paper 固有 API(TPS 等)+ 配布 JAR の入口「サーバー実装 = Paper」と「Gradle モジュール名 = bukkit/paper」は別概念(ADR 0004)
なぜ Shadow か(配布 JAR の作り方・根拠付き)
前提
MC プラグインは
plugins/*.jar1 ファイルで配布する。Prometheus client は Paper が同梱しないため、プラグイン JAR 内に lib を入れる必要がある。検討した案
jar+ runtimeClasspath の zipTree のみplugin.ymlのlibraries:login-notify は外部 Maven 依存がないため、Shadow は 同梱の統一手段として使うだけ(relocate 不要)。
relocate が要る理由(metrics-exporter)
複数 plugin が同じパッケージ(例:
io.prometheus.*)を relocate せず fat JAR 同梱すると、先に読み込まれた plugin のクラスが使われ、バージョン差で壊れる——Spigot 側の説明:— SpigotMC: multiple plugins sharing the same Maven dependency (Solved)
本 PR では
io.prometheus→vc.maximum.mc.metricsexporter.lib.prometheusへ移す(Maven Shade: class relocation / Shadow: relocation と同趣旨)。buildSrc convention の位置づけ
Shadow 自体は外部 plugin。
McPluginShadowPluginは JAR 名・relocate 宣言・Release 対象タスクを配布 subproject ごとにコピペしないための薄いラッパ(ADR 0006)。参考リンク
libraries(preview・サイズ削減・relocate 省略の用途)PluginClassLoader(plugin ごと classloader。衝突回避の主因は relocate 側)