Records written during a gateway request carry the route <unmatched>

未关闭
#1,018 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@anth-volk 已经在做这个了。

开始于 2026年11月6日。

  • #1019 来自 @anth-volk —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
fastapi, python

调研方向

Read the dependency declarations and uv.lock files in the six packages listed in the issue, then inspect the gateway and entrypoint tests. Update the observability requirement and relock each affected package. Done when every lock holds version 3.0.6 and tests confirm the matched route on the recorded exception and backend response event.

由索引模型根据 Issue 内容生成。

描述

Problem

Every record the gateway writes while a FastAPI endpoint runs (from record_exception, event or log) carries http.route = <unmatched>, not the route template such as /jobs/{job_id}. The entrypoint's records have the same problem. The daily telemetry error report therefore groups gateway exceptions under <unmatched>; see PolicyEngine/policyengine-api#4218 (a ValueError group whose most frequent route is <unmatched>).

Cause

policyengine-observability 3.0.4's FastAPI middleware begins the request before FastAPI matches the route, and records written during the endpoint copy the route stored at that moment. PolicyEngine/policyengine-observability#40 fixed this in 3.0.5 (released 2026-10-27): the runtime now reads the matched route each time it writes a record. Every uv.lock on main still locks 3.0.4, and every pyproject.toml allows >=3.0.4,<4.

Fix

Require policyengine-observability 3.0.6 (the latest) in every package that depends on it, and relock every lock that holds it:

  • libs/policyengine-simulation-observability
  • libs/policyengine-simulation-contract (lock only)
  • libs/policyengine-stage12-persistence (lock only)
  • projects/policyengine-simulation-entry
  • projects/policyengine-simulation-executor
  • projects/policyengine-simulation-gateway

3.0.6 changes nothing else the services use: its only change after 3.0.5 is a newer certifi in the observability repository's own uv.lock, which does not affect the package's requirements.

Done when

  • Every lock holds policyengine-observability 3.0.6.
  • A gateway test shows that an exception recorded while GET /jobs/{job_id} runs carries http.route = /jobs/{job_id}, and an entrypoint test shows the same for its backend response event.
主要语言
Python
星标
1
派生
1
平均合并
1 天 23 小时
30 天内合并 PR
89

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-sim-api 的其他 Issue

查看 PolicyEngine/policyengine-sim-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。