The object describing attributes of a RUM retention filter.
cross_product_sampling
object
The configuration for cross-product retention filters.
trace_enabled
boolean
Whether the cross-product retention filter for APM traces is enabled.
trace_sample_rate
double
The sample rate for the APM cross-product retention filter, between 0 and 100.
enabled
boolean
Whether the retention filter is enabled.
event_type
enum
The type of RUM events to filter on.
Allowed enum values: session,view,action,error,resource,long_task,vital
name
string
The name of a RUM retention filter.
query
string
The query string for a RUM retention filter.
sample_rate
double
The sample rate for a RUM retention filter, between 0.1 and 100.
id
string
ID of retention filter in UUID.
type
enum
The type of the resource. The value should always be retention_filters.
Allowed enum values: retention_filters
default: retention_filters
{"data":{"attributes":{"cross_product_sampling":{"trace_enabled":true,"trace_sample_rate":25},"enabled":true,"event_type":"session","name":"Retention filter for session","query":"@session.has_replay:true","sample_rate":50.5},"id":"051601eb-54a0-abc0-03f9-cc02efa18892","type":"retention_filters"}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a RUM retention filter returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.RumRetentionFiltersApi(configuration);constparams: v2.RumRetentionFiltersApiCreateRetentionFilterRequest={body:{data:{type:"retention_filters",attributes:{name:"Test creating retention filter",eventType:"session",query:"custom_query",sampleRate: 50,enabled: true,},},},appId:"a33671aa-24fd-4dcd-ba4b-5bbdbafe7690",};apiInstance.createRetentionFilter(params).then((data: v2.RumRetentionFilterResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));