BlogsDiscordCost Attribution

Cost Attribution

Cost Attribution

1
posts
2026

Discord is developing capabilities to understand and attribute hosting costs to specific product features and API endpoints. This involves extending profiling tooling to allocate deployment costs based on the time spent on feature-related code, aiming to provide granular insights into spending for features like messaging, streaming, and gifting. The initiative now includes detailed cost attribution for API endpoints and background tasks, enabling engineers to understand the cost impact of changes by allocating deployment costs based on feature-related code execution time.

2026

Cost Attribution in Discord’s API

6/30/2026

This post details how Discord extended its application's profiling tooling to allocate hosting costs for its unified Python API codebase. It addresses the challenge of tracking costs across numerous API endpoints and background tasks running on hundreds of Kubernetes deployments by attributing deployment costs based on the time spent on feature-related code, even when a single worker process handles multiple tasks concurrently.