feat(platform): compliance.export span for Phase 603 (v0.8.566)
Mirror audit.export with compliance.export span metadata on exportAuditLog for compliance hub observability. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -57,7 +57,9 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
|
||||
|
||||
**v0.8.560 (Phase 597):** Session hub live region `#session-hub-panel-live`; **session-errors** excludes audit/compliance/slash/webhook/bot/automation/attachment/embed/message/reaction/pin/search/voice/stage/screen/soundboard/presence/discovery/contacts/dm/settings/invite bleed; clipboard `sessionHubPanelLiveBusy`; `session.startup`/`guild.open`/`identity.register` span cross-check. Bundle: `npm run test:phase597-session`. See [SESSION.md](../../docs/SESSION.md). Settings hub depth: see [SETTINGS.md](../../docs/SETTINGS.md) (Phase 598 — complete).
|
||||
|
||||
**v0.8.565 (Phase 602):** Audit hub live region depth — `#audit-panel-live` + `syncAuditLivePanelDuringGuildLoading`; `#audit-hub-panel-live` `aria-busy`; **audit-errors** excludes slash/webhook/bot/automation/attachment/embed/message/reaction/pin/search bleed; clipboard `auditPanelLiveBusy`; `audit.append`/`audit.export`/`audit.schedule` span cross-check. Bundle: `npm run test:phase602-audit`. See [AUDIT.md](../../docs/AUDIT.md). Compliance hub depth: see [COMPLIANCE.md](../../docs/COMPLIANCE.md) (Phase 603 — planned).
|
||||
**v0.8.566 (Phase 603):** Compliance hub live region depth — `#compliance-panel-live` + `syncComplianceLivePanelDuringGuildLoading`; `#compliance-hub-panel-live` `aria-busy`; **compliance-errors** excludes slash/webhook/bot/automation/attachment/embed/message/reaction/pin/search/audit bleed; clipboard `compliancePanelLiveBusy`; `compliance.snapshot`/`compliance.archive`/`compliance.export`/`digest.schedule` span cross-check. Bundle: `npm run test:phase603-compliance`. See [COMPLIANCE.md](../../docs/COMPLIANCE.md).
|
||||
|
||||
**v0.8.565 (Phase 602):** Audit hub live region depth — `#audit-panel-live` + `syncAuditLivePanelDuringGuildLoading`; `#audit-hub-panel-live` `aria-busy`; **audit-errors** excludes slash/webhook/bot/automation/attachment/embed/message/reaction/pin/search bleed; clipboard `auditPanelLiveBusy`; `audit.append`/`audit.export`/`audit.schedule` span cross-check. Bundle: `npm run test:phase602-audit`. See [AUDIT.md](../../docs/AUDIT.md).
|
||||
|
||||
**v0.8.564 (Phase 601):** Moderation hub live region depth — `#moderation-panel-live` + `syncModerationLivePanelDuringGuildLoading`; `#moderation-hub-panel-live` `aria-busy`; **moderation-errors** excludes compliance/slash/webhook/bot/automation/attachment/embed/message/reaction/pin/search bleed; clipboard `moderationPanelLiveBusy`; `ban.member`/`kick.member`/`timeout.member`/`automod.setConfig` span cross-check. Bundle: `npm run test:phase601-moderation`. See [MODERATION.md](../../docs/MODERATION.md).
|
||||
|
||||
|
||||
@@ -4037,6 +4037,11 @@ class PearcordPlatform extends EventEmitter {
|
||||
guildId,
|
||||
filter: opts.filter || 'all'
|
||||
})
|
||||
const complianceExportSpan = this.log.time('compliance.export', {
|
||||
format: opts.format || 'json',
|
||||
guildId,
|
||||
filter: opts.filter || 'all'
|
||||
})
|
||||
try {
|
||||
if (!this.guild?.guild) throw new Error('no guild')
|
||||
const roles = await this._memberRoles()
|
||||
@@ -4182,6 +4187,19 @@ class PearcordPlatform extends EventEmitter {
|
||||
activeChannelId: this.activeChannelId,
|
||||
guildCount: (this.guilds || []).length
|
||||
})
|
||||
complianceExportSpan.end({
|
||||
guildId,
|
||||
count: out.count,
|
||||
format,
|
||||
filter: opts.filter || 'all',
|
||||
signed: !!signature,
|
||||
archived,
|
||||
exportLimit: limit,
|
||||
remainingExportCapacity: Math.max(0, limit - entries.length),
|
||||
spanKind: 'compliance.export',
|
||||
activeChannelId: this.activeChannelId,
|
||||
guildCount: (this.guilds || []).length
|
||||
})
|
||||
return out
|
||||
} catch (err) {
|
||||
this.log.error('audit.export error', {
|
||||
@@ -4190,7 +4208,14 @@ class PearcordPlatform extends EventEmitter {
|
||||
filter: opts.filter || 'all',
|
||||
error: err?.message || String(err)
|
||||
})
|
||||
this.log.error('compliance.export error', {
|
||||
format: opts.format || 'json',
|
||||
guildId: this.guild?.guild?.id || null,
|
||||
filter: opts.filter || 'all',
|
||||
error: err?.message || String(err)
|
||||
})
|
||||
span.fail(err)
|
||||
complianceExportSpan.fail(err)
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user