Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "2025-04-08 14:37:45.449200",
"spec_repo_commit": "642b7d0b"
"regenerated": "2025-04-08 20:00:43.803169",
"spec_repo_commit": "3e2afa30"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-08 14:37:45.465050",
"spec_repo_commit": "642b7d0b"
"regenerated": "2025-04-08 20:00:43.818345",
"spec_repo_commit": "3e2afa30"
}
}
}
32 changes: 32 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25238,6 +25238,14 @@ components:
example: 1.0
format: double
type: number
trace_rate:
description: 'Sample rate to apply to traces containing spans going through
this retention filter.

A value of 1.0 keeps all traces with spans matching the query.'
example: 1.0
format: double
type: number
type: object
RetentionFilterAllType:
default: spans-sampling-processor
Expand Down Expand Up @@ -25297,6 +25305,14 @@ components:
example: 1.0
format: double
type: number
trace_rate:
description: 'Sample rate to apply to traces containing spans going through
this retention filter.

A value of 1.0 keeps all traces with spans matching the query.'
example: 1.0
format: double
type: number
type: object
RetentionFilterCreateAttributes:
description: The object describing the configuration of the retention filter
Expand All @@ -25322,6 +25338,14 @@ components:
example: 1.0
format: double
type: number
trace_rate:
description: 'Sample rate to apply to traces containing spans going through
this retention filter.

A value of 1.0 keeps all traces with spans matching the query.'
example: 1.0
format: double
type: number
required:
- name
- filter
Expand Down Expand Up @@ -25393,6 +25417,14 @@ components:
example: 1.0
format: double
type: number
trace_rate:
description: 'Sample rate to apply to traces containing spans going through
this retention filter.

A value of 1.0 keeps all traces with spans matching the query.'
example: 1.0
format: double
type: number
required:
- name
- filter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Create a retention filter with trace rate returns "OK" response

import com.datadog.api.client.ApiClient;
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.RetentionFilterCreateData;
import com.datadog.api.client.v2.model.RetentionFilterCreateRequest;
import com.datadog.api.client.v2.model.RetentionFilterCreateResponse;
import com.datadog.api.client.v2.model.RetentionFilterType;
import com.datadog.api.client.v2.model.SpansFilterCreate;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
ApmRetentionFiltersApi apiInstance = new ApmRetentionFiltersApi(defaultClient);

RetentionFilterCreateRequest body =
new RetentionFilterCreateRequest()
.data(
new RetentionFilterCreateData()
.attributes(
new RetentionFilterCreateAttributes()
.enabled(true)
.filter(
new SpansFilterCreate()
.query("@http.status_code:200 service:my-service"))
.filterType(RetentionFilterType.SPANS_SAMPLING_PROCESSOR)
.name("my retention filter")
.rate(1.0)
.traceRate(1.0))
.type(ApmRetentionFilterType.apm_retention_filter));

try {
RetentionFilterCreateResponse result = apiInstance.createApmRetentionFilter(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApmRetentionFiltersApi#createApmRetentionFilter");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Update a retention filter with trace rate returns "OK" response

import com.datadog.api.client.ApiClient;
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.RetentionFilterAllType;
import com.datadog.api.client.v2.model.RetentionFilterResponse;
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;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
ApmRetentionFiltersApi apiInstance = new ApmRetentionFiltersApi(defaultClient);

// there is a valid "retention_filter" in the system
String RETENTION_FILTER_DATA_ID = System.getenv("RETENTION_FILTER_DATA_ID");

RetentionFilterUpdateRequest body =
new RetentionFilterUpdateRequest()
.data(
new RetentionFilterUpdateData()
.attributes(
new RetentionFilterUpdateAttributes()
.name("test")
.rate(0.9)
.traceRate(1.0)
.filter(
new SpansFilterCreate().query("@_top_level:1 test:service-demo"))
.enabled(true)
.filterType(RetentionFilterAllType.SPANS_SAMPLING_PROCESSOR))
.id("test-id")
.type(ApmRetentionFilterType.apm_retention_filter));

try {
RetentionFilterResponse result =
apiInstance.updateApmRetentionFilter(RETENTION_FILTER_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApmRetentionFiltersApi#updateApmRetentionFilter");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
RetentionFilterAllAttributes.JSON_PROPERTY_MODIFIED_AT,
RetentionFilterAllAttributes.JSON_PROPERTY_MODIFIED_BY,
RetentionFilterAllAttributes.JSON_PROPERTY_NAME,
RetentionFilterAllAttributes.JSON_PROPERTY_RATE
RetentionFilterAllAttributes.JSON_PROPERTY_RATE,
RetentionFilterAllAttributes.JSON_PROPERTY_TRACE_RATE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand Down Expand Up @@ -67,6 +68,9 @@ public class RetentionFilterAllAttributes {
public static final String JSON_PROPERTY_RATE = "rate";
private Double rate;

public static final String JSON_PROPERTY_TRACE_RATE = "trace_rate";
private Double traceRate;

public RetentionFilterAllAttributes createdAt(Long createdAt) {
this.createdAt = createdAt;
return this;
Expand Down Expand Up @@ -304,6 +308,28 @@ public void setRate(Double rate) {
this.rate = rate;
}

public RetentionFilterAllAttributes traceRate(Double traceRate) {
this.traceRate = traceRate;
return this;
}

/**
* Sample rate to apply to traces containing spans going through this retention filter. A value of
* 1.0 keeps all traces with spans matching the query.
*
* @return traceRate
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TRACE_RATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Double getTraceRate() {
return traceRate;
}

public void setTraceRate(Double traceRate) {
this.traceRate = traceRate;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -371,6 +397,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.modifiedBy, retentionFilterAllAttributes.modifiedBy)
&& Objects.equals(this.name, retentionFilterAllAttributes.name)
&& Objects.equals(this.rate, retentionFilterAllAttributes.rate)
&& Objects.equals(this.traceRate, retentionFilterAllAttributes.traceRate)
&& Objects.equals(
this.additionalProperties, retentionFilterAllAttributes.additionalProperties);
}
Expand All @@ -389,6 +416,7 @@ public int hashCode() {
modifiedBy,
name,
rate,
traceRate,
additionalProperties);
}

Expand All @@ -407,6 +435,7 @@ public String toString() {
sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" rate: ").append(toIndentedString(rate)).append("\n");
sb.append(" traceRate: ").append(toIndentedString(traceRate)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
RetentionFilterAttributes.JSON_PROPERTY_MODIFIED_AT,
RetentionFilterAttributes.JSON_PROPERTY_MODIFIED_BY,
RetentionFilterAttributes.JSON_PROPERTY_NAME,
RetentionFilterAttributes.JSON_PROPERTY_RATE
RetentionFilterAttributes.JSON_PROPERTY_RATE,
RetentionFilterAttributes.JSON_PROPERTY_TRACE_RATE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand Down Expand Up @@ -67,6 +68,9 @@ public class RetentionFilterAttributes {
public static final String JSON_PROPERTY_RATE = "rate";
private Double rate;

public static final String JSON_PROPERTY_TRACE_RATE = "trace_rate";
private Double traceRate;

public RetentionFilterAttributes createdAt(Long createdAt) {
this.createdAt = createdAt;
return this;
Expand Down Expand Up @@ -304,6 +308,28 @@ public void setRate(Double rate) {
this.rate = rate;
}

public RetentionFilterAttributes traceRate(Double traceRate) {
this.traceRate = traceRate;
return this;
}

/**
* Sample rate to apply to traces containing spans going through this retention filter. A value of
* 1.0 keeps all traces with spans matching the query.
*
* @return traceRate
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TRACE_RATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Double getTraceRate() {
return traceRate;
}

public void setTraceRate(Double traceRate) {
this.traceRate = traceRate;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -371,6 +397,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.modifiedBy, retentionFilterAttributes.modifiedBy)
&& Objects.equals(this.name, retentionFilterAttributes.name)
&& Objects.equals(this.rate, retentionFilterAttributes.rate)
&& Objects.equals(this.traceRate, retentionFilterAttributes.traceRate)
&& Objects.equals(
this.additionalProperties, retentionFilterAttributes.additionalProperties);
}
Expand All @@ -389,6 +416,7 @@ public int hashCode() {
modifiedBy,
name,
rate,
traceRate,
additionalProperties);
}

Expand All @@ -407,6 +435,7 @@ public String toString() {
sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" rate: ").append(toIndentedString(rate)).append("\n");
sb.append(" traceRate: ").append(toIndentedString(traceRate)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
RetentionFilterCreateAttributes.JSON_PROPERTY_FILTER,
RetentionFilterCreateAttributes.JSON_PROPERTY_FILTER_TYPE,
RetentionFilterCreateAttributes.JSON_PROPERTY_NAME,
RetentionFilterCreateAttributes.JSON_PROPERTY_RATE
RetentionFilterCreateAttributes.JSON_PROPERTY_RATE,
RetentionFilterCreateAttributes.JSON_PROPERTY_TRACE_RATE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand All @@ -44,6 +45,9 @@ public class RetentionFilterCreateAttributes {
public static final String JSON_PROPERTY_RATE = "rate";
private Double rate;

public static final String JSON_PROPERTY_TRACE_RATE = "trace_rate";
private Double traceRate;

public RetentionFilterCreateAttributes() {}

@JsonCreator
Expand Down Expand Up @@ -169,6 +173,28 @@ public void setRate(Double rate) {
this.rate = rate;
}

public RetentionFilterCreateAttributes traceRate(Double traceRate) {
this.traceRate = traceRate;
return this;
}

/**
* Sample rate to apply to traces containing spans going through this retention filter. A value of
* 1.0 keeps all traces with spans matching the query.
*
* @return traceRate
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TRACE_RATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Double getTraceRate() {
return traceRate;
}

public void setTraceRate(Double traceRate) {
this.traceRate = traceRate;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -231,13 +257,14 @@ public boolean equals(Object o) {
&& Objects.equals(this.filterType, retentionFilterCreateAttributes.filterType)
&& Objects.equals(this.name, retentionFilterCreateAttributes.name)
&& Objects.equals(this.rate, retentionFilterCreateAttributes.rate)
&& Objects.equals(this.traceRate, retentionFilterCreateAttributes.traceRate)
&& Objects.equals(
this.additionalProperties, retentionFilterCreateAttributes.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(enabled, filter, filterType, name, rate, additionalProperties);
return Objects.hash(enabled, filter, filterType, name, rate, traceRate, additionalProperties);
}

@Override
Expand All @@ -249,6 +276,7 @@ public String toString() {
sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" rate: ").append(toIndentedString(rate)).append("\n");
sb.append(" traceRate: ").append(toIndentedString(traceRate)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Loading
Loading