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 13.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 spakky-tracing 13.1.0
File Size Uploaded Provenance Actions
spakky_tracing-13.1.0.tar.gz 5.7 kB With provenance Details for spakky_tracing-13.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 13.1 kB

Release files / spakky_tracing-13.1.0.tar.gz

Download URL spakky_tracing-13.1.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f819fe21603ca8d2d92f6312e21a0c4776fe70f8842693f883cdee602065faac
BLAKE2b-256 checksum
How to use checksums
238091c1d03912edf4feb0cc1eee2b94f72fda90d32b0da9824adc236293b548
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 Nov 19, 2026.

Transparency log

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

Download URL spakky_tracing-13.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75aba5f523610c8ad9f382286b3cfda938cf829259042280727e7254ba8f7601
BLAKE2b-256 checksum
How to use checksums
967237daf8f8615275f8b707739422a21654a04505d7cce113ba198103caea8c
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 Nov 19, 2026.

Transparency log

Security for spakky-tracing 13.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.

Full provenance

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

Select from 2 files

Attestation for spakky_tracing-13.1.0.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 Nov 19, 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

13.1.0 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