================================================================================
RECORD_PREDICTION() HOT PATH ANALYSIS
================================================================================

Top 20 functions by cumulative time:
--------------------------------------------------------------------------------
         264317 function calls in 0.230 seconds

   Ordered by: cumulative time
   List reduced from 138 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1000    0.006    0.000    0.234    0.000 client.py:1243(record_prediction)
     1000    0.002    0.000    0.133    0.000 __init__.py:1467(info)
     1000    0.002    0.000    0.130    0.000 __init__.py:1600(_log)
     1000    0.001    0.000    0.097    0.000 __init__.py:1626(handle)
     1000    0.002    0.000    0.096    0.000 __init__.py:1680(callHandlers)
     1000    0.002    0.000    0.094    0.000 __init__.py:955(handle)
     1000    0.002    0.000    0.090    0.000 __init__.py:571(emit)
     2000    0.003    0.000    0.068    0.000 measurement_consumer.py:80(consume_measurement)
     2000    0.004    0.000    0.060    0.000 metric_reader_storage.py:116(consume_measurement)
     1000    0.002    0.000    0.059    0.000 __init__.py:619(emit)
     2000    0.011    0.000    0.055    0.000 _view_instrument_match.py:91(consume_measurement)
     1000    0.002    0.000    0.050    0.000 __init__.py:275(_from_api_log_record)
     1000    0.002    0.000    0.048    0.000 <string>:2(__init__)
     1000    0.002    0.000    0.042    0.000 instrument.py:251(record)
     1000    0.002    0.000    0.037    0.000 __init__.py:247(__post_init__)
     1000    0.002    0.000    0.035    0.000 instrument.py:160(add)
     1001    0.005    0.000    0.034    0.000 __init__.py:246(__init__)
     8000    0.014    0.000    0.027    0.000 __init__.py:281(__setitem__)
     1000    0.004    0.000    0.026    0.000 __init__.py:1585(makeRecord)
     1000    0.005    0.000    0.024    0.000 __init__.py:527(_translate)



================================================================================
OPTIMIZATION OPPORTUNITIES
================================================================================

Review functions with high cumulative time:
- Attribute validation
- Metric recording
- OTel span creation
- Serialization


================================================================================
TRACE() CONTEXT MANAGER HOT PATH ANALYSIS
================================================================================

Top 20 functions by cumulative time:
--------------------------------------------------------------------------------
         113513 function calls (106513 primitive calls) in 0.089 seconds

   Ordered by: cumulative time
   List reduced from 79 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
6000/2000    0.003    0.000    0.081    0.000 {built-in method builtins.next}
     2000    0.002    0.000    0.080    0.000 client.py:1898(trace)
     2000    0.003    0.000    0.074    0.000 __init__.py:1076(start_as_current_span)
     1000    0.001    0.000    0.064    0.000 contextlib.py:130(__enter__)
2000/1000    0.001    0.000    0.060    0.000 _decorator.py:54(__enter__)
     1000    0.011    0.000    0.050    0.000 __init__.py:1107(start_span)
3000/1000    0.007    0.000    0.023    0.000 contextlib.py:139(__exit__)
     2000    0.002    0.000    0.017    0.000 __init__.py:565(use_span)
     1000    0.003    0.000    0.013    0.000 __init__.py:764(__init__)
     1000    0.002    0.000    0.011    0.000 __init__.py:938(end)
     3000    0.006    0.000    0.011    0.000 __init__.py:38(get_current_span)
     1000    0.002    0.000    0.009    0.000 sampling.py:339(should_sample)
     1000    0.001    0.000    0.006    0.000 __init__.py:173(on_end)
     1000    0.002    0.000    0.005    0.000 __init__.py:190(on_end)
     1000    0.001    0.000    0.005    0.000 sampling.py:223(should_sample)
     3000    0.002    0.000    0.004    0.000 __init__.py:85(get_value)
     1000    0.004    0.000    0.004    0.000 __init__.py:758(__new__)
     1000    0.003    0.000    0.004    0.000 __init__.py:246(__init__)
     3000    0.003    0.000    0.004    0.000 contextlib.py:102(__init__)
     2000    0.001    0.000    0.004    0.000 _decorator.py:80(helper)



================================================================================
SPAN CREATION BOTTLENECKS
================================================================================

Review OpenTelemetry span creation overhead:
- Span initialization
- Context propagation
- Attribute attachment

