Skip to content

Conversation

@dussault-antoine
Copy link
Contributor

@dussault-antoine dussault-antoine commented Mar 25, 2025

What does this PR do? What is the motivation?

Trace level retention filter docs

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:
Merge queue is enabled in this repo. Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass in CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

To have your PR automatically merged after it receives the required reviews, add the following PR comment:

/merge

Additional notes

@dussault-antoine dussault-antoine requested a review from a team as a code owner March 25, 2025 15:19
@github-actions github-actions bot added the Images Images are added/removed with this PR label Mar 25, 2025
@github-actions
Copy link
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@maycmlee maycmlee added the editorial review Waiting on a more in-depth review label Mar 25, 2025
@maycmlee
Copy link
Contributor

Created a docs card for review.

Copy link
Contributor

@brett0000FF brett0000FF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this content! This is an awesome new feature. Please take a look at my suggestions and let me know what you think. I'll do a quick review again once you review my suggestions. 🚀

[14]: /monitors/types/apm/?tab=traceanalytics
[15]: /synthetics/apm/
[16]: /security/application_security/
[17]: /dynamic_instrumentation/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[17]: /dynamic_instrumentation/
[17]: /dynamic_instrumentation/
[18]: https://app.datadoghq.com/apm/traces/retention-filters

This is connected to my suggestion on line 114.

5. Save the new filter.

Filters are retained in a serial order. If you have an upstream filter that retains spans with the `resource:POST /hello_world` tag, those spans do not show up in the **Edit** window of a downstream filter that searches for spans with the same tag because they have been retained by the upstream filter.
**Note**: Configuring a trace rate might increase significantly your indexed spans usage. For instance, if you configure a retention filter to index spans from `service:my-service`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Note**: Configuring a trace rate might increase significantly your indexed spans usage. For instance, if you configure a retention filter to index spans from `service:my-service`:
<div class="alert alert-danger">Configuring a trace rate can significantly increase your indexed spans usage.</div>
For example, if you configure a retention filter to index spans from `service:my-service`:

I think this could be worth bringing extra attention to with a danger alert box.

Comment on lines 121 to 122
- Configuring a span rate of `100%` will ensure that all spans matching `service:my-service` will get indexed.
- Configuring a trace rate of `50%` will ensure that all spans from all traces with a span from `service:my-service` will get indexed. Assuming traces have 100 spans in average and 5 spans from `service:my-service`, configuring a trace rate will index the remaining 95 spans of the trace, for the trace rate percentage being configured.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Configuring a span rate of `100%` will ensure that all spans matching `service:my-service` will get indexed.
- Configuring a trace rate of `50%` will ensure that all spans from all traces with a span from `service:my-service` will get indexed. Assuming traces have 100 spans in average and 5 spans from `service:my-service`, configuring a trace rate will index the remaining 95 spans of the trace, for the trace rate percentage being configured.
- Configuring a span rate of `100%` ensures that all spans matching `service:my-service` are indexed.
- Configuring a trace rate of `50%` ensures that all spans from all traces with a span from `service:my-service` are indexed. Assuming traces have 100 spans in average and 5 spans from `service:my-service`, configuring a trace rate indexes the remaining 95 spans of the trace, for the trace rate percentage being configured.

Tense fixes flagged by Vale.

By default, spans indexed by custom retention filters **and** the intelligent retention filter are included in the Trace Explorer [aggregated views][6] (timeseries, toplist, table), as well as in dashboards and notebook queries.

However, because the diversity-sampled set of data is **not uniformly sampled** (that is, not proportionally representative of the full traffic) and is biased towards errors and high latency traces, you can choose to exclude these spans from these views by adding `-retained_by:diversity_sampling` query parameter to the query.
Spans indexed by custom retention filters **without a trace rate**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Spans indexed by custom retention filters **without a trace rate**

Is this needed? Seems like the thought was cut off.

Co-authored-by: Brett Blue <84536271+brett0000FF@users.noreply.github.com>


In addition to these, you can create any number of additional [custom tag-based retention filters](#create-your-own-retention-filter) for your services, to capture the data that matters the most to your business.
After spans have been ingested, some are kept for 15 days according to the retention filters are set up on your account:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After spans have been ingested, some are kept for 15 days according to the retention filters are set up on your account:
After spans have been ingested, some are kept for 15 days according to the retention filters that are set up on your account:


In addition to these, you can create any number of additional [custom tag-based retention filters](#create-your-own-retention-filter) for your services, to capture the data that matters the most to your business.
After spans have been ingested, some are kept for 15 days according to the retention filters are set up on your account:
1. The **[Intelligent Retention Filter](#datadog-intelligent-retention-filter)** retains spans for every environment, service, operation, and resource for different latency distributions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. The **[Intelligent Retention Filter](#datadog-intelligent-retention-filter)** retains spans for every environment, service, operation, and resource for different latency distributions.
1. The **[Intelligent Retention Filter](#datadog-intelligent-retention-filter)** retains spans for every environment, service, operation, and resource across different latency distributions.

@brett0000FF
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Apr 3, 2025

View all feedbacks in Devflow UI.

2025-04-03 14:51:04 UTC ℹ️ Start processing command /merge


2025-04-03 14:51:23 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 26m (p90).


2025-04-03 15:09:37 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 0f88f9a into master Apr 3, 2025
17 of 19 checks passed
@dd-mergequeue dd-mergequeue bot deleted the antoine.dussault/trace_level_retention_filters branch April 3, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial review Waiting on a more in-depth review Images Images are added/removed with this PR mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants