Ë
    dQêjˆ	  ã                   ó`   — d dl Z d dlZd dlmZ  G d„ de j                  «      Z G d„ de«      Zy)é    N)Útracec                   ól   — e Zd Zej                  defd„«       Zej                  defd„«       Zdefd„Z	y)ÚIdGeneratorÚreturnc                  ó   — y)z[Get a new span ID.

        Returns:
            A 64-bit int for use as a span ID
        N© ©Úselfs    úi/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/opentelemetry/sdk/trace/id_generator.pyÚgenerate_span_idzIdGenerator.generate_span_id   ó   � ó    c                  ó   — y)ax  Get a new trace ID.

        Implementations should at least make the 56 least significant bits
        uniformly random. Samplers like the `TraceIdRatioBased` sampler rely on
        this randomness to make sampling decisions.

        If the implementation does randomly generate the 56 least significant bits,
        it should also implement `is_trace_id_random` to return True.

        See `the specification on TraceIdRatioBased <https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#traceidratiobased>`_.

        Returns:
            A 128-bit int for use as a trace ID
        Nr   r	   s    r   Úgenerate_trace_idzIdGenerator.generate_trace_id   r   r   c                  ó   — y)aR  Indicates whether generated trace IDs are random.

        When True, the `trace-id` field will have the `random-trace-id` flag set
        in the W3C traceparent header. Per the W3C Trace Context specification,
        this indicates that at least the 7 rightmost bytes (56 bits) of the
        trace ID were generated randomly with uniform distribution.

        See `the W3C Trace Context specification <https://www.w3.org/TR/trace-context-2/#considerations-for-trace-id-field-generation>`_.

        Returns:
            True if this generator produces random IDs, False otherwise.
        Fr   r	   s    r   Úis_trace_id_randomzIdGenerator.is_trace_id_random%   s   € ð r   N)
Ú__name__Ú
__module__Ú__qualname__ÚabcÚabstractmethodÚintr   r   Úboolr   r   r   r   r   r   
   sN   „ Ø×Ñð #ò ó ðð 	×Ñð 3ò ó ðð" Dô r   r   c                   ó4   — e Zd ZdZdefd„Zdefd„Zdefd„Zy)ÚRandomIdGeneratorzkThe default ID generator for TracerProvider which randomly generates all
    bits when generating IDs.
    r   c                 ó¨   — t        j                  d«      }|t        j                  k(  r)t        j                  d«      }|t        j                  k(  rŒ)|S )Né@   )ÚrandomÚgetrandbitsr   ÚINVALID_SPAN_ID)r
   Úspan_ids     r   r   z"RandomIdGenerator.generate_span_id;   sE   € Ü×$Ñ$ RÓ(ˆØœ×.Ñ.Ò.Ü×(Ñ(¨Ó,ˆGð œ×.Ñ.Ó.àˆr   c                 ó¨   — t        j                  d«      }|t        j                  k(  r)t        j                  d«      }|t        j                  k(  rŒ)|S )Né€   )r   r   r   ÚINVALID_TRACE_ID)r
   Útrace_ids     r   r   z#RandomIdGenerator.generate_trace_idA   sE   € Ü×%Ñ% cÓ*ˆØœ%×0Ñ0Ò0Ü×)Ñ)¨#Ó.ˆHð œ%×0Ñ0Ó0àˆr   c                  ó   — y)NTr   r	   s    r   r   z$RandomIdGenerator.is_trace_id_randomG   s   € Ør   N)	r   r   r   Ú__doc__r   r   r   r   r   r   r   r   r   r   6   s+   „ ñð #ó ð 3ó ð Dô r   r   )r   r   Úopentelemetryr   ÚABCr   r   r   r   r   ú<module>r*      s-   ðó Û å ô)�#—'‘'ô )ôX˜õ r   