feat(platform): mesh federation live diagnostics span (v0.8.625)
Log federation live metadata when exporting mesh replication diagnostics. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -760,6 +760,21 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
return extra
|
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) {
|
_reactionTombstoneKey (key, guildId) {
|
||||||
return `${guildId || ''}:${key.channelId}:${key.messageId}:${key.emoji}:${key.userId}`
|
return `${guildId || ''}:${key.channelId}:${key.messageId}:${key.emoji}:${key.userId}`
|
||||||
}
|
}
|
||||||
@@ -5003,6 +5018,13 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
|
|
||||||
exportMeshReplicationDiagnostics (guildId) {
|
exportMeshReplicationDiagnostics (guildId) {
|
||||||
const id = guildId || this.guild?.guild?.id
|
const id = guildId || this.guild?.guild?.id
|
||||||
|
if (id) {
|
||||||
|
this._logMeshFederationLive('export-diagnostics', {
|
||||||
|
guildId: id,
|
||||||
|
federationPeerTarget: 8,
|
||||||
|
meshPeerCount: this.guild?.peers?.size ?? 0
|
||||||
|
})
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
exportedAt: Date.now(),
|
exportedAt: Date.now(),
|
||||||
guildId: id,
|
guildId: id,
|
||||||
|
|||||||
Reference in New Issue
Block a user