Add improved production UI
This commit is contained in:
@@ -319,11 +319,25 @@ def setup_metrics_early(app, service_name: str = None) -> MetricsCollector:
|
||||
|
||||
# Additional helper function for endpoint tracking
|
||||
def track_endpoint_metrics(endpoint_name: str = None, service_name: str = None):
|
||||
"""Decorator for tracking endpoint metrics"""
|
||||
"""Decorator for tracking endpoint metrics - Fixed for async functions"""
|
||||
def decorator(func):
|
||||
def wrapper(*args, **kwargs):
|
||||
import asyncio
|
||||
from functools import wraps
|
||||
|
||||
@wraps(func)
|
||||
async def async_wrapper(*args, **kwargs):
|
||||
# For now, just pass through - metrics are handled by middleware
|
||||
return await func(*args, **kwargs)
|
||||
|
||||
@wraps(func)
|
||||
def sync_wrapper(*args, **kwargs):
|
||||
# For now, just pass through - metrics are handled by middleware
|
||||
return func(*args, **kwargs)
|
||||
return wrapper
|
||||
|
||||
# Return appropriate wrapper based on function type
|
||||
if asyncio.iscoroutinefunction(func):
|
||||
return async_wrapper
|
||||
else:
|
||||
return sync_wrapper
|
||||
return decorator
|
||||
|
||||
|
||||
Reference in New Issue
Block a user