Skip to main content

smart-health-record

在服務內記錄各節點的事實(開始、成功、錯誤、致命故障、指標),由獨立的評估執行緒推導健康狀態,並以 GET /topology、GET /status 提供給 Health App 讀取。

  • 執行時只使用 Python 標準函式庫,需要 Python 3.10 以上。
  • 公開 API:HealthMonitor、StatusServer、mask_text、__version__。
  • message 與字串型指標值會自動遮蔽密碼、token、URL 帳密等敏感資訊(有已知限制,見導入指南)。

安裝

套件尚未發布到 PyPI。發布後可用:

pip install smart-health-record==0.1.0

在那之前,請在 repo 根目錄用 python -m build packages/health_record 建置 wheel 後安裝。

最小範例

from smart_health_record import HealthMonitor, StatusServer

monitor = HealthMonitor("order-service", "order-1")
monitor.add_lane("main", "主流程")
worker = monitor.add_node("worker", "訂單處理", "main", stale_after_s=10)

monitor.start()
StatusServer(monitor, port=18090).start()   # port 必填;預設只綁定 127.0.0.1

with worker.track():                        # 進入記 start,正常離開記 success,例外記 error 並往外拋
    ...                                     # 處理一筆工作

之後 curl http://127.0.0.1:18090/status 即可取得狀態。

文件

  • 導入指南(callable 不能阻塞、port 由專案指定、遮蔽的已知限制等):docs/INTEGRATION.md
  • 契約:contract/README.md
  • 規格:docs/SPEC.md 第 5 節

Metadata

Release files for smart-health-record 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smart-health-record 0.1.0
File Size Uploaded Provenance Actions
smart_health_record-0.1.0.tar.gz 35.7 kB Without provenance Details for smart_health_record-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smart-health-record 0.1.0
File Interpreter ABI Platform Actions
smart_health_record-0.1.0-py3-none-any.whl Python 3 none any Details for smart_health_record-0.1.0-py3-none-any.whl

Total release size: 58.1 kB

Release files / smart_health_record-0.1.0.tar.gz

Download URL smart_health_record-0.1.0.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c97172dca5a106a1ad5f562d0e78408bf4dd24084cd8cd97e0cdcccca3177e9
BLAKE2b-256 checksum
How to use checksums
dcf4898da70e8df0280768da5cbb0e91befca15fc4a3ce7e182b579979f66724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / smart_health_record-0.1.0-py3-none-any.whl

Download URL smart_health_record-0.1.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5e8710af6467a4a368e6e17e9917717af8460161987afa0ae2c18698779693d
BLAKE2b-256 checksum
How to use checksums
31ed6ad73a99741a4ffd60d74f6a12390055c0e1bb9000aac204df7bc6dc14f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Security for smart-health-record 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page