{"id":"027d481f-80bf-4196-a353-932def09dd50","task":"Enable the Datadog Continuous Profiler for a Python or Go application using environment variables and the dd-trace library","domain":"docs.datadoghq.com","steps":["Ensure Datadog Agent v7+ is running with APM enabled (DD_APM_ENABLED=true) and listening on the default port","For Python: install ddtrace, then launch with DD_PROFILING_ENABLED=true DD_ENV=prod DD_SERVICE=my-service DD_VERSION=1.0.0 ddtrace-run python app.py","For Go: import gopkg.in/DataDog/dd-trace-go.v1/profiler, call profiler.Start with profiler.WithService, profiler.WithEnv, and the profile types you want (e.g., profiler.CPUProfile, profiler.HeapProfile), and defer profiler.Stop()","Deploy and let the profiler run for at least a few minutes, then navigate to APM > Profiles in the Datadog UI to see flamegraphs per service","Use the Code Hotspots tab on a slow trace to jump from a specific span directly to the profile that was active during that request","Tag profiles with DD_VERSION to compare profiles across deploys and catch regressions"],"gotchas":["Continuous Profiler is not enabled by default when you install the APM tracing library — you must explicitly set DD_PROFILING_ENABLED=true or call profiler.Start in code","For Python, ddtrace-run patches the process at startup; if you use a custom entry point (e.g., gunicorn), pass --import=ddtrace.auto instead","Profile data is sent to the Agent, not directly to the Datadog backend; if the Agent is unreachable the profiler will buffer and eventually drop data silently"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:40:37.260Z"},"url":"https://mcp.waymark.network/r/027d481f-80bf-4196-a353-932def09dd50"}