feat(analytics): persona logging upgrade and Sentry system config
Add client-logging SDK, expanded event taxonomy, API observability, admin domain events UI, and move SENTRY_DSN to HQ system settings with @sentry/node bootstrap after config preload. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -310,6 +310,12 @@ export class TradeService {
|
||||
orderNo: order.orderNo,
|
||||
userId,
|
||||
});
|
||||
this.analyticsService.trackOneSafe(userId, clientApp ?? 'USER_H5', {
|
||||
eventName: 'pay_fail',
|
||||
refType: 'ORDER',
|
||||
refId: orderId,
|
||||
extraJson: { orderId: orderId.toString(), failReason: WECHAT_AUTH_REQUIRED, stage: 'auth' },
|
||||
});
|
||||
throw new BadRequestException(WECHAT_AUTH_REQUIRED);
|
||||
}
|
||||
const payPlatform = clientApp === ClientApp.USER_MINI ? 'mini' : 'h5';
|
||||
@@ -317,10 +323,17 @@ export class TradeService {
|
||||
try {
|
||||
payResult = await this.payProvider.payOrder(orderId, openId, payPlatform);
|
||||
} catch (e) {
|
||||
this.payRedeemAnomaly.onPayFail(e instanceof Error ? e.message : '拉起支付失败', {
|
||||
const failReason = e instanceof Error ? e.message : '拉起支付失败';
|
||||
this.payRedeemAnomaly.onPayFail(failReason, {
|
||||
orderNo: order.orderNo,
|
||||
userId,
|
||||
});
|
||||
this.analyticsService.trackOneSafe(userId, clientApp ?? 'USER_H5', {
|
||||
eventName: 'pay_fail',
|
||||
refType: 'ORDER',
|
||||
refId: orderId,
|
||||
extraJson: { orderId: orderId.toString(), failReason, stage: 'prepay' },
|
||||
});
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user