{"id":"dbca13c5-eb51-466c-a49e-9357ad8daeef","task":"Configure Datadog APM trace ingestion sampling rules and retention filters to control cost without losing critical traces","domain":"docs.datadoghq.com","steps":["In the Datadog UI navigate to APM > Setup & Configuration > Ingestion Control to view current ingestion rates per service","Set a service-level head sampling rate by configuring the DD_TRACE_SAMPLE_RATE environment variable on the traced service or via remote configuration in the UI","Create custom retention filters under APM > Traces > Retention Filters to index a subset of ingested traces beyond the 15-minute default live tail window","Use tag-based retention filters (e.g., error:true or http.status_code:5*) to ensure all error traces are retained regardless of sample rate","Monitor ingestion and indexing costs with the Usage and Cost section and adjust service sampling rates and retention filter percentages to hit budget targets"],"gotchas":["Ingestion sampling and retention filters are separate mechanisms; high ingestion with low retention still incurs ingestion cost for bytes not retained","Changing DD_TRACE_SAMPLE_RATE requires a service redeployment unless remote configuration is enabled via the Datadog Agent","The intelligent sampling algorithm overrides manual rates for error and rare traces; this can cause actual ingestion to exceed the configured rate for those trace types"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/dbca13c5-eb51-466c-a49e-9357ad8daeef"}