* add staging ios app build script * feat(api): add OpenTelemetry LGTM stack for local observability Wire OTel traces, metrics, and logs through a collector to Tempo, Prometheus, and Loki, with custom LLM instrumentation, dev compose overlay, Grafana provisioning, env templates, and development.sh auto-start. * feat: expand observability, harden dev tooling, and fix expo staging UX Add business and LLM Prometheus metrics with Grafana dashboards, alerting, and a metrics verification script. Wire telemetry through adapters and core LLM paths, and document the local LGTM workflow. Fix development.sh for macOS bash 3.2, open Grafana and eval-web in Chrome, and repair eval-web auto-open (unbound EVAL_WEB_BROWSER_SCHEDULED). Merge internal-eval into the main dev script with improved compose handling. Require EXPO_PUBLIC_* at build time, improve iOS HTTP ATS for staging IPs, show memoir empty state instead of load errors when no chapters exist, and add jest env setup plus chapter list response normalization. * chore: enable Grafana Assistant Cursor plugin * fix: memoir empty state and repair withdrawn 0020_chapters_book_id stamp Show empty memoir UI when the chapter list succeeds with no items; treat auth/404 as non-fatal. Extend alembic revision repair so local dev DBs stamped with the removed 0020_chapters_book_id migration can roll back and upgrade to 0019. --------- Co-authored-by: Kevin <kevin@brighteng.org> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
from typing import Dict
|
||||
|
||||
from app.core.business_telemetry import business_span
|
||||
from app.core.logging import get_logger
|
||||
from app.features.payment.payment_config import AlipayConfig
|
||||
from app.features.payment.payment_exceptions import (
|
||||
@@ -46,6 +47,15 @@ class AlipayClient:
|
||||
out_trade_no: str,
|
||||
total_amount: int,
|
||||
subject: str,
|
||||
) -> PaymentResult:
|
||||
with business_span("payment.alipay.create_app_order"):
|
||||
return self._create_app_order_inner(out_trade_no, total_amount, subject)
|
||||
|
||||
def _create_app_order_inner(
|
||||
self,
|
||||
out_trade_no: str,
|
||||
total_amount: int,
|
||||
subject: str,
|
||||
) -> PaymentResult:
|
||||
self._ensure_client()
|
||||
try:
|
||||
@@ -100,6 +110,10 @@ class AlipayClient:
|
||||
raise PaymentNotifyError(f"支付宝回调处理失败: {e}")
|
||||
|
||||
def query_order(self, out_trade_no: str) -> PaymentStatus:
|
||||
with business_span("payment.alipay.query_order"):
|
||||
return self._query_order_inner(out_trade_no)
|
||||
|
||||
def _query_order_inner(self, out_trade_no: str) -> PaymentStatus:
|
||||
self._ensure_client()
|
||||
try:
|
||||
result = self._client.api_alipay_trade_query(out_trade_no=out_trade_no)
|
||||
|
||||
@@ -7,6 +7,7 @@ import os
|
||||
import time
|
||||
from typing import Dict
|
||||
|
||||
from app.core.business_telemetry import business_span
|
||||
from app.core.logging import get_logger
|
||||
from app.features.payment.payment_config import WeChatPayConfig
|
||||
from app.features.payment.payment_exceptions import (
|
||||
@@ -149,6 +150,15 @@ class WeChatPayClient:
|
||||
out_trade_no: str,
|
||||
total_amount: int,
|
||||
description: str,
|
||||
) -> PaymentResult:
|
||||
with business_span("payment.wechat.create_app_order"):
|
||||
return self._create_app_order_inner(out_trade_no, total_amount, description)
|
||||
|
||||
def _create_app_order_inner(
|
||||
self,
|
||||
out_trade_no: str,
|
||||
total_amount: int,
|
||||
description: str,
|
||||
) -> PaymentResult:
|
||||
self._ensure_client()
|
||||
try:
|
||||
@@ -217,6 +227,10 @@ class WeChatPayClient:
|
||||
raise PaymentNotifyError(f"微信支付回调处理失败: {e}")
|
||||
|
||||
def query_order(self, out_trade_no: str) -> PaymentStatus:
|
||||
with business_span("payment.wechat.query_order"):
|
||||
return self._query_order_inner(out_trade_no)
|
||||
|
||||
def _query_order_inner(self, out_trade_no: str) -> PaymentStatus:
|
||||
self._ensure_client()
|
||||
try:
|
||||
code, message = self._client.query(out_trade_no=out_trade_no)
|
||||
|
||||
Reference in New Issue
Block a user