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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-27 15:43:19 +08:00

38 lines
1.0 KiB
TOML

[project]
name = "rakuten-scraper-service"
version = "0.1.0"
description = "API service for Rakuten Ichiba scraping tasks"
requires-python = ">=3.13"
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",
"uvicorn[standard]>=0.30.0,<1.0.0",
]
[project.optional-dependencies]
# 浏览器兜底:仅在纯 HTTP 被 Akamai 拦截时使用,日常运行不需要
browser = [
"playwright>=1.47.0,<2.0.0",
]
dev = [
"pytest>=8.3.0,<9.0.0",
"pytest-asyncio>=0.24.0,<1.0.0",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
[tool.uv]
package = false