Label player_disconnects_total by reason #4

Merged
tral merged 1 commit from metric/disconnect-reasons into main 2026-04-25 01:40:09 -07:00
Owner

Add a "reason" label to minecraft_player_disconnects_total carrying the
disconnect reason's translation key (e.g. disconnect.timeout,
multiplayer.disconnect.idling, multiplayer.disconnect.kicked). Reasons
without a translation key are bucketed as "other" so cardinality stays
bounded.

The Fabric API DISCONNECT event doesn't expose the reason, so this drops
the event-based listener in favor of a mixin into
ServerCommonPacketListenerImpl.onDisconnect, which carries
DisconnectionDetails. The mixin filters to play-state listeners via an
instanceof check on ServerGamePacketListenerImpl, matching the joins
counter's semantic of "play-state only".

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

Add a "reason" label to minecraft_player_disconnects_total carrying the disconnect reason's translation key (e.g. disconnect.timeout, multiplayer.disconnect.idling, multiplayer.disconnect.kicked). Reasons without a translation key are bucketed as "other" so cardinality stays bounded. The Fabric API DISCONNECT event doesn't expose the reason, so this drops the event-based listener in favor of a mixin into ServerCommonPacketListenerImpl.onDisconnect, which carries DisconnectionDetails. The mixin filters to play-state listeners via an instanceof check on ServerGamePacketListenerImpl, matching the joins counter's semantic of "play-state only". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Label player_disconnects_total by reason
Some checks failed
Build / build (pull_request) Has been cancelled
ec2800e6ac
Add a "reason" label to minecraft_player_disconnects_total carrying the
disconnect reason's translation key (e.g. disconnect.timeout,
multiplayer.disconnect.idling, multiplayer.disconnect.kicked). Reasons
without a translation key are bucketed as "other" so cardinality stays
bounded.

The Fabric API DISCONNECT event doesn't expose the reason, so this drops
the event-based listener in favor of a mixin into
ServerCommonPacketListenerImpl.onDisconnect, which carries
DisconnectionDetails. The mixin filters to play-state listeners via an
instanceof check on ServerGamePacketListenerImpl, matching the joins
counter's semantic of "play-state only".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
tral merged commit 3a5b5bace2 into main 2026-04-25 01:40:09 -07:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tral/fabric-exporter!4
No description provided.