praisonaiagents 0.0.152__py3-none-any.whl → 0.0.154__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.
- praisonaiagents/__init__.py +57 -7
- praisonaiagents/agent/agent.py +11 -1
- praisonaiagents/agents/agents.py +116 -1
- praisonaiagents/llm/llm.py +77 -0
- praisonaiagents/main.py +7 -0
- praisonaiagents/mcp/mcp_http_stream.py +151 -4
- praisonaiagents/telemetry/__init__.py +31 -3
- praisonaiagents/telemetry/integration.py +385 -84
- praisonaiagents/telemetry/performance_monitor.py +162 -1
- praisonaiagents/telemetry/performance_utils.py +35 -7
- praisonaiagents/telemetry/telemetry.py +145 -42
- praisonaiagents/telemetry/token_collector.py +170 -0
- praisonaiagents/telemetry/token_telemetry.py +89 -0
- {praisonaiagents-0.0.152.dist-info → praisonaiagents-0.0.154.dist-info}/METADATA +1 -1
- {praisonaiagents-0.0.152.dist-info → praisonaiagents-0.0.154.dist-info}/RECORD +17 -15
- {praisonaiagents-0.0.152.dist-info → praisonaiagents-0.0.154.dist-info}/WHEEL +0 -0
- {praisonaiagents-0.0.152.dist-info → praisonaiagents-0.0.154.dist-info}/top_level.txt +0 -0
@@ -5,19 +5,24 @@ This module provides:
|
|
5
5
|
1. Anonymous usage tracking with privacy-first design
|
6
6
|
2. User-friendly performance monitoring and analysis tools
|
7
7
|
|
8
|
-
Telemetry
|
8
|
+
Telemetry can be disabled via environment variables:
|
9
9
|
- PRAISONAI_TELEMETRY_DISABLED=true
|
10
10
|
- PRAISONAI_DISABLE_TELEMETRY=true
|
11
11
|
- DO_NOT_TRACK=true
|
12
12
|
|
13
|
+
Performance monitoring can be optimized via environment variables:
|
14
|
+
- PRAISONAI_PERFORMANCE_DISABLED=true (disables performance monitoring overhead)
|
15
|
+
- PRAISONAI_FLOW_ANALYSIS_ENABLED=true (enables expensive flow analysis - opt-in only)
|
16
|
+
|
13
17
|
No personal data, prompts, or responses are collected.
|
14
18
|
|
15
19
|
Performance Monitoring Features:
|
16
20
|
- Function performance tracking with detailed statistics
|
17
21
|
- API call monitoring and analysis
|
18
|
-
- Function execution flow visualization
|
22
|
+
- Function execution flow visualization (opt-in)
|
19
23
|
- Performance bottleneck identification
|
20
24
|
- Real-time performance reporting
|
25
|
+
- External APM metrics export (DataDog, New Relic compatible)
|
21
26
|
- CLI interface for easy access
|
22
27
|
"""
|
23
28
|
|
@@ -37,7 +42,7 @@ try:
|
|
37
42
|
PerformanceMonitor, performance_monitor,
|
38
43
|
monitor_function, track_api_call, get_performance_report,
|
39
44
|
get_function_stats, get_api_stats, get_slowest_functions,
|
40
|
-
get_slowest_apis, clear_performance_data
|
45
|
+
get_slowest_apis, clear_performance_data, export_external_apm_metrics
|
41
46
|
)
|
42
47
|
from .performance_utils import (
|
43
48
|
FunctionFlowAnalyzer, PerformanceAnalyzer,
|
@@ -58,6 +63,10 @@ __all__ = [
|
|
58
63
|
'force_shutdown_telemetry',
|
59
64
|
'MinimalTelemetry',
|
60
65
|
'TelemetryCollector', # For backward compatibility
|
66
|
+
# Performance optimizations
|
67
|
+
'enable_performance_mode',
|
68
|
+
'disable_performance_mode',
|
69
|
+
'cleanup_telemetry_resources',
|
61
70
|
]
|
62
71
|
|
63
72
|
# Add performance monitoring to __all__ if available
|
@@ -81,6 +90,7 @@ if PERFORMANCE_MONITORING_AVAILABLE:
|
|
81
90
|
'get_slowest_functions',
|
82
91
|
'get_slowest_apis',
|
83
92
|
'clear_performance_data',
|
93
|
+
'export_external_apm_metrics',
|
84
94
|
'analyze_function_flow',
|
85
95
|
'visualize_execution_flow',
|
86
96
|
'analyze_performance_trends',
|
@@ -114,6 +124,24 @@ def force_shutdown_telemetry():
|
|
114
124
|
_force_shutdown_telemetry()
|
115
125
|
|
116
126
|
|
127
|
+
def enable_performance_mode():
|
128
|
+
"""Enable performance mode for minimal telemetry overhead."""
|
129
|
+
from .integration import enable_performance_mode as _enable_performance_mode
|
130
|
+
_enable_performance_mode()
|
131
|
+
|
132
|
+
|
133
|
+
def disable_performance_mode():
|
134
|
+
"""Disable performance mode to resume full telemetry tracking."""
|
135
|
+
from .integration import disable_performance_mode as _disable_performance_mode
|
136
|
+
_disable_performance_mode()
|
137
|
+
|
138
|
+
|
139
|
+
def cleanup_telemetry_resources():
|
140
|
+
"""Clean up telemetry resources including thread pools and queues."""
|
141
|
+
from .integration import cleanup_telemetry_resources as _cleanup_telemetry_resources
|
142
|
+
_cleanup_telemetry_resources()
|
143
|
+
|
144
|
+
|
117
145
|
# Auto-instrumentation and cleanup setup
|
118
146
|
_initialized = False
|
119
147
|
_atexit_registered = False
|