feat: add protocol interaction observability
This commit is contained in:
@@ -959,6 +959,37 @@ export type OperationLogResponse = {
|
||||
modules: string[];
|
||||
};
|
||||
|
||||
export type ProtocolInteractionLogItem = {
|
||||
id: string;
|
||||
protocol: 'cmpp' | 'http';
|
||||
direction: 'client_to_platform' | 'platform_to_channel' | 'channel_to_platform' | 'platform_to_client';
|
||||
eventType: string;
|
||||
status: 'received' | 'accepted' | 'success' | 'failed' | 'retrying';
|
||||
tenantId?: string | null;
|
||||
applicationId?: string | null;
|
||||
channelId?: string | null;
|
||||
account?: string | null;
|
||||
messageId?: string | null;
|
||||
gatewayMessageId?: string | null;
|
||||
traceId?: string | null;
|
||||
requestId?: string | null;
|
||||
phoneMasked?: string | null;
|
||||
resultCode?: string | null;
|
||||
durationMs?: number | null;
|
||||
payloadBytes?: number | null;
|
||||
retryCount?: number | null;
|
||||
detail?: Record<string, unknown> | null;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type ProtocolInteractionLogResponse = {
|
||||
items: ProtocolInteractionLogItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
eventTypes: string[];
|
||||
};
|
||||
|
||||
export type SystemLogExportResult = {
|
||||
operationId: string;
|
||||
status: 'completed';
|
||||
@@ -1366,6 +1397,8 @@ export const adminApi = {
|
||||
getDashboard: (tenantId?: string) => request<DashboardResponse>(withQuery('/admin/operations/dashboard/statistics', { tenantId })),
|
||||
listSystemLogs: (query: { tenantId?: string; keyword?: string; level?: string; module?: string; range?: string; page?: number; pageSize?: number }) =>
|
||||
request<OperationLogResponse>(withQuery('/admin/system-logs', query)),
|
||||
listProtocolInteractionLogs: (query: { protocol?: string; direction?: string; eventType?: string; status?: string; keyword?: string; range?: string; page?: number; pageSize?: number }) =>
|
||||
request<ProtocolInteractionLogResponse>(withQuery('/admin/system-logs/protocol-interactions', query)),
|
||||
exportSystemLogs: (query: { tenantId?: string; keyword?: string; level?: string; module?: string; range?: string }) =>
|
||||
request<SystemLogExportResult>('/admin/system-logs/exports', { method: 'POST', body: JSON.stringify(query) }),
|
||||
listAccounts: () => request<TenantAccount[]>('/admin/billing/accounts'),
|
||||
|
||||
Reference in New Issue
Block a user