Improve the frontend
This commit is contained in:
@@ -110,7 +110,10 @@ class BaseFastAPIService:
|
||||
self.metrics_collector = setup_metrics_early(self.app, self.service_name)
|
||||
|
||||
# Setup distributed tracing
|
||||
if self.enable_tracing:
|
||||
# Check both constructor flag and environment variable
|
||||
tracing_enabled = self.enable_tracing and os.getenv("ENABLE_TRACING", "true").lower() == "true"
|
||||
|
||||
if tracing_enabled:
|
||||
try:
|
||||
jaeger_endpoint = os.getenv(
|
||||
"JAEGER_COLLECTOR_ENDPOINT",
|
||||
@@ -120,6 +123,8 @@ class BaseFastAPIService:
|
||||
self.logger.info(f"Distributed tracing enabled for {self.service_name}")
|
||||
except Exception as e:
|
||||
self.logger.warning(f"Failed to setup tracing, continuing without it: {e}")
|
||||
else:
|
||||
self.logger.info(f"Distributed tracing disabled for {self.service_name}")
|
||||
|
||||
# Setup lifespan
|
||||
self.app.router.lifespan_context = self._create_lifespan()
|
||||
|
||||
Reference in New Issue
Block a user