§
    y¼jÊ  ã                   ó>   — d Z ddlmZ ddlmZmZ g d¢Zd	d„Zd	d„ZdS )
a÷  
Telemetry module for Honcho.

This module consolidates all telemetry, metrics, and observability functionality:
- Sentry: Error tracking and performance tracing
- Prometheus: Pull-based metrics scraped by Fly.io
- CloudEvents: Structured events for analytics (push-based)
- Logging: Langfuse integration, Rich console output, metric accumulation
- Tracing: Sentry transaction decorators
- Metrics Collector: JSON file-based benchmark aggregation
- Reasoning Traces: JSONL logging of LLM inputs/outputs
é    )Úemit)Úmetrics_endpointÚprometheus_metrics)r   Úinitialize_telemetry_asyncr   r   Úshutdown_telemetryÚreturnNc               ƒ   ó^   K  — ddl m}  ddlm} | j        j        r |¦   «         ƒ d{V —† dS dS )aw  
    Initialize async telemetry systems based on configuration.

    This should be called once at application startup (in main.py lifespan).
    It initializes:
    - CloudEvents emitter (if TELEMETRY_ENABLED=true)

    Note: Prometheus metrics are pull-based and require no initialization.
    Sentry is initialized separately in sentry.py as it has its own lifecycle.
    r   )Úsettings)Úinitialize_telemetry_eventsN)Ú
src.configr
   Úsrc.telemetry.eventsr   Ú	TELEMETRYÚENABLED)r
   r   s     ú>/DATA/AppData/hermes/projects/honcho/src/telemetry/__init__.pyr   r      sk   è è € ð $Ð#Ð#Ð#Ð#Ð#Ø@Ð@Ð@Ð@Ð@Ð@àÔÔ!ð ,Ø)Ð)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+ð,ð ,ó    c               ƒ   ó6   K  — ddl m}   | ¦   «         ƒ d{V —† dS )zš
    Shutdown all telemetry systems gracefully.

    This should be called during application shutdown to ensure:
    - CloudEvents buffer is flushed
    r   ©Úshutdown_telemetry_eventsN)r   r   r   s    r   r   r   ,   sC   è è € ð ?Ð>Ð>Ð>Ð>Ð>ð $Ð
#Ñ
%Ô
%Ð%Ð%Ð%Ð%Ð%Ð%Ð%Ð%Ð%r   )r   N)	Ú__doc__r   r   Úsrc.telemetry.prometheusr   r   Ú__all__r   r   © r   r   ú<module>r      s~   ððð ð &Ð %Ð %Ð %Ð %Ð %Ø IÐ IÐ IÐ IÐ IÐ IÐ IÐ Iðð ð €ð,ð ,ð ,ð ,ð$
&ð 
&ð 
&ð 
&ð 
&ð 
&r   