span-trace
- see context info in Github Repo
Installation
pip install span-tree
Goals
- Never have to look at log files again!
- Make error debugging easy by capturing context around errors and traces instead of only a traceback and locals
- Make health monitoring happening automatically
- Make performance monitoring easy by automatically tracking and report slow spans
- Support see once, annotate, and forget about it (instead of re-labeling the same error over and over...)
Features in library
- trace-traces instead of flat log messages
- a trace trace can have multiple "spans" as nodes
- on each "node"
- file_location
- start and end timestamps
- status: started|succeeded|failed
- optional fields:
- exit_error: if something fails without
except - handled_errors: if we have errors caught with
exceptand logged - level
- exit_error: if something fails without
- each trace use a ksuid to ensure it is unique
- each span has a name which is explicitly set or based on function name/call-context
- traces are linked together when a new thread/task is started from an existing trace
- Smart printing
- to terminal when running on localhost
- only json when running on cloud/only normal logging no stdout/stderr?
- smart at grouping together tasks and flushing before exit
- "test-mode": record all traces instead of just printing
How to use the library
Basically, an Enhanced stdlib logger:
from span_tree import get_logger
logger = get_logger(__name__)
logger.log(level,
msg) # level=debug|info|warning|error|critical, can also use `logger.info` logs will be attached to current span
logger(name: str, force_new_trace: bool = False, ** kwargs) -> `ContextManager[Span]` # to start a new span/trace
logger.log_extra(msg: str = "", level: int = INFO, ** kwargs) # to add attributes to span
Metadata
Release files for span-tree 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| span_tree-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for span_tree-0.0.4-py3-none-any.whl |
Release files / span_tree-0.0.4-py3-none-any.whl
| Download URL | span_tree-0.0.4-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc34c5fd41dbbc31980c34ff27d9b64e1ed6384d71cccdb9adb292de7b9d58d0
|
|
BLAKE2b-256 checksum How to use checksums |
cee3cb8e9f946dbb64ba7d528bf7d17280e130d2171f5bdd621ba223e3b0bc14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for span-tree 0.0.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.