TLDR Tech / DevOps
Cost Attribution in Discord's API
Discord's engineering team developed a custom CPU profiling system to track hosting costs across its 1,700+ API endpoints by extending their Python profiler to tag code execution time by feature, then joining that data with cloud billing information to accurately allocate infrastructure spending. The system solved the challenge of cost attribution in their unified codebase that runs across hundreds of Kubernetes deployments, giving product teams real-time visibility into how code changes affect operational costs without requiring infrastructure changes.
Read the full story