Spakky Tracing
Spakky Framework를 위한 분산 트레이싱 추상화입니다.
TraceContext와ITracePropagator로 HTTP, messaging, task boundary 사이의 trace metadata를 전달합니다.
설치
pip install spakky-tracing
주요 기능
TraceContext:contextvars를 지원하는 W3C Trace Context Level 2 호환 trace contextITracePropagator: service boundary를 넘는 trace context propagation용 abstract interfaceW3CTracePropagator: 내장 W3Ctraceparentheader propagator- Async-safe:
asynciotask별로 격리되는contextvars기반 context propagation - 외부 의존성 없음: 순수 Python 구현이며
spakkycore에만 의존
빠른 시작
TraceContext 생성과 전파
from spakky.tracing.context import TraceContext
# 새 root trace 시작
ctx = TraceContext.new_root()
TraceContext.set(ctx)
# 현재 trace 접근
current = TraceContext.get()
print(current.to_traceparent())
# 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
# child span 생성
child = current.child()
TraceContext.set(child)
들어오는 trace header 파싱
from spakky.tracing.context import TraceContext
header = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
ctx = TraceContext.from_traceparent(header)
W3CTracePropagator로 주입/추출
from spakky.tracing.w3c_propagator import W3CTracePropagator
propagator = W3CTracePropagator()
# 현재 trace를 outgoing header에 주입
carrier: dict[str, str] = {}
propagator.inject(carrier)
# carrier == {"traceparent": "00-...-...-01"}
# incoming header에서 trace 추출
ctx = propagator.extract(carrier)
개발 검증
패키지 단위 검증은 해당 패키지 디렉토리에서 실행합니다.
uv run ruff format .
uv run ruff check .
uv run pyrefly check
uv run pytest
pytest는 각 패키지 pyproject.toml의 coverage 설정을 사용합니다.
라이선스
MIT License
Metadata
Release files for spakky-tracing 8.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spakky_tracing-8.1.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spakky_tracing-8.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / spakky_tracing-8.1.0.tar.gz
| Download URL | spakky_tracing-8.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7583fc287aacd02ac17aa409efe4fcae8122150167b5ab97951296a8eee0dc6
|
|
BLAKE2b-256 checksum How to use checksums |
eb15979886e47583ee6eb86b8460b10b097494f635b1dc15ca59ec7ced881445
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.
Transparency logRelease files / spakky_tracing-8.1.0-py3-none-any.whl
| Download URL | spakky_tracing-8.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d61d55a129bb91fc60c730025f1b3bff3ee9584158699c03eae60ed729e54d6e
|
|
BLAKE2b-256 checksum How to use checksums |
d1edac94015d7a43e488677941719201959d120c5c861b80d038f12d0e2874d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.
Transparency log