1. Packages
  2. Datadog Provider
  3. API Docs
  4. ApmRetentionFilter
Datadog v4.48.1 published on Saturday, Apr 5, 2025 by Pulumi

datadog.ApmRetentionFilter

Explore with Pulumi AI

The object describing the configuration of the retention filter to create/update.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.ApmRetentionFilter;
import com.pulumi.datadog.ApmRetentionFilterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Create APM retention filter
        var foo = new ApmRetentionFilter("foo", ApmRetentionFilterArgs.builder()
            .name("Sample order")
            .rate("1.0")
            .filter(ApmRetentionFilterFilterArgs.builder()
                .query("service:sample AND env:production AND @http.method:GET AND app:sampleapp AND @http.status_code:200 AND @duration:>600000000")
                .build())
            .filterType("spans-sampling-processor")
            .enabled(false)
            .build());

    }
}
Copy
resources:
  # Create APM retention filter
  foo:
    type: datadog:ApmRetentionFilter
    properties:
      name: Sample order
      rate: '1.0'
      filter:
        - query: service:sample AND env:production AND @http.method:GET AND app:sampleapp AND @http.status_code:200 AND @duration:>600000000
      filterType: spans-sampling-processor
      enabled: false
Copy

Create ApmRetentionFilter Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ApmRetentionFilter(name: string, args: ApmRetentionFilterArgs, opts?: CustomResourceOptions);
@overload
def ApmRetentionFilter(resource_name: str,
                       args: ApmRetentionFilterArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def ApmRetentionFilter(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       enabled: Optional[bool] = None,
                       filter_type: Optional[str] = None,
                       name: Optional[str] = None,
                       rate: Optional[str] = None,
                       filter: Optional[ApmRetentionFilterFilterArgs] = None)
func NewApmRetentionFilter(ctx *Context, name string, args ApmRetentionFilterArgs, opts ...ResourceOption) (*ApmRetentionFilter, error)
public ApmRetentionFilter(string name, ApmRetentionFilterArgs args, CustomResourceOptions? opts = null)
public ApmRetentionFilter(String name, ApmRetentionFilterArgs args)
public ApmRetentionFilter(String name, ApmRetentionFilterArgs args, CustomResourceOptions options)
type: datadog:ApmRetentionFilter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ApmRetentionFilterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ApmRetentionFilterArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ApmRetentionFilterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApmRetentionFilterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ApmRetentionFilterArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var apmRetentionFilterResource = new Datadog.ApmRetentionFilter("apmRetentionFilterResource", new()
{
    Enabled = false,
    FilterType = "string",
    Name = "string",
    Rate = "string",
    Filter = new Datadog.Inputs.ApmRetentionFilterFilterArgs
    {
        Query = "string",
    },
});
Copy
example, err := datadog.NewApmRetentionFilter(ctx, "apmRetentionFilterResource", &datadog.ApmRetentionFilterArgs{
	Enabled:    pulumi.Bool(false),
	FilterType: pulumi.String("string"),
	Name:       pulumi.String("string"),
	Rate:       pulumi.String("string"),
	Filter: &datadog.ApmRetentionFilterFilterArgs{
		Query: pulumi.String("string"),
	},
})
Copy
var apmRetentionFilterResource = new ApmRetentionFilter("apmRetentionFilterResource", ApmRetentionFilterArgs.builder()
    .enabled(false)
    .filterType("string")
    .name("string")
    .rate("string")
    .filter(ApmRetentionFilterFilterArgs.builder()
        .query("string")
        .build())
    .build());
Copy
apm_retention_filter_resource = datadog.ApmRetentionFilter("apmRetentionFilterResource",
    enabled=False,
    filter_type="string",
    name="string",
    rate="string",
    filter={
        "query": "string",
    })
Copy
const apmRetentionFilterResource = new datadog.ApmRetentionFilter("apmRetentionFilterResource", {
    enabled: false,
    filterType: "string",
    name: "string",
    rate: "string",
    filter: {
        query: "string",
    },
});
Copy
type: datadog:ApmRetentionFilter
properties:
    enabled: false
    filter:
        query: string
    filterType: string
    name: string
    rate: string
Copy

ApmRetentionFilter Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ApmRetentionFilter resource accepts the following input properties:

Enabled This property is required. bool
the status of the retention filter.
FilterType This property is required. string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
Name This property is required. string
The name of the retention filter.
Rate This property is required. string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
Filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
Enabled This property is required. bool
the status of the retention filter.
FilterType This property is required. string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
Name This property is required. string
The name of the retention filter.
Rate This property is required. string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
Filter ApmRetentionFilterFilterArgs
The spans filter. Spans matching this filter will be indexed and stored.
enabled This property is required. Boolean
the status of the retention filter.
filterType This property is required. String
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name This property is required. String
The name of the retention filter.
rate This property is required. String
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
enabled This property is required. boolean
the status of the retention filter.
filterType This property is required. string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name This property is required. string
The name of the retention filter.
rate This property is required. string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
enabled This property is required. bool
the status of the retention filter.
filter_type This property is required. str
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name This property is required. str
The name of the retention filter.
rate This property is required. str
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
filter ApmRetentionFilterFilterArgs
The spans filter. Spans matching this filter will be indexed and stored.
enabled This property is required. Boolean
the status of the retention filter.
filterType This property is required. String
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name This property is required. String
The name of the retention filter.
rate This property is required. String
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
filter Property Map
The spans filter. Spans matching this filter will be indexed and stored.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApmRetentionFilter resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ApmRetentionFilter Resource

Get an existing ApmRetentionFilter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApmRetentionFilterState, opts?: CustomResourceOptions): ApmRetentionFilter
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        filter: Optional[ApmRetentionFilterFilterArgs] = None,
        filter_type: Optional[str] = None,
        name: Optional[str] = None,
        rate: Optional[str] = None) -> ApmRetentionFilter
func GetApmRetentionFilter(ctx *Context, name string, id IDInput, state *ApmRetentionFilterState, opts ...ResourceOption) (*ApmRetentionFilter, error)
public static ApmRetentionFilter Get(string name, Input<string> id, ApmRetentionFilterState? state, CustomResourceOptions? opts = null)
public static ApmRetentionFilter get(String name, Output<String> id, ApmRetentionFilterState state, CustomResourceOptions options)
resources:  _:    type: datadog:ApmRetentionFilter    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Enabled bool
the status of the retention filter.
Filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
FilterType string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
Name string
The name of the retention filter.
Rate string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
Enabled bool
the status of the retention filter.
Filter ApmRetentionFilterFilterArgs
The spans filter. Spans matching this filter will be indexed and stored.
FilterType string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
Name string
The name of the retention filter.
Rate string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
enabled Boolean
the status of the retention filter.
filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
filterType String
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name String
The name of the retention filter.
rate String
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
enabled boolean
the status of the retention filter.
filter ApmRetentionFilterFilter
The spans filter. Spans matching this filter will be indexed and stored.
filterType string
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name string
The name of the retention filter.
rate string
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
enabled bool
the status of the retention filter.
filter ApmRetentionFilterFilterArgs
The spans filter. Spans matching this filter will be indexed and stored.
filter_type str
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name str
The name of the retention filter.
rate str
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.
enabled Boolean
the status of the retention filter.
filter Property Map
The spans filter. Spans matching this filter will be indexed and stored.
filterType String
The type of the retention filter, currently only spans-processing-sampling is available. Valid values are spans-sampling-processor.
name String
The name of the retention filter.
rate String
Sample rate to apply to spans going through this retention filter as a string, a value of 1.0 keeps all spans matching the query. Value must be between 0.00 and 1.00.

Supporting Types

ApmRetentionFilterFilter
, ApmRetentionFilterFilterArgs

Query string
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".
Query string
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".
query String
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".
query string
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".
query str
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".
query String
The search query - follow the span search syntax, use AND between tags and \ to escape special characters, use nanosecond for duration. Defaults to "*".

Import

Import existing APM retention filter

$ pulumi import datadog:index/apmRetentionFilter:ApmRetentionFilter foo <filter_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.