Skip to main content

retention_filters

Creates, updates, deletes, gets or lists a retention_filters resource.

Overview

Nameretention_filters
TypeResource
Iddatadog.apm.retention_filters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the retention filter. (example: 7RBOb7dLSYWI01yc3pIH8w)
attributesobjectThe attributes of the retention filter.
typestringThe type of the resource. (default: apm_retention_filter, example: apm_retention_filter)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_apm_retention_filterselectfilter_id, regionGet an APM retention filter.
list_apm_retention_filtersselectregionGet the list of APM retention filters.
create_apm_retention_filterinsertregion, data__dataCreate 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_filterreplacefilter_id, region, data__dataUpdate 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_filterdeletefilter_id, regionDelete 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_filtersexecregion, dataRe-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.

NameDatatypeDescription
filter_idstringThe ID of the retention filter.
regionstring(default: datadoghq.com)

SELECT examples

Get an APM retention filter.

SELECT
id,
attributes,
type
FROM datadog.apm.retention_filters
WHERE filter_id = '{{ filter_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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
;

REPLACE examples

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 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

Re-order the execution order of retention filters.

EXEC datadog.apm.retention_filters.reorder_apm_retention_filters 
@region='{{ region }}' --required
@@json=
'{
"data": "{{ data }}"
}'
;