anderson-ufrj commited on
Commit
0bfbae0
·
1 Parent(s): 386e9aa

fix: resolve encoding and monitoring configuration issues

Browse files

Fixed two critical issues preventing HuggingFace deployment:

1. Unicode encoding error in src/memory/__init__.py
- Removed special character from "Cidadão" in docstring
- This was causing SyntaxError on module import

2. Missing Jaeger configuration handling
- Added check for jaeger_host attribute existence
- Skip distributed tracing setup when Jaeger not configured
- Prevents AttributeError in HuggingFace environment

These fixes ensure the application starts correctly in environments
without full monitoring stack configuration.

Files changed (2) hide show
  1. src/core/monitoring.py +5 -0
  2. src/memory/__init__.py +1 -1
src/core/monitoring.py CHANGED
@@ -396,6 +396,11 @@ class DistributedTracing:
396
  def setup_tracing(self):
397
  """Setup OpenTelemetry distributed tracing."""
398
  try:
 
 
 
 
 
399
  # Configure tracer provider
400
  self.tracer_provider = TracerProvider()
401
  trace.set_tracer_provider(self.tracer_provider)
 
396
  def setup_tracing(self):
397
  """Setup OpenTelemetry distributed tracing."""
398
  try:
399
+ # Skip tracing setup if Jaeger settings not available
400
+ if not hasattr(settings, 'jaeger_host'):
401
+ logger.info("Jaeger configuration not found, skipping distributed tracing setup")
402
+ return
403
+
404
  # Configure tracer provider
405
  self.tracer_provider = TracerProvider()
406
  trace.set_tracer_provider(self.tracer_provider)
src/memory/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- """Memory system for Cidad�o.AI agents.
2
 
3
  This module provides memory management capabilities for AI agents including:
4
  - Episodic memory for specific events and investigations
 
1
+ """Memory system for Cidadao.AI agents.
2
 
3
  This module provides memory management capabilities for AI agents including:
4
  - Episodic memory for specific events and investigations