2026-07-28 Production API 30 天盤點

結論

這次盤點使用 Production ALB logs、Legacy controller/action、pro360_api_82 Endpoint/Mapping 與實際 target group 交叉比對。

觀察區間為 2026-06-292026-07-28 01:45 UTC。最後一天只有部分資料,因此數字是 29 個完整 UTC 日加上當天部分流量。

指標數量
Legacy 非 admin public actions401
有 JSON/REST、Mapping 或正式流量證據的 API actions216
新專案已有對應 route/method100
新專案缺少對應程式116
其中最近 30 天有流量33
其中前 60 天有成功 2xx5
其中 90 天只有非 2xx3
其中完整 90 天零流量75
尚需人工判斷是否為 API185

以「HTTP method + endpoint family」拆分 umbrella endpoint 後,共辨識出 164 組有效正式流量:

正式流量狀態Endpoint 組數
新程式存在,正式已切;parity 仍需逐支驗證72
指定 API Key 走 PHP 8,其餘走 Legacy(搬移中)1
新程式存在,正式仍走 Legacy55
新程式缺少,正式仍有流量35
已走新 target,但 route/method 待確認1

另有 1 組只有 4xx 的 malformed path,未列入上表。

當前分流校正

30 天內同時出現新舊 target,不代表目前仍在混流;必須再比對完整 path、各 target 的最後呼叫時間與當前 ALB rule。

  • GET /transactions/index/*:Legacy 最後出現於 2026-07-01 03:26:51 UTC;目前 ALB rule 240 已將 /transactions/index* 送往新專案,因此歸類為「正式已切」,30 天數字仍保留切流前的 2,175 筆 Legacy 歷史流量。
  • GET /quote_category_subgenres/index.jsonis_shop:*:目前已送 PHP 8。
  • GET /quote_category_subgenres/index/genre_id:*:目前仍依 X-PRO360-Rest-Api-Key 條件分流;符合指定 key 的 request 由 rule 25 送 PHP 8,其餘由 rule 220 送 Legacy。文件不記錄實際 API key 值。

在本次能辨識的 legacy-style API 流量中,新專案 target group 約承接 97.80%。這是流量覆蓋率,不是 API 完成率;少數高流量 API 會明顯拉高比例。

目前最重要的差距

新程式存在,但 Production 仍走 Legacy

code_in_new = yes 只表示新專案有 route/method,不代表 legacy parity 已驗證完成。正式切流前仍要逐支完成 legacy 對照、staging regression 與 side-effect 驗證。

MethodEndpoint30 天 calls2xx
POST/messages/quote_conversation415,278414,823
POST/users/login_once161,452160,823
GET/quote_bids/preview_quote_fee151,854151,624
POST/quote_bids/change_status/rating119,113118,973
POST/users/verify115,562115,344
POST/users/login88,16886,371
POST/quote_requests/search_add77,14976,945
POST/quote_requests/edit75,13573,205
POST/quote_bids/edit58,34658,260
POST/quote_services/edit55,84255,361
POST/quote_service_categories/edit43,40443,397
GET/quote_service_categories/pricing_form42,57642,569
POST/quote_service_categories/add4,1434,142
GET/quote_feedbacks/sent1,2281,227

新程式缺少,而且 Production 仍有流量

MethodEndpoint30 天 calls2xx
POST/blogs/handle130,313130,301
POST/blogs/handle_push_fail55,95755,952
GET/stripes/get_customer33,40333,370
GET/quote_feedback_tags/index26,91126,896
POST/quote_reports/add24,83624,690
POST/users/validate_user20,56320,105
POST/users/reset_password17,54317,518
GET/quote_category_groups/meta16,49116,442
POST/users/send_otp_to_phone_by_email7,0557,054
POST/stripes/remove_card2,5752,574
GET/free_credit_events/index2,5672,563
POST/blogs/get_email_template2,3032,302
POST/blogs/get_login_hash1,9041,904
POST/stripes/log_charge_event1,6291,629
POST/quote_feedback_comments/save751751

blogs/*、payment、callback、cron 或 internal endpoint 要先確認 caller 與 owner,不能只按流量高低直接排 migration 順序。

建議執行順序

  1. 先處理已深入驗證的 current batch:quote_service_categories/addeditpricing_formquote_feedbacks/sent。完成 staging parity regression 後,再準備 Production ALB rule;不可因新 method 已存在就直接切流。
  2. 下一組 user-facing review API 可評估 quote_feedback_tags/indexquote_feedback_comments/savedelete,和已搬的 quote_feedbacks/sent 放在同一批驗證。
  3. 對最近 30 天仍活躍的 35 組 endpoint gap,以及前 60 天有成功流量的 5 個 action,補 caller、owner、legacy source 與 side-effect 分類,再排 migration batch。
  4. 3 個 90 天內只有非 2xx 的 action,先確認實際 status、path、caller 與失敗原因。
  5. 75 個完整 90 天零流量候選,繼續查 direct/internal call、webhook、cron、queue、舊版 App 與季節性功能;未確認前只能標候選,不可直接刪除或決定不搬。
  6. 185 個 public actions 先判斷是一般 Web action、internal helper 還是真正 API,完成後才更新正式分母。

證據檔案

原始 Athena CSV 為 797 MB、3,582,283 列,因動態 token 與 scanner path 造成高 cardinality,不適合直接當 migration inventory。

可提交的精簡結果保存於:

./盤點結果/2026-07-28/
├── README.md
├── legacy_api_endpoint_summary_30d.csv
├── legacy_api_catalog_30d.csv
├── summary.json
└── 90天零流量確認/
    ├── README.md
    ├── zero_traffic_candidates_90d_merged.csv
    └── zero_traffic_candidates_90d_summary.json

原始檔、sample path 與 target/rule 詳細拆分檔保留在 /Users/mattsu/Documents/pro360_aws_evidence/2026-07-28/production/,不放進共用文件 git。

限制

  • ALB access log 是 best-effort delivery。
  • 本次最後一天只有部分資料。
  • 靜態比對只證明 route/method 存在,不證明 response、DB write、log、queue、header、cookie 或 side effect 已符合 legacy parity。
  • 90 天零流量仍不等於可以淘汰。
  • Production ALB rule 與實際 target group 才是正式流向證據,不能只看程式檔案。