traccia 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
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.
- {traccia-0.1.0.dist-info → traccia-0.1.2.dist-info}/METADATA +1 -1
- traccia-0.1.2.dist-info/RECORD +6 -0
- traccia-0.1.2.dist-info/top_level.txt +1 -0
- traccia/__init__.py +0 -73
- traccia/auto.py +0 -736
- traccia/auto_instrumentation.py +0 -74
- traccia/cli.py +0 -349
- traccia/config.py +0 -693
- traccia/errors.py +0 -48
- traccia/pricing_config.py +0 -58
- traccia/runtime_config.py +0 -106
- traccia-0.1.0.dist-info/RECORD +0 -14
- traccia-0.1.0.dist-info/top_level.txt +0 -1
- {traccia-0.1.0.dist-info → traccia-0.1.2.dist-info}/WHEEL +0 -0
- {traccia-0.1.0.dist-info → traccia-0.1.2.dist-info}/entry_points.txt +0 -0
- {traccia-0.1.0.dist-info → traccia-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
traccia-0.1.2.dist-info/licenses/LICENSE,sha256=HNl57LOj88EfKh-IWmeqWxsDRh_FF6lj0l-E2A4Hr8w,10757
|
|
2
|
+
traccia-0.1.2.dist-info/METADATA,sha256=LNuwcEuYE5OCjPFHV-VvLzoND4KR5_BNYbBuDD6jI_k,17986
|
|
3
|
+
traccia-0.1.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
+
traccia-0.1.2.dist-info/entry_points.txt,sha256=SG7gacPRmFzLw2HYTblUZsmC_TO3n14-dNi28SL-C2k,45
|
|
5
|
+
traccia-0.1.2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
6
|
+
traccia-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
traccia/__init__.py
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"""Python SDK entrypoint for the agent tracing library."""
|
|
2
|
-
|
|
3
|
-
from traccia.auto import start_tracing, stop_tracing, init, trace, end_auto_trace
|
|
4
|
-
from traccia.tracer import TracerProvider
|
|
5
|
-
from traccia.instrumentation.decorator import observe
|
|
6
|
-
|
|
7
|
-
# Version exposure
|
|
8
|
-
try:
|
|
9
|
-
from importlib.metadata import version, PackageNotFoundError
|
|
10
|
-
try:
|
|
11
|
-
__version__ = version("traccia")
|
|
12
|
-
except PackageNotFoundError:
|
|
13
|
-
__version__ = "0.1.0" # Fallback version
|
|
14
|
-
except ImportError:
|
|
15
|
-
__version__ = "0.1.0" # Fallback for Python < 3.8
|
|
16
|
-
|
|
17
|
-
# Initialize global tracer provider (now uses OpenTelemetry directly)
|
|
18
|
-
_global_tracer_provider = TracerProvider()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def get_tracer(name: str = "default"):
|
|
22
|
-
"""Fetch a tracer from the global provider."""
|
|
23
|
-
return _global_tracer_provider.get_tracer(name)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def span(name: str, attributes: dict = None):
|
|
27
|
-
"""
|
|
28
|
-
Convenience function to create a span using the default tracer.
|
|
29
|
-
|
|
30
|
-
This is a simpler alternative to:
|
|
31
|
-
tracer = get_tracer("name")
|
|
32
|
-
with tracer.start_as_current_span("span_name") as span:
|
|
33
|
-
|
|
34
|
-
Usage:
|
|
35
|
-
from traccia import span
|
|
36
|
-
|
|
37
|
-
with span("my_operation"):
|
|
38
|
-
# Your code here
|
|
39
|
-
pass
|
|
40
|
-
|
|
41
|
-
# With attributes
|
|
42
|
-
with span("my_operation", {"key": "value"}) as s:
|
|
43
|
-
s.set_attribute("another", "attr")
|
|
44
|
-
# Your code here
|
|
45
|
-
"""
|
|
46
|
-
tracer = get_tracer()
|
|
47
|
-
return tracer.start_as_current_span(name, attributes=attributes)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def set_tracer_provider(provider: TracerProvider) -> None:
|
|
51
|
-
"""Override the global tracer provider (primarily for tests or customization)."""
|
|
52
|
-
global _global_tracer_provider
|
|
53
|
-
_global_tracer_provider = provider
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def get_tracer_provider() -> TracerProvider:
|
|
57
|
-
return _global_tracer_provider
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
__all__ = [
|
|
61
|
-
"__version__",
|
|
62
|
-
"get_tracer",
|
|
63
|
-
"get_tracer_provider",
|
|
64
|
-
"set_tracer_provider",
|
|
65
|
-
"start_tracing",
|
|
66
|
-
"stop_tracing",
|
|
67
|
-
"init",
|
|
68
|
-
"trace",
|
|
69
|
-
"end_auto_trace",
|
|
70
|
-
"span",
|
|
71
|
-
"observe",
|
|
72
|
-
]
|
|
73
|
-
|