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. (apm_retention_filter) (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_idGet an APM retention filter.
list_apm_retention_filtersselectGet the list of APM retention filters.
create_apm_retention_filterinsertdataCreate a retention filter to index spans in your organization.<br />Returns the retention filter definition when the request is successful.<br /><br />Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be created.
update_apm_retention_filterreplacefilter_id, dataUpdate a retention filter from your organization.<br /><br />Default filters (filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor) cannot be renamed or removed.
delete_apm_retention_filterdeletefilter_idDelete a specific retention filter from your organization.<br /><br />Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be deleted.
reorder_apm_retention_filtersexecdataRe-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.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Get an APM retention filter.

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

INSERT examples

Create a retention filter to index spans in your organization.<br />Returns the retention filter definition when the request is successful.<br /><br />Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor cannot be created.

INSERT INTO datadog.apm.retention_filters (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

REPLACE examples

Update a retention filter from your organization.<br /><br />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 }}'
WHERE
filter_id = '{{ filter_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific retention filter from your organization.<br /><br />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
;

Lifecycle Methods

EXEC variables use wire (API) names.

Re-order the execution order of retention filters.

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