Skip to main content

Spakky Tracing

Spakky Framework를 위한 분산 트레이싱 추상화입니다. TraceContext와 ITracePropagator로 HTTP, messaging, task boundary 사이의 trace metadata를 전달합니다.

설치

pip install spakky-tracing

주요 기능

  • TraceContext: contextvars를 지원하는 W3C Trace Context Level 2 호환 trace context
  • ITracePropagator: service boundary를 넘는 trace context propagation용 abstract interface
  • W3CTracePropagator: 내장 W3C traceparent header propagator
  • Async-safe: asyncio task별로 격리되는 contextvars 기반 context propagation
  • 외부 의존성 없음: 순수 Python 구현이며 spakky core에만 의존

빠른 시작

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.5.1

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

Source distribution (sdist)

Source distribution for spakky-tracing 8.5.1
File Size Uploaded Provenance Actions
spakky_tracing-8.5.1.tar.gz 5.7 kB With provenance Details for spakky_tracing-8.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spakky-tracing 8.5.1
File Interpreter ABI Platform Actions
spakky_tracing-8.5.1-py3-none-any.whl Python 3 none any Details for spakky_tracing-8.5.1-py3-none-any.whl

Total release size: 13.1 kB

Release files / spakky_tracing-8.5.1.tar.gz

Download URL spakky_tracing-8.5.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1ef3c467d5b555ce5ad14e682eb39cd597c4608db4bae3f02002b570262cb9a7
BLAKE2b-256 checksum
How to use checksums
38ed008ef17f3d9dae9c4d0bec969c5dc13596ad2851048ecc9f2bf165b7054e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / spakky_tracing-8.5.1-py3-none-any.whl

Download URL spakky_tracing-8.5.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43dcd447075fc3880b30131f5a49ad6af99c217f4827bd28e03026a59435242e
BLAKE2b-256 checksum
How to use checksums
b89b56901534585736c4237cda72e4e5f4e8ca7b48b2a5dff0c607aed317ae5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for spakky-tracing 8.5.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for spakky_tracing-8.5.1.tar.gz

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 Oct 27, 2026.

Transparency log

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

8.5.1 This release

2 release files Full 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