feat(platform): add py-spy profiling support

Add py-spy for production-safe Python profiling across all backend services:
- Add py-spy dependency to pyproject.toml
- Grant SYS_PTRACE capability to Docker services for profiling access
- Enable low-overhead performance monitoring in development and production

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Zamil Majdy
2025-08-12 13:49:01 +07:00
parent 89eb5d1189
commit c168277b1d
2 changed files with 13 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ prisma = "^0.15.0"
prometheus-client = "^0.22.1"
psutil = "^7.0.0"
psycopg2-binary = "^2.9.10"
py-spy = "^0.4.0"
pydantic = { extras = ["email"], version = "^2.11.7" }
pydantic-settings = "^2.10.1"
pytest = "^8.4.1"

View File

@@ -59,6 +59,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.rest"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./
@@ -107,6 +109,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.exec"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./
@@ -154,6 +158,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.ws"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./
@@ -195,6 +201,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.db"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./
@@ -221,6 +229,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.scheduler"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./
@@ -278,6 +288,8 @@ services:
dockerfile: autogpt_platform/backend/Dockerfile
target: server
command: ["python", "-m", "backend.notification"]
cap_add:
- SYS_PTRACE
develop:
watch:
- path: ./