tracepulse 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tracepulse-0.1.0/LICENSE +6 -0
- tracepulse-0.1.0/PKG-INFO +89 -0
- tracepulse-0.1.0/README.md +77 -0
- tracepulse-0.1.0/pyproject.toml +15 -0
- tracepulse-0.1.0/setup.cfg +4 -0
- tracepulse-0.1.0/tracepulse/__init__.py +3 -0
- tracepulse-0.1.0/tracepulse/logger.py +29 -0
- tracepulse-0.1.0/tracepulse/tracer.py +83 -0
- tracepulse-0.1.0/tracepulse.egg-info/PKG-INFO +89 -0
- tracepulse-0.1.0/tracepulse.egg-info/SOURCES.txt +11 -0
- tracepulse-0.1.0/tracepulse.egg-info/dependency_links.txt +1 -0
- tracepulse-0.1.0/tracepulse.egg-info/requires.txt +1 -0
- tracepulse-0.1.0/tracepulse.egg-info/top_level.txt +1 -0
tracepulse-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tracepulse
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Execution tracing & performance observability for Python services
|
|
5
|
+
Author: Akshay Bajpai
|
|
6
|
+
Project-URL: Homepage, https://github.com/yourusername/tracepulse
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: loguru
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Tracepulse
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
Tracepulse is a lightweight execution tracing and performance observability layer designed for backend and AI workloads where runtime visibility is critical.
|
|
20
|
+
|
|
21
|
+
It provides structured execution telemetry across synchronous and asynchronous code paths with minimal overhead.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Why Tracepulse Exists
|
|
26
|
+
|
|
27
|
+
Modern AI and service pipelines execute complex multi-step logic, often without runtime transparency.
|
|
28
|
+
|
|
29
|
+
Tracepulse introduces deterministic tracing at the function boundary, enabling:
|
|
30
|
+
|
|
31
|
+
- Runtime performance visibility
|
|
32
|
+
- Failure surface detection
|
|
33
|
+
- Observability without external infra
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- Sync + Async tracing
|
|
40
|
+
- Structured execution logs
|
|
41
|
+
- Failure telemetry capture
|
|
42
|
+
- Duration measurement (ms precision)
|
|
43
|
+
- Loguru-backed logging
|
|
44
|
+
- Zero configuration setup
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
pip install tracepulse
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
from tracepulse import trace
|
|
57
|
+
|
|
58
|
+
@trace
|
|
59
|
+
def compute():
|
|
60
|
+
return sum(range(1_000_000))
|
|
61
|
+
|
|
62
|
+
compute()
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Async Example
|
|
67
|
+
|
|
68
|
+
import asyncio
|
|
69
|
+
from tracepulse import trace
|
|
70
|
+
|
|
71
|
+
@trace
|
|
72
|
+
async def fetch():
|
|
73
|
+
await asyncio.sleep(1)
|
|
74
|
+
|
|
75
|
+
asyncio.run(fetch())
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Philosophy
|
|
80
|
+
|
|
81
|
+
Tracepulse is built on the principle that observability should exist at the code boundary — not only in external monitoring systems.
|
|
82
|
+
|
|
83
|
+
It is intentionally minimal, extensible, and production-safe.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Tracepulse
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
Tracepulse is a lightweight execution tracing and performance observability layer designed for backend and AI workloads where runtime visibility is critical.
|
|
8
|
+
|
|
9
|
+
It provides structured execution telemetry across synchronous and asynchronous code paths with minimal overhead.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why Tracepulse Exists
|
|
14
|
+
|
|
15
|
+
Modern AI and service pipelines execute complex multi-step logic, often without runtime transparency.
|
|
16
|
+
|
|
17
|
+
Tracepulse introduces deterministic tracing at the function boundary, enabling:
|
|
18
|
+
|
|
19
|
+
- Runtime performance visibility
|
|
20
|
+
- Failure surface detection
|
|
21
|
+
- Observability without external infra
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Sync + Async tracing
|
|
28
|
+
- Structured execution logs
|
|
29
|
+
- Failure telemetry capture
|
|
30
|
+
- Duration measurement (ms precision)
|
|
31
|
+
- Loguru-backed logging
|
|
32
|
+
- Zero configuration setup
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
pip install tracepulse
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
from tracepulse import trace
|
|
45
|
+
|
|
46
|
+
@trace
|
|
47
|
+
def compute():
|
|
48
|
+
return sum(range(1_000_000))
|
|
49
|
+
|
|
50
|
+
compute()
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Async Example
|
|
55
|
+
|
|
56
|
+
import asyncio
|
|
57
|
+
from tracepulse import trace
|
|
58
|
+
|
|
59
|
+
@trace
|
|
60
|
+
async def fetch():
|
|
61
|
+
await asyncio.sleep(1)
|
|
62
|
+
|
|
63
|
+
asyncio.run(fetch())
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Philosophy
|
|
68
|
+
|
|
69
|
+
Tracepulse is built on the principle that observability should exist at the code boundary — not only in external monitoring systems.
|
|
70
|
+
|
|
71
|
+
It is intentionally minimal, extensible, and production-safe.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tracepulse"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Execution tracing & performance observability for Python services"
|
|
9
|
+
authors = [{ name="Akshay Bajpai" }]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
dependencies = ["loguru"]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Homepage = "https://github.com/yourusername/tracepulse"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from loguru import logger
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
LOG_DIR = Path("logs")
|
|
7
|
+
LOG_DIR.mkdir(exist_ok=True)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
logger.remove()
|
|
11
|
+
|
|
12
|
+
logger.add(
|
|
13
|
+
sys.stdout,
|
|
14
|
+
format=(
|
|
15
|
+
"<green>{time:YYYY-MM-DD HH:mm:ss}</green> | "
|
|
16
|
+
"<level>{level}</level> | "
|
|
17
|
+
"{extra} | "
|
|
18
|
+
"{message}"
|
|
19
|
+
),
|
|
20
|
+
level="INFO"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
logger.add(
|
|
24
|
+
LOG_DIR / "tracepulse.log",
|
|
25
|
+
rotation="10 MB",
|
|
26
|
+
retention="7 days",
|
|
27
|
+
compression="zip",
|
|
28
|
+
serialize=True
|
|
29
|
+
)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import functools
|
|
3
|
+
import asyncio
|
|
4
|
+
from .logger import logger
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def trace(fn):
|
|
8
|
+
"""
|
|
9
|
+
Execution tracing decorator supporting sync and async functions.
|
|
10
|
+
Captures runtime duration, structured logs, and failure telemetry.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
if asyncio.iscoroutinefunction(fn):
|
|
14
|
+
|
|
15
|
+
@functools.wraps(fn)
|
|
16
|
+
async def async_wrapper(*args, **kwargs):
|
|
17
|
+
|
|
18
|
+
start = time.perf_counter()
|
|
19
|
+
fn_name = fn.__name__
|
|
20
|
+
|
|
21
|
+
logger.bind(function=fn_name).info("Execution started")
|
|
22
|
+
|
|
23
|
+
try:
|
|
24
|
+
result = await fn(*args, **kwargs)
|
|
25
|
+
|
|
26
|
+
duration = (time.perf_counter() - start) * 1000
|
|
27
|
+
|
|
28
|
+
logger.bind(
|
|
29
|
+
function=fn_name,
|
|
30
|
+
duration_ms=round(duration, 2)
|
|
31
|
+
).success("Execution completed")
|
|
32
|
+
|
|
33
|
+
return result
|
|
34
|
+
|
|
35
|
+
except Exception as e:
|
|
36
|
+
|
|
37
|
+
duration = (time.perf_counter() - start) * 1000
|
|
38
|
+
|
|
39
|
+
logger.bind(
|
|
40
|
+
function=fn_name,
|
|
41
|
+
duration_ms=round(duration, 2),
|
|
42
|
+
error=str(e)
|
|
43
|
+
).error("Execution failed")
|
|
44
|
+
|
|
45
|
+
raise
|
|
46
|
+
|
|
47
|
+
return async_wrapper
|
|
48
|
+
|
|
49
|
+
else:
|
|
50
|
+
|
|
51
|
+
@functools.wraps(fn)
|
|
52
|
+
def sync_wrapper(*args, **kwargs):
|
|
53
|
+
|
|
54
|
+
start = time.perf_counter()
|
|
55
|
+
fn_name = fn.__name__
|
|
56
|
+
|
|
57
|
+
logger.bind(function=fn_name).info("Execution started")
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
result = fn(*args, **kwargs)
|
|
61
|
+
|
|
62
|
+
duration = (time.perf_counter() - start) * 1000
|
|
63
|
+
|
|
64
|
+
logger.bind(
|
|
65
|
+
function=fn_name,
|
|
66
|
+
duration_ms=round(duration, 2)
|
|
67
|
+
).success("Execution completed")
|
|
68
|
+
|
|
69
|
+
return result
|
|
70
|
+
|
|
71
|
+
except Exception as e:
|
|
72
|
+
|
|
73
|
+
duration = (time.perf_counter() - start) * 1000
|
|
74
|
+
|
|
75
|
+
logger.bind(
|
|
76
|
+
function=fn_name,
|
|
77
|
+
duration_ms=round(duration, 2),
|
|
78
|
+
error=str(e)
|
|
79
|
+
).error("Execution failed")
|
|
80
|
+
|
|
81
|
+
raise
|
|
82
|
+
|
|
83
|
+
return sync_wrapper
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tracepulse
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Execution tracing & performance observability for Python services
|
|
5
|
+
Author: Akshay Bajpai
|
|
6
|
+
Project-URL: Homepage, https://github.com/yourusername/tracepulse
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: loguru
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Tracepulse
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
Tracepulse is a lightweight execution tracing and performance observability layer designed for backend and AI workloads where runtime visibility is critical.
|
|
20
|
+
|
|
21
|
+
It provides structured execution telemetry across synchronous and asynchronous code paths with minimal overhead.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Why Tracepulse Exists
|
|
26
|
+
|
|
27
|
+
Modern AI and service pipelines execute complex multi-step logic, often without runtime transparency.
|
|
28
|
+
|
|
29
|
+
Tracepulse introduces deterministic tracing at the function boundary, enabling:
|
|
30
|
+
|
|
31
|
+
- Runtime performance visibility
|
|
32
|
+
- Failure surface detection
|
|
33
|
+
- Observability without external infra
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- Sync + Async tracing
|
|
40
|
+
- Structured execution logs
|
|
41
|
+
- Failure telemetry capture
|
|
42
|
+
- Duration measurement (ms precision)
|
|
43
|
+
- Loguru-backed logging
|
|
44
|
+
- Zero configuration setup
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
pip install tracepulse
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
from tracepulse import trace
|
|
57
|
+
|
|
58
|
+
@trace
|
|
59
|
+
def compute():
|
|
60
|
+
return sum(range(1_000_000))
|
|
61
|
+
|
|
62
|
+
compute()
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Async Example
|
|
67
|
+
|
|
68
|
+
import asyncio
|
|
69
|
+
from tracepulse import trace
|
|
70
|
+
|
|
71
|
+
@trace
|
|
72
|
+
async def fetch():
|
|
73
|
+
await asyncio.sleep(1)
|
|
74
|
+
|
|
75
|
+
asyncio.run(fetch())
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Philosophy
|
|
80
|
+
|
|
81
|
+
Tracepulse is built on the principle that observability should exist at the code boundary — not only in external monitoring systems.
|
|
82
|
+
|
|
83
|
+
It is intentionally minimal, extensible, and production-safe.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
tracepulse/__init__.py
|
|
5
|
+
tracepulse/logger.py
|
|
6
|
+
tracepulse/tracer.py
|
|
7
|
+
tracepulse.egg-info/PKG-INFO
|
|
8
|
+
tracepulse.egg-info/SOURCES.txt
|
|
9
|
+
tracepulse.egg-info/dependency_links.txt
|
|
10
|
+
tracepulse.egg-info/requires.txt
|
|
11
|
+
tracepulse.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
loguru
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tracepulse
|