Embedding Python in Go
summary
Datadog ports its Agent to Go while keeping plugins in Python and builds a Go app that embeds CPython via cgo, proving it works but accumulating nasty runtime failures unless careful. The concrete claims: use cgo, turn off CPython autopilot, manage the GIL manually, and acquire/release it around Python calls. Practical fixes include preventing goroutine migration with runtime.LockOSThread and accepting that embedding Python in Go exposes hard, reproducible threading and GIL pitfalls.
AI-written summary · about








