Skip to content

Commit

Permalink
Update retention filters public API (#2263)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Apr 11, 2024
1 parent 204f9aa commit f43626d
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-10 19:44:53.237097",
"spec_repo_commit": "3fb610b5"
"regenerated": "2024-04-11 15:35:28.968495",
"spec_repo_commit": "8ffb168c"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-10 19:44:53.256577",
"spec_repo_commit": "3fb610b5"
"regenerated": "2024-04-11 15:35:28.986152",
"spec_repo_commit": "8ffb168c"
}
}
}
52 changes: 48 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16072,6 +16072,7 @@ components:
- spans-sampling-processor
- spans-errors-sampling-processor
- spans-appsec-sampling-processor
example: spans-sampling-processor
type: string
x-enum-varnames:
- SPANS_SAMPLING_PROCESSOR
Expand Down Expand Up @@ -16188,11 +16189,42 @@ components:
type: string
x-enum-varnames:
- SPANS_SAMPLING_PROCESSOR
RetentionFilterUpdateAttributes:
description: The object describing the configuration of the retention filter
to create/update.
properties:
enabled:
description: Enable/Disable the retention filter.
example: true
type: boolean
filter:
$ref: '#/components/schemas/SpansFilterCreate'
filter_type:
$ref: '#/components/schemas/RetentionFilterAllType'
name:
description: The name of the retention filter.
example: my retention filter
type: string
rate:
description: 'Sample rate to apply to spans going through this retention
filter,

a value of 1.0 keeps all spans matching the query.'
example: 1.0
format: double
type: number
required:
- name
- filter
- enabled
- filter_type
- rate
type: object
RetentionFilterUpdateData:
description: The body of the retention filter to be updated.
properties:
attributes:
$ref: '#/components/schemas/RetentionFilterCreateAttributes'
$ref: '#/components/schemas/RetentionFilterUpdateAttributes'
id:
description: The ID of the retention filter.
example: retention-filter-id
Expand Down Expand Up @@ -23271,7 +23303,11 @@ paths:
post:
description: 'Create a retention filter to index spans in your organization.

Returns the retention filter definition when the request is successful.'
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.'
operationId: CreateApmRetentionFilter
requestBody:
content:
Expand Down Expand Up @@ -23325,7 +23361,11 @@ paths:
x-codegen-request-body-name: body
/api/v2/apm/config/retention-filters/{filter_id}:
delete:
description: Delete a specific retention filter from your organization.
description: 'Delete a specific retention filter from your organization.


Default filters with types spans-errors-sampling-processor and spans-appsec-sampling-processor
cannot be deleted.'
operationId: DeleteApmRetentionFilter
parameters:
- $ref: '#/components/parameters/RetentionFilterIdParam'
Expand Down Expand Up @@ -23363,7 +23403,11 @@ paths:
tags:
- APM Retention Filters
put:
description: Update a retention filter from your organization.
description: '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.'
operationId: UpdateApmRetentionFilter
parameters:
- $ref: '#/components/parameters/RetentionFilterIdParam'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ApmRetentionFiltersApi;
import com.datadog.api.client.v2.model.ApmRetentionFilterType;
import com.datadog.api.client.v2.model.RetentionFilterCreateAttributes;
import com.datadog.api.client.v2.model.RetentionFilterAllType;
import com.datadog.api.client.v2.model.RetentionFilterResponse;
import com.datadog.api.client.v2.model.RetentionFilterType;
import com.datadog.api.client.v2.model.RetentionFilterUpdateAttributes;
import com.datadog.api.client.v2.model.RetentionFilterUpdateData;
import com.datadog.api.client.v2.model.RetentionFilterUpdateRequest;
import com.datadog.api.client.v2.model.SpansFilterCreate;
Expand All @@ -24,13 +24,13 @@ public static void main(String[] args) {
.data(
new RetentionFilterUpdateData()
.attributes(
new RetentionFilterCreateAttributes()
new RetentionFilterUpdateAttributes()
.name("test")
.rate(0.9)
.filter(
new SpansFilterCreate().query("@_top_level:1 test:service-demo"))
.enabled(true)
.filterType(RetentionFilterType.SPANS_SAMPLING_PROCESSOR))
.filterType(RetentionFilterAllType.SPANS_SAMPLING_PROCESSOR))
.id("test-id")
.type(ApmRetentionFilterType.apm_retention_filter));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public CompletableFuture<RetentionFilterResponse> createApmRetentionFilterAsync(
* Create a retention filter to index spans in your organization. Returns the retention filter
* definition when the request is successful.
*
* <p>Default filters with types spans-errors-sampling-processor and
* spans-appsec-sampling-processor cannot be created.
*
* @param body The definition of the new retention filter. (required)
* @return ApiResponse&lt;RetentionFilterResponse&gt;
* @throws ApiException if fails to make API call
Expand Down Expand Up @@ -213,6 +216,9 @@ public CompletableFuture<Void> deleteApmRetentionFilterAsync(String filterId) {
/**
* Delete a specific retention filter from your organization.
*
* <p>Default filters with types spans-errors-sampling-processor and
* spans-appsec-sampling-processor cannot be deleted.
*
* @param filterId The ID of the retention filter. (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException if fails to make API call
Expand Down Expand Up @@ -731,6 +737,9 @@ public CompletableFuture<RetentionFilterResponse> updateApmRetentionFilterAsync(
/**
* Update a retention filter from your organization.
*
* <p>Default filters (filters with types spans-errors-sampling-processor and
* spans-appsec-sampling-processor) cannot be renamed or removed.
*
* @param filterId The ID of the retention filter. (required)
* @param body The updated definition of the retention filter. (required)
* @return ApiResponse&lt;RetentionFilterResponse&gt;
Expand Down
Loading

0 comments on commit f43626d

Please sign in to comment.