~/talk

The Hitchhiker's Guide to Advanced Python Monitoring

Talkat PyCon Israel 2024 · on Monday, 2024-09-16· [observability, python]
linkedin:may-walterr
links:none on file
slides:none on file

Covers concrete tradeoffs and working techniques across Python versions: settrace/setprofile are comprehensive but too slow for production, import hooks add decorators via AST transforms at load time (shows compile()/ast manipulations and an example that injects decorators into functions), eval hooks intercept frame evaluation for powerful runtime instrumentation but carry safety/performance risks, and PEP 669 in Python 3.12 enables filtered, performant monitoring by registering event-specific callbacks so monitors only touch interesting code paths.

AI-written summary · about

  1. 0:00Introduction to Python monitoring
  2. 1:13Python 1.4 monitoring mechanisms
  3. 3:23sys.settrace limitations
  4. 5:54Python 2.3 import hooks
  5. 8:31Implementing import hooks
  6. 11:26Usage and risks of import hooks
  7. 12:53Python 3.6 eval hooks
  8. 17:21Python 3.12 low-overhead profiling
  9. 19:21Modern monitoring APIs
  10. 21:14Choosing the right tool
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.