1. Packages
  2. Datadog
  3. API Docs
  4. MetricTagConfiguration
Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi

datadog.MetricTagConfiguration

Explore with Pulumi AI

datadog logo
Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi

    Provides a Datadog metric tag configuration resource. This can be used to modify tag configurations for metrics.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        // Manage a tag configuration for a Datadog distribution metric with/without percentiles
        var exampleDistMetric = new Datadog.MetricTagConfiguration("exampleDistMetric", new()
        {
            IncludePercentiles = false,
            MetricName = "example.terraform.dist.metric",
            MetricType = "distribution",
            Tags = new[]
            {
                "sport",
                "datacenter",
            },
        });
    
        // Manage tag configurations for a Datadog count or gauge metric
        var exampleCountMetric = new Datadog.MetricTagConfiguration("exampleCountMetric", new()
        {
            Aggregations = new[]
            {
                new Datadog.Inputs.MetricTagConfigurationAggregationArgs
                {
                    Space = "min",
                    Time = "avg",
                },
                new Datadog.Inputs.MetricTagConfigurationAggregationArgs
                {
                    Space = "max",
                    Time = "avg",
                },
            },
            MetricName = "example.terraform.count.metric",
            MetricType = "count",
            Tags = new[]
            {
                "sport",
                "datacenter",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datadog.NewMetricTagConfiguration(ctx, "exampleDistMetric", &datadog.MetricTagConfigurationArgs{
    			IncludePercentiles: pulumi.Bool(false),
    			MetricName:         pulumi.String("example.terraform.dist.metric"),
    			MetricType:         pulumi.String("distribution"),
    			Tags: pulumi.StringArray{
    				pulumi.String("sport"),
    				pulumi.String("datacenter"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = datadog.NewMetricTagConfiguration(ctx, "exampleCountMetric", &datadog.MetricTagConfigurationArgs{
    			Aggregations: datadog.MetricTagConfigurationAggregationArray{
    				&datadog.MetricTagConfigurationAggregationArgs{
    					Space: pulumi.String("min"),
    					Time:  pulumi.String("avg"),
    				},
    				&datadog.MetricTagConfigurationAggregationArgs{
    					Space: pulumi.String("max"),
    					Time:  pulumi.String("avg"),
    				},
    			},
    			MetricName: pulumi.String("example.terraform.count.metric"),
    			MetricType: pulumi.String("count"),
    			Tags: pulumi.StringArray{
    				pulumi.String("sport"),
    				pulumi.String("datacenter"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.MetricTagConfiguration;
    import com.pulumi.datadog.MetricTagConfigurationArgs;
    import com.pulumi.datadog.inputs.MetricTagConfigurationAggregationArgs;
    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) {
            var exampleDistMetric = new MetricTagConfiguration("exampleDistMetric", MetricTagConfigurationArgs.builder()        
                .includePercentiles(false)
                .metricName("example.terraform.dist.metric")
                .metricType("distribution")
                .tags(            
                    "sport",
                    "datacenter")
                .build());
    
            var exampleCountMetric = new MetricTagConfiguration("exampleCountMetric", MetricTagConfigurationArgs.builder()        
                .aggregations(            
                    MetricTagConfigurationAggregationArgs.builder()
                        .space("min")
                        .time("avg")
                        .build(),
                    MetricTagConfigurationAggregationArgs.builder()
                        .space("max")
                        .time("avg")
                        .build())
                .metricName("example.terraform.count.metric")
                .metricType("count")
                .tags(            
                    "sport",
                    "datacenter")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_datadog as datadog
    
    # Manage a tag configuration for a Datadog distribution metric with/without percentiles
    example_dist_metric = datadog.MetricTagConfiguration("exampleDistMetric",
        include_percentiles=False,
        metric_name="example.terraform.dist.metric",
        metric_type="distribution",
        tags=[
            "sport",
            "datacenter",
        ])
    # Manage tag configurations for a Datadog count or gauge metric
    example_count_metric = datadog.MetricTagConfiguration("exampleCountMetric",
        aggregations=[
            datadog.MetricTagConfigurationAggregationArgs(
                space="min",
                time="avg",
            ),
            datadog.MetricTagConfigurationAggregationArgs(
                space="max",
                time="avg",
            ),
        ],
        metric_name="example.terraform.count.metric",
        metric_type="count",
        tags=[
            "sport",
            "datacenter",
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    // Manage a tag configuration for a Datadog distribution metric with/without percentiles
    const exampleDistMetric = new datadog.MetricTagConfiguration("exampleDistMetric", {
        includePercentiles: false,
        metricName: "example.terraform.dist.metric",
        metricType: "distribution",
        tags: [
            "sport",
            "datacenter",
        ],
    });
    // Manage tag configurations for a Datadog count or gauge metric
    const exampleCountMetric = new datadog.MetricTagConfiguration("exampleCountMetric", {
        aggregations: [
            {
                space: "min",
                time: "avg",
            },
            {
                space: "max",
                time: "avg",
            },
        ],
        metricName: "example.terraform.count.metric",
        metricType: "count",
        tags: [
            "sport",
            "datacenter",
        ],
    });
    
    resources:
      # Manage a tag configuration for a Datadog distribution metric with/without percentiles
      exampleDistMetric:
        type: datadog:MetricTagConfiguration
        properties:
          includePercentiles: false
          metricName: example.terraform.dist.metric
          metricType: distribution
          tags:
            - sport
            - datacenter
      # Manage tag configurations for a Datadog count or gauge metric
      exampleCountMetric:
        type: datadog:MetricTagConfiguration
        properties:
          aggregations:
            - space: min
              time: avg
            - space: max
              time: avg
          metricName: example.terraform.count.metric
          metricType: count
          tags:
            - sport
            - datacenter
    

    Create MetricTagConfiguration Resource

    new MetricTagConfiguration(name: string, args: MetricTagConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def MetricTagConfiguration(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               aggregations: Optional[Sequence[MetricTagConfigurationAggregationArgs]] = None,
                               include_percentiles: Optional[bool] = None,
                               metric_name: Optional[str] = None,
                               metric_type: Optional[str] = None,
                               tags: Optional[Sequence[str]] = None)
    @overload
    def MetricTagConfiguration(resource_name: str,
                               args: MetricTagConfigurationArgs,
                               opts: Optional[ResourceOptions] = None)
    func NewMetricTagConfiguration(ctx *Context, name string, args MetricTagConfigurationArgs, opts ...ResourceOption) (*MetricTagConfiguration, error)
    public MetricTagConfiguration(string name, MetricTagConfigurationArgs args, CustomResourceOptions? opts = null)
    public MetricTagConfiguration(String name, MetricTagConfigurationArgs args)
    public MetricTagConfiguration(String name, MetricTagConfigurationArgs args, CustomResourceOptions options)
    
    type: datadog:MetricTagConfiguration
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args MetricTagConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MetricTagConfigurationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MetricTagConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MetricTagConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MetricTagConfigurationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    MetricTagConfiguration Resource Properties

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

    Inputs

    The MetricTagConfiguration resource accepts the following input properties:

    MetricName string

    The metric name for this resource.

    MetricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    Tags List<string>

    A list of tag keys that will be queryable for your metric.

    Aggregations List<MetricTagConfigurationAggregation>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    IncludePercentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    MetricName string

    The metric name for this resource.

    MetricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    Tags []string

    A list of tag keys that will be queryable for your metric.

    Aggregations []MetricTagConfigurationAggregationArgs

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    IncludePercentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName String

    The metric name for this resource.

    metricType String

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags List<String>

    A list of tag keys that will be queryable for your metric.

    aggregations List<MetricTagConfigurationAggregation>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles Boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName string

    The metric name for this resource.

    metricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags string[]

    A list of tag keys that will be queryable for your metric.

    aggregations MetricTagConfigurationAggregation[]

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metric_name str

    The metric name for this resource.

    metric_type str

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags Sequence[str]

    A list of tag keys that will be queryable for your metric.

    aggregations Sequence[MetricTagConfigurationAggregationArgs]

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    include_percentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName String

    The metric name for this resource.

    metricType String

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags List<String>

    A list of tag keys that will be queryable for your metric.

    aggregations List<Property Map>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles Boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MetricTagConfiguration 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 MetricTagConfiguration Resource

    Get an existing MetricTagConfiguration 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?: MetricTagConfigurationState, opts?: CustomResourceOptions): MetricTagConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            aggregations: Optional[Sequence[MetricTagConfigurationAggregationArgs]] = None,
            include_percentiles: Optional[bool] = None,
            metric_name: Optional[str] = None,
            metric_type: Optional[str] = None,
            tags: Optional[Sequence[str]] = None) -> MetricTagConfiguration
    func GetMetricTagConfiguration(ctx *Context, name string, id IDInput, state *MetricTagConfigurationState, opts ...ResourceOption) (*MetricTagConfiguration, error)
    public static MetricTagConfiguration Get(string name, Input<string> id, MetricTagConfigurationState? state, CustomResourceOptions? opts = null)
    public static MetricTagConfiguration get(String name, Output<String> id, MetricTagConfigurationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Aggregations List<MetricTagConfigurationAggregation>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    IncludePercentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    MetricName string

    The metric name for this resource.

    MetricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    Tags List<string>

    A list of tag keys that will be queryable for your metric.

    Aggregations []MetricTagConfigurationAggregationArgs

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    IncludePercentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    MetricName string

    The metric name for this resource.

    MetricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    Tags []string

    A list of tag keys that will be queryable for your metric.

    aggregations List<MetricTagConfigurationAggregation>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles Boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName String

    The metric name for this resource.

    metricType String

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags List<String>

    A list of tag keys that will be queryable for your metric.

    aggregations MetricTagConfigurationAggregation[]

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName string

    The metric name for this resource.

    metricType string

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags string[]

    A list of tag keys that will be queryable for your metric.

    aggregations Sequence[MetricTagConfigurationAggregationArgs]

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    include_percentiles bool

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metric_name str

    The metric name for this resource.

    metric_type str

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags Sequence[str]

    A list of tag keys that will be queryable for your metric.

    aggregations List<Property Map>

    A list of queryable aggregation combinations for a count, rate, or gauge metric. By default, count and rate metrics require the (time: sum, space: sum) aggregation and gauge metrics require the (time: avg, space: avg) aggregation. Can only be applied to metrics that have a metric_type of count, rate, or gauge.

    includePercentiles Boolean

    Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a metric_type of distribution.

    metricName String

    The metric name for this resource.

    metricType String

    The metric's type. This field can't be updated after creation. Valid values are gauge, count, rate, distribution.

    tags List<String>

    A list of tag keys that will be queryable for your metric.

    Supporting Types

    MetricTagConfigurationAggregation, MetricTagConfigurationAggregationArgs

    Space string

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    Time string

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    Space string

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    Time string

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    space String

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    time String

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    space string

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    time string

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    space str

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    time str

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    space String

    A space aggregation for use in query. Valid values are avg, max, min, sum.

    time String

    A time aggregation for use in query. Valid values are avg, count, max, min, sum.

    Import

     $ pulumi import datadog:index/metricTagConfiguration:MetricTagConfiguration example_dist_metric example.terraform.dist.metric
    

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the datadog Terraform Provider.

    datadog logo
    Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi