2026-07-28 Production API 30 天盤點
結論
這次盤點使用 Production ALB logs、Legacy controller/action、pro360_api_82 Endpoint/Mapping 與實際 target group 交叉比對。
觀察區間為 2026-06-29 至 2026-07-28 01:45 UTC。最後一天只有部分資料,因此數字是 29 個完整 UTC 日加上當天部分流量。
| 指標 | 數量 |
|---|---|
| Legacy 非 admin public actions | 401 |
| 有 JSON/REST、Mapping 或正式流量證據的 API actions | 216 |
| 新專案已有對應 route/method | 100 |
| 新專案缺少對應程式 | 116 |
| 其中最近 30 天有流量 | 33 |
| 其中前 60 天有成功 2xx | 5 |
| 其中 90 天只有非 2xx | 3 |
| 其中完整 90 天零流量 | 75 |
| 尚需人工判斷是否為 API | 185 |
以「HTTP method + endpoint family」拆分 umbrella endpoint 後,共辨識出 164 組有效正式流量:
| 正式流量狀態 | Endpoint 組數 |
|---|---|
| 新程式存在,正式已切;parity 仍需逐支驗證 | 72 |
| 指定 API Key 走 PHP 8,其餘走 Legacy(搬移中) | 1 |
| 新程式存在,正式仍走 Legacy | 55 |
| 新程式缺少,正式仍有流量 | 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.json與is_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 驗證。
| Method | Endpoint | 30 天 calls | 2xx |
|---|---|---|---|
| POST | /messages/quote_conversation | 415,278 | 414,823 |
| POST | /users/login_once | 161,452 | 160,823 |
| GET | /quote_bids/preview_quote_fee | 151,854 | 151,624 |
| POST | /quote_bids/change_status/rating | 119,113 | 118,973 |
| POST | /users/verify | 115,562 | 115,344 |
| POST | /users/login | 88,168 | 86,371 |
| POST | /quote_requests/search_add | 77,149 | 76,945 |
| POST | /quote_requests/edit | 75,135 | 73,205 |
| POST | /quote_bids/edit | 58,346 | 58,260 |
| POST | /quote_services/edit | 55,842 | 55,361 |
| POST | /quote_service_categories/edit | 43,404 | 43,397 |
| GET | /quote_service_categories/pricing_form | 42,576 | 42,569 |
| POST | /quote_service_categories/add | 4,143 | 4,142 |
| GET | /quote_feedbacks/sent | 1,228 | 1,227 |
新程式缺少,而且 Production 仍有流量
| Method | Endpoint | 30 天 calls | 2xx |
|---|---|---|---|
| POST | /blogs/handle | 130,313 | 130,301 |
| POST | /blogs/handle_push_fail | 55,957 | 55,952 |
| GET | /stripes/get_customer | 33,403 | 33,370 |
| GET | /quote_feedback_tags/index | 26,911 | 26,896 |
| POST | /quote_reports/add | 24,836 | 24,690 |
| POST | /users/validate_user | 20,563 | 20,105 |
| POST | /users/reset_password | 17,543 | 17,518 |
| GET | /quote_category_groups/meta | 16,491 | 16,442 |
| POST | /users/send_otp_to_phone_by_email | 7,055 | 7,054 |
| POST | /stripes/remove_card | 2,575 | 2,574 |
| GET | /free_credit_events/index | 2,567 | 2,563 |
| POST | /blogs/get_email_template | 2,303 | 2,302 |
| POST | /blogs/get_login_hash | 1,904 | 1,904 |
| POST | /stripes/log_charge_event | 1,629 | 1,629 |
| POST | /quote_feedback_comments/save | 751 | 751 |
blogs/*、payment、callback、cron 或 internal endpoint 要先確認 caller 與 owner,不能只按流量高低直接排 migration 順序。
建議執行順序
- 先處理已深入驗證的 current batch:
quote_service_categories/add、edit、pricing_form與quote_feedbacks/sent。完成 staging parity regression 後,再準備 Production ALB rule;不可因新 method 已存在就直接切流。 - 下一組 user-facing review API 可評估
quote_feedback_tags/index、quote_feedback_comments/save、delete,和已搬的quote_feedbacks/sent放在同一批驗證。 - 對最近 30 天仍活躍的 35 組 endpoint gap,以及前 60 天有成功流量的 5 個 action,補 caller、owner、legacy source 與 side-effect 分類,再排 migration batch。
- 3 個 90 天內只有非 2xx 的 action,先確認實際 status、path、caller 與失敗原因。
- 75 個完整 90 天零流量候選,繼續查 direct/internal call、webhook、cron、queue、舊版 App 與季節性功能;未確認前只能標候選,不可直接刪除或決定不搬。
- 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 才是正式流向證據,不能只看程式檔案。