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. (apm_retention_filter) (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. (apm_retention_filter) (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 | Get an APM retention filter. | |
list_apm_retention_filters | select | Get the list of APM retention filters. | ||
create_apm_retention_filter | insert | data | 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. | |
update_apm_retention_filter | replace | filter_id, data | 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. | |
delete_apm_retention_filter | delete | filter_id | 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. | |
reorder_apm_retention_filters | exec | 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. |
site | string | The 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_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
;
Get the list of APM retention filters.
SELECT
id,
attributes,
type
FROM datadog.apm.retention_filters
;
INSERT examples
- create_apm_retention_filter
- Manifest
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
;
# Description fields are for documentation purposes
- name: retention_filters
props:
- name: data
description: |
The body of the retention filter to be created.
value:
attributes:
enabled: {{ enabled }}
filter:
query: "{{ query }}"
filter_type: "{{ filter_type }}"
name: "{{ name }}"
rate: {{ rate }}
trace_rate: {{ trace_rate }}
type: "{{ type }}"
REPLACE examples
- update_apm_retention_filter
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_apm_retention_filter
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.
- reorder_apm_retention_filters
Re-order the execution order of retention filters.
EXEC datadog.apm.retention_filters.reorder_apm_retention_filters
@@json=
'{
"data": "{{ data }}"
}'
;