Skip to content

Commit f43626d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update retention filters public API (#2263)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 204f9aa commit f43626d

File tree

9 files changed

+378
-17
lines changed

9 files changed

+378
-17
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-04-10 19:44:53.237097",
8-
"spec_repo_commit": "3fb610b5"
7+
"regenerated": "2024-04-11 15:35:28.968495",
8+
"spec_repo_commit": "8ffb168c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-10 19:44:53.256577",
13-
"spec_repo_commit": "3fb610b5"
12+
"regenerated": "2024-04-11 15:35:28.986152",
13+
"spec_repo_commit": "8ffb168c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16072,6 +16072,7 @@ components:
1607216072
- spans-sampling-processor
1607316073
- spans-errors-sampling-processor
1607416074
- spans-appsec-sampling-processor
16075+
example: spans-sampling-processor
1607516076
type: string
1607616077
x-enum-varnames:
1607716078
- SPANS_SAMPLING_PROCESSOR
@@ -16188,11 +16189,42 @@ components:
1618816189
type: string
1618916190
x-enum-varnames:
1619016191
- SPANS_SAMPLING_PROCESSOR
16192+
RetentionFilterUpdateAttributes:
16193+
description: The object describing the configuration of the retention filter
16194+
to create/update.
16195+
properties:
16196+
enabled:
16197+
description: Enable/Disable the retention filter.
16198+
example: true
16199+
type: boolean
16200+
filter:
16201+
$ref: '#/components/schemas/SpansFilterCreate'
16202+
filter_type:
16203+
$ref: '#/components/schemas/RetentionFilterAllType'
16204+
name:
16205+
description: The name of the retention filter.
16206+
example: my retention filter
16207+
type: string
16208+
rate:
16209+
description: 'Sample rate to apply to spans going through this retention
16210+
filter,
16211+
16212+
a value of 1.0 keeps all spans matching the query.'
16213+
example: 1.0
16214+
format: double
16215+
type: number
16216+
required:
16217+
- name
16218+
- filter
16219+
- enabled
16220+
- filter_type
16221+
- rate
16222+
type: object
1619116223
RetentionFilterUpdateData:
1619216224
description: The body of the retention filter to be updated.
1619316225
properties:
1619416226
attributes:
16195-
$ref: '#/components/schemas/RetentionFilterCreateAttributes'
16227+
$ref: '#/components/schemas/RetentionFilterUpdateAttributes'
1619616228
id:
1619716229
description: The ID of the retention filter.
1619816230
example: retention-filter-id
@@ -23271,7 +23303,11 @@ paths:
2327123303
post:
2327223304
description: 'Create a retention filter to index spans in your organization.
2327323305

23274-
Returns the retention filter definition when the request is successful.'
23306+
Returns the retention filter definition when the request is successful.
23307+
23308+
23309+
Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor
23310+
cannot be created.'
2327523311
operationId: CreateApmRetentionFilter
2327623312
requestBody:
2327723313
content:
@@ -23325,7 +23361,11 @@ paths:
2332523361
x-codegen-request-body-name: body
2332623362
/api/v2/apm/config/retention-filters/{filter_id}:
2332723363
delete:
23328-
description: Delete a specific retention filter from your organization.
23364+
description: 'Delete a specific retention filter from your organization.
23365+
23366+
23367+
Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor
23368+
cannot be deleted.'
2332923369
operationId: DeleteApmRetentionFilter
2333023370
parameters:
2333123371
- $ref: '#/components/parameters/RetentionFilterIdParam'
@@ -23363,7 +23403,11 @@ paths:
2336323403
tags:
2336423404
- APM Retention Filters
2336523405
put:
23366-
description: Update a retention filter from your organization.
23406+
description: 'Update a retention filter from your organization.
23407+
23408+
23409+
Default filters (filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor)
23410+
cannot be renamed or removed.'
2336723411
operationId: UpdateApmRetentionFilter
2336823412
parameters:
2336923413
- $ref: '#/components/parameters/RetentionFilterIdParam'

examples/v2/apm-retention-filters/UpdateApmRetentionFilter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.ApmRetentionFiltersApi;
66
import com.datadog.api.client.v2.model.ApmRetentionFilterType;
7-
import com.datadog.api.client.v2.model.RetentionFilterCreateAttributes;
7+
import com.datadog.api.client.v2.model.RetentionFilterAllType;
88
import com.datadog.api.client.v2.model.RetentionFilterResponse;
9-
import com.datadog.api.client.v2.model.RetentionFilterType;
9+
import com.datadog.api.client.v2.model.RetentionFilterUpdateAttributes;
1010
import com.datadog.api.client.v2.model.RetentionFilterUpdateData;
1111
import com.datadog.api.client.v2.model.RetentionFilterUpdateRequest;
1212
import com.datadog.api.client.v2.model.SpansFilterCreate;
@@ -24,13 +24,13 @@ public static void main(String[] args) {
2424
.data(
2525
new RetentionFilterUpdateData()
2626
.attributes(
27-
new RetentionFilterCreateAttributes()
27+
new RetentionFilterUpdateAttributes()
2828
.name("test")
2929
.rate(0.9)
3030
.filter(
3131
new SpansFilterCreate().query("@_top_level:1 test:service-demo"))
3232
.enabled(true)
33-
.filterType(RetentionFilterType.SPANS_SAMPLING_PROCESSOR))
33+
.filterType(RetentionFilterAllType.SPANS_SAMPLING_PROCESSOR))
3434
.id("test-id")
3535
.type(ApmRetentionFilterType.apm_retention_filter));
3636

src/main/java/com/datadog/api/client/v2/api/ApmRetentionFiltersApi.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public CompletableFuture<RetentionFilterResponse> createApmRetentionFilterAsync(
8282
* Create a retention filter to index spans in your organization. Returns the retention filter
8383
* definition when the request is successful.
8484
*
85+
* <p>Default filters with types spans-errors-sampling-processor and
86+
* spans-appsec-sampling-processor cannot be created.
87+
*
8588
* @param body The definition of the new retention filter. (required)
8689
* @return ApiResponse&lt;RetentionFilterResponse&gt;
8790
* @throws ApiException if fails to make API call
@@ -213,6 +216,9 @@ public CompletableFuture<Void> deleteApmRetentionFilterAsync(String filterId) {
213216
/**
214217
* Delete a specific retention filter from your organization.
215218
*
219+
* <p>Default filters with types spans-errors-sampling-processor and
220+
* spans-appsec-sampling-processor cannot be deleted.
221+
*
216222
* @param filterId The ID of the retention filter. (required)
217223
* @return ApiResponse&lt;Void&gt;
218224
* @throws ApiException if fails to make API call
@@ -731,6 +737,9 @@ public CompletableFuture<RetentionFilterResponse> updateApmRetentionFilterAsync(
731737
/**
732738
* Update a retention filter from your organization.
733739
*
740+
* <p>Default filters (filters with types spans-errors-sampling-processor and
741+
* spans-appsec-sampling-processor) cannot be renamed or removed.
742+
*
734743
* @param filterId The ID of the retention filter. (required)
735744
* @param body The updated definition of the retention filter. (required)
736745
* @return ApiResponse&lt;RetentionFilterResponse&gt;

0 commit comments

Comments
 (0)