From 96562199c4f49356769b49139188374af9afa539 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Mon, 1 Jun 2026 22:25:40 -0400 Subject: [PATCH] feat(platform): mesh federation live diagnostics span (v0.8.625) Log federation live metadata when exporting mesh replication diagnostics. Co-authored-by: Cursor --- index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/index.js b/index.js index 978f7d8..4cf1529 100644 --- a/index.js +++ b/index.js @@ -760,6 +760,21 @@ class PearcordPlatform extends EventEmitter { return extra } + _logMeshFederationLive (action, extra = {}) { + const guildId = extra.guildId || this.guild?.guild?.id + const span = this.log.time('guild.mesh.federation.live', { + spanKind: 'guild.mesh.federation.live', + action, + guildId: guildId || null, + meshPeerCount: this.guild?.peers?.size ?? 0, + federationPeerTarget: extra.federationPeerTarget ?? 8, + topicPool: this._guildTopicPool?.snapshot?.() || null, + ...extra + }) + span.end(extra) + return extra + } + _reactionTombstoneKey (key, guildId) { return `${guildId || ''}:${key.channelId}:${key.messageId}:${key.emoji}:${key.userId}` } @@ -5003,6 +5018,13 @@ class PearcordPlatform extends EventEmitter { exportMeshReplicationDiagnostics (guildId) { const id = guildId || this.guild?.guild?.id + if (id) { + this._logMeshFederationLive('export-diagnostics', { + guildId: id, + federationPeerTarget: 8, + meshPeerCount: this.guild?.peers?.size ?? 0 + }) + } return { exportedAt: Date.now(), guildId: id,