Distributed tracing abstraction for Spakky Framework
Project description
Spakky Tracing
Distributed tracing abstraction for Spakky Framework.
Installation
pip install spakky-tracing
Features
TraceContext: W3C Trace Context Level 2 compatible trace context withcontextvarssupportITracePropagator: Abstract interface for trace context propagation across service boundariesW3CTracePropagator: Built-in W3Ctraceparentheader propagator- Async-safe:
contextvars-based context propagation, isolated perasynciotask - Zero external dependencies: Pure Python implementation, depends only on
spakkycore
Quick Start
Create and Propagate Trace Context
from spakky.tracing.context import TraceContext
# Start a new root trace
ctx = TraceContext.new_root()
TraceContext.set(ctx)
# Access current trace
current = TraceContext.get()
print(current.to_traceparent())
# 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
# Create a child span
child = current.child()
TraceContext.set(child)
Parse Incoming Trace Headers
from spakky.tracing.context import TraceContext
header = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
ctx = TraceContext.from_traceparent(header)
Use W3CTracePropagator for Injection/Extraction
from spakky.tracing.w3c_propagator import W3CTracePropagator
propagator = W3CTracePropagator()
# Inject current trace into outgoing headers
carrier: dict[str, str] = {}
propagator.inject(carrier)
# carrier == {"traceparent": "00-...-...-01"}
# Extract trace from incoming headers
ctx = propagator.extract(carrier)
License
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.4.0.tar.gz.
File metadata
- Download URL: spakky_tracing-6.4.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
898c99cc0f7cd6bd5498a08104ed65e62940985131ee75e3409a1d590530e5d2
|
|
| MD5 |
9cced2d5b0b8310c1bba34ea72184c34
|
|
| BLAKE2b-256 |
41d06f427a922eb755bfa6fa9e8cd59c8ae5f816d5a4e841df36e87656c4d41a
|
Provenance
The following attestation bundles were made for spakky_tracing-6.4.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.4.0.tar.gz -
Subject digest:
898c99cc0f7cd6bd5498a08104ed65e62940985131ee75e3409a1d590530e5d2 - Sigstore transparency entry: 1435905067
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
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@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spakky_tracing-6.4.0-py3-none-any.whl.
File metadata
- Download URL: spakky_tracing-6.4.0-py3-none-any.whl
- Upload date:
- Size: 7.0 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 |
703ecbc4c537f6385db190536b6396602d867e35d7e0b92359d3148dfcdebe37
|
|
| MD5 |
a382a2d22772d4e2f4c4085042714e67
|
|
| BLAKE2b-256 |
ed4d5ed1d6b00ed9fb1345ff7f5920c512d0ce954f1f085cf39820c3e6c3487d
|
Provenance
The following attestation bundles were made for spakky_tracing-6.4.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.4.0-py3-none-any.whl -
Subject digest:
703ecbc4c537f6385db190536b6396602d867e35d7e0b92359d3148dfcdebe37 - Sigstore transparency entry: 1435905115
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
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@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Trigger Event:
workflow_dispatch
-
Statement type: