retention_filters
Creates, updates, deletes, gets or lists a retention_filters resource.
Overview
| Name | retention_filters | 
| Type | Resource | 
| Id | datadog.apm.retention_filters | 
Fields
The following fields are returned by SELECT queries:
- get_apm_retention_filter
- list_apm_retention_filters
| Name | Datatype | Description | 
|---|---|---|
| id | string | The ID of the retention filter. (example: 7RBOb7dLSYWI01yc3pIH8w) | 
| attributes | object | The attributes of the retention filter. | 
| type | string | The type of the resource. (default: apm_retention_filter, example: apm_retention_filter) | 
| Name | Datatype | Description | 
|---|---|---|
| id | string | The ID of the retention filter. (example: 7RBOb7dLSYWI01yc3pIH8w) | 
| attributes | object | The attributes of the retention filter. | 
| type | string | The type of the resource. (default: apm_retention_filter, example: apm_retention_filter) | 
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description | 
|---|---|---|---|---|
| get_apm_retention_filter | select | filter_id,region | Get an APM retention filter. | |
| list_apm_retention_filters | select | region | Get the list of APM retention filters. | |
| create_apm_retention_filter | insert | region,data__data | Create a retention filter to index spans in your organization. Returns the retention filter definition when the request is successful. Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be created. | |
| update_apm_retention_filter | replace | filter_id,region,data__data | Update a retention filter from your organization. Default filters (filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor) cannot be renamed or removed. | |
| delete_apm_retention_filter | delete | filter_id,region | Delete a specific retention filter from your organization. Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be deleted. | |
| reorder_apm_retention_filters | exec | region,data | Re-order the execution order of retention filters. | 
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description | 
|---|---|---|
| filter_id | string | The ID of the retention filter. | 
| region | string | (default: datadoghq.com) | 
SELECT examples
- get_apm_retention_filter
- list_apm_retention_filters
Get an APM retention filter.
SELECT
id,
attributes,
type
FROM datadog.apm.retention_filters
WHERE filter_id = '{{ filter_id }}' -- required
AND region = '{{ region }}' -- required
;
Get the list of APM retention filters.
SELECT
id,
attributes,
type
FROM datadog.apm.retention_filters
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_apm_retention_filter
- Manifest
Create a retention filter to index spans in your organization.
Returns the retention filter definition when the request is successful.
Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be created.
INSERT INTO datadog.apm.retention_filters (
data__data,
region
)
SELECT 
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: retention_filters
  props:
    - name: region
      value: string
      description: Required parameter for the retention_filters resource.
    - name: data
      value: object
      description: |
        The body of the retention filter to be created.
REPLACE examples
- update_apm_retention_filter
Update a retention filter from your organization.
Default filters (filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor) cannot be renamed or removed.
REPLACE datadog.apm.retention_filters
SET 
data__data = '{{ data }}'
WHERE 
filter_id = '{{ filter_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_apm_retention_filter
Delete a specific retention filter from your organization.
Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be deleted.
DELETE FROM datadog.apm.retention_filters
WHERE filter_id = '{{ filter_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- reorder_apm_retention_filters
Re-order the execution order of retention filters.
EXEC datadog.apm.retention_filters.reorder_apm_retention_filters 
@region='{{ region }}' --required 
@@json=
'{
"data": "{{ data }}"
}'
;