接入 OTel 链路追踪 + 镜像默认启用

抓取-解析链路原本只有日志,出现"抓回内容但解析不出预期字段"时定位慢。
接入 OpenTelemetry traces(FastAPI/httpx 自动 + 手写 fetch/parse span),
解析失败时把页面 HTML 作为 span event 上报,便于事后复现。
Dockerfile 默认开启,镜像一启动即导出到自建 OTLP endpoint。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 15:43:19 +08:00
co-authored by Claude Opus 4.6
parent 5376ced511
commit 2b7db521c4
13 changed files with 1021 additions and 203 deletions
+5
View File
@@ -7,6 +7,11 @@ dependencies = [
"fastapi>=0.115.0,<1.0.0",
"httpx[http2]>=0.27.0,<1.0.0",
"loguru>=0.7.0,<1.0.0",
"opentelemetry-api>=1.27.0,<2.0.0",
"opentelemetry-exporter-otlp>=1.27.0,<2.0.0",
"opentelemetry-instrumentation-fastapi>=0.48b0,<1.0.0",
"opentelemetry-instrumentation-httpx>=0.48b0,<1.0.0",
"opentelemetry-sdk>=1.27.0,<2.0.0",
"pydantic>=2.0.0,<3.0.0",
"pydantic-settings>=2.4.0,<3.0.0",
"selectolax>=0.3.21,<1.0.0",