Ë
    §Œjs  ã                   óŽ   — d dl mZmZ d dlmZmZmZ 	  G d„ de«      Z G d„ de«      Zdee	   fd„Z
dee	   fd	„Z G d
„ d«      Zy)é    )ÚIntFlagÚauto)ÚListÚOptionalÚSequencec                   ór   — e Zd ZdZ e«       Z e«       Z e«       Z e«       Z e«       Z	 e«       Z
 e«       Zy)ÚMetricGroupz+Metric groups that can be enabled/disabled.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú
RESILIENCYÚCONNECTION_BASICÚCONNECTION_ADVANCEDÚCOMMANDÚCSCÚ	STREAMINGÚPUBSUB© ó    úd/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/redis/observability/config.pyr	   r	      s8   „ Ù5á“€JÙ“vÐÙ›&ÐÙ‹f€GÙ
‹&€CÙ“€IÙ‹V�Fr   r	   c                   ó   — e Zd ZdZ e«       Zy)ÚTelemetryOptionzTelemetry options to export.N)r
   r   r   r   r   ÚMETRICSr   r   r   r   r      s   „ Ù&á‹f�Gr   r   Úreturnc                  ó
   — g d¢S )N)ç-Cëâ6?gü©ñÒMb0?çü©ñÒMb@?çü©ñÒMbP?g{®Gázd?ç{®Gázt?ç{®Gáz„?gš™™™™™™?çš™™™™™©?çš™™™™™¹?g      Ð?ç      à?é   g      @r   r   r   r   Ú"default_operation_duration_bucketsr&      s   € òð r   c                  ó
   — g d¢S )N)r   r   r   r    r!   r"   r#   r$   r%   é   é
   r   r   r   r   Údefault_histogram_bucketsr*   1   s   € ÚIÐIr   c                   ó8  — e Zd ZdZej
                  Zej                  ej                  z  Z
dddddd e«        e«        e«        e«       f
deee      deee      deee      deee      ded	ed
ee   dee   dee   dee   fd„Zdefd„Zdedefd„Zdefd„Zy)Ú
OTelConfiga‰  
    Configuration for OpenTelemetry observability in redis-py.

    This class manages all OTel-related settings including metrics, traces (future),
    and logs (future). Configuration can be provided via constructor parameters or
    environment variables (OTEL_* spec).

    Constructor parameters take precedence over environment variables.

    Args:
        enabled_telemetry: Enabled telemetry options to export (default: metrics). Traces and logs will be added
                           in future phases.
        metric_groups: Group of metrics that should be exported.
        include_commands: Explicit allowlist of commands to track
        exclude_commands: Blocklist of commands to track
        hide_pubsub_channel_names: If True, hide PubSub channel names in metrics (default: False)
        hide_stream_names: If True, hide stream names in streaming metrics (default: False)

    Note:
        Redis-py uses the global MeterProvider set by your application.
        Set it up before initializing observability:

            from opentelemetry import metrics
            from opentelemetry.sdk.metrics import MeterProvider
            from opentelemetry.sdk.metrics._internal.view import View
            from opentelemetry.sdk.metrics._internal.aggregation import ExplicitBucketHistogramAggregation

            # Configure histogram bucket boundaries via Views
            views = [
                View(
                    instrument_name="db.client.operation.duration",
                    aggregation=ExplicitBucketHistogramAggregation(
                        boundaries=[0.0001, 0.00025, 0.0005, 0.001, 0.0025, 0.005,
                                    0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5]
                    ),
                ),
                # Add more views for other histograms...
            ]

            provider = MeterProvider(views=views, metric_readers=[reader])
            metrics.set_meter_provider(provider)

            # Then initialize redis-py observability
            from redis.observability import get_observability_instance, OTelConfig
            otel = get_observability_instance()
            otel.init(OTelConfig())
    NFÚenabled_telemetryÚmetric_groupsÚinclude_commandsÚexclude_commandsÚhide_pubsub_channel_namesÚhide_stream_namesÚbuckets_operation_durationÚ"buckets_stream_processing_durationÚbuckets_connection_create_timeÚbuckets_connection_wait_timec                 ó¸  — |€| j                   | _        n,t        d«      | _        |D ]  }| xj                  |z  c_        Œ |€| j                  | _        n,t        d«      | _        |D ]  }| xj                  |z  c_        Œ |rt        |«      nd | _        |rt        |«      n	t        «       | _        || _	        || _
        || _        || _        |	| _        |
| _        y )Nr   )ÚDEFAULT_TELEMETRYr-   r   ÚDEFAULT_METRIC_GROUPSr.   r	   Úsetr/   r0   r1   r2   r3   r4   r5   r6   )Úselfr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   ÚoptionÚmetric_groups                r   Ú__init__zOTelConfig.__init__i   sÜ   € ð. Ð$Ø%)×%;Ñ%;ˆDÕ"ä%4°QÓ%7ˆDÔ"Û+�Ø×&Ò&¨&Ñ0Ö&ð ,ð Ð Ø!%×!;Ñ!;ˆDÕä!,¨Q£ˆDÔÛ -�Ø×"Ò" lÑ2Ö"ð !.ñ :J¤Ð$4Ô 5ÈtˆÔÙ9I¤Ð$4Ô 5ÌsËuˆÔð *CˆÔ&Ø!2ˆÔð +EˆÔ'Ø2TˆÔ/Ø.LˆÔ+Ø,HˆÕ)r   r   c                 ó,   — t        | j                  «      S )z.Check if any observability feature is enabled.)Úboolr-   ©r;   s    r   Ú
is_enabledzOTelConfig.is_enabled�   s   € ä�D×*Ñ*Ó+Ð+r   Úcommand_namec                 ór   — |j                  «       }| j                  �|| j                  v S || j                  vS )a  
        Determine if a command should be tracked based on include/exclude lists.

        Args:
            command_name: The Redis command name (e.g., 'GET', 'SET')

        Returns:
            True if the command should be tracked, False otherwise
        )Úupperr/   r0   )r;   rC   Úcommand_uppers      r   Úshould_track_commandzOTelConfig.should_track_command¡   sD   € ð %×*Ñ*Ó,ˆð × Ñ Ð,Ø  D×$9Ñ$9Ð9Ð9ð  D×$9Ñ$9Ð9Ð9r   c                 ó    — d| j                   › �S )NzOTelConfig(enabled_telemetry=)r-   rA   s    r   Ú__repr__zOTelConfig.__repr__´   s   € Ø.¨t×/EÑ/EÐ.FÐGÐGr   )r
   r   r   r   r   r   r8   r	   r   r   r9   r&   r*   r   r   Ústrr@   r   Úfloatr>   rB   rG   rI   r   r   r   r,   r,   5   s>  „ ñ.ð` (×/Ñ/ÐØ'×8Ñ8¸;×;QÑ;QÑQÐð
 >Bà59à04Ø04à*/Ø"'ñ /Ó0ñ &Ó'Ù:SÓ:UÙ8QÓ8Sñ)2Ið $ D¨Ñ$9Ñ:ð2Ið
    [Ñ 1Ñ2ð2Ið # 4¨¡9Ñ-ð2Ið # 4¨¡9Ñ-ð2Ið $(ð2Ið  ð2Ið %-Øñ%
ð2Ið  -5Øñ-
ð!2Ið& )1°©ð'2Ið( '/¨u¡oó)2Iðh,˜Dó ,ð:°ð :¸ó :ð&H˜#ô Hr   r,   N)Úenumr   r   Útypingr   r   r   r	   r   rK   r&   r*   r,   r   r   r   Ú<module>rN      s[   ðß ß +Ñ +ðô	�'ô 	ô�gô ð¨H°U©Oó ð&J 8¨E¡?ó J÷@Hò @Hr   