Distributed tracing abstraction for Spakky Framework
Project description
Spakky Tracing
Spakky Framework를 위한 분산 트레이싱 추상화입니다.
설치
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)
라이선스
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spakky_tracing-6.5.0.tar.gz.
File metadata
- Download URL: spakky_tracing-6.5.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b239e4480ffbc064b53ec8b8c269512c334b8f62135a0287672ca019af084497
|
|
| MD5 |
889c084436cd85aa2a082384e4a45cb7
|
|
| BLAKE2b-256 |
99b9cd94d1cc8f5b4c6c4ca7bef2845fa277bf504c51e6a16bd1a6cbd06da93c
|
Provenance
The following attestation bundles were made for spakky_tracing-6.5.0.tar.gz:
Publisher:
release.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_tracing-6.5.0.tar.gz -
Subject digest:
b239e4480ffbc064b53ec8b8c269512c334b8f62135a0287672ca019af084497 - Sigstore transparency entry: 1437042382
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@86c1d43bdc948ac432f27efeeeb2b56692d18ee4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86c1d43bdc948ac432f27efeeeb2b56692d18ee4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spakky_tracing-6.5.0-py3-none-any.whl.
File metadata
- Download URL: spakky_tracing-6.5.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f951c6283f47e3ac96eb815105fcc47ffd06e7dc48407e7b5e3aa817a93e1951
|
|
| MD5 |
ee1c3fe0c05a3b8fc75ed7df0cd4c3f4
|
|
| BLAKE2b-256 |
10248b5a1089844a0f38c0bbbb8ba3034b18de0c03ef0b3a85d9d81ae151350e
|
Provenance
The following attestation bundles were made for spakky_tracing-6.5.0-py3-none-any.whl:
Publisher:
release.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_tracing-6.5.0-py3-none-any.whl -
Subject digest:
f951c6283f47e3ac96eb815105fcc47ffd06e7dc48407e7b5e3aa817a93e1951 - Sigstore transparency entry: 1437042389
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@86c1d43bdc948ac432f27efeeeb2b56692d18ee4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86c1d43bdc948ac432f27efeeeb2b56692d18ee4 -
Trigger Event:
workflow_dispatch
-
Statement type: