datadog.SpansMetric
Explore with Pulumi AI
Provides a Datadog SpansMetric resource. This can be used to create and manage Datadog spans_metric.
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.SpansMetric;
import com.pulumi.datadog.SpansMetricArgs;
import com.pulumi.datadog.inputs.SpansMetricGroupByArgs;
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 new spans_metric resource
var testingSpansMetric = new SpansMetric("testingSpansMetric", SpansMetricArgs.builder()
.name("testing.span.metric")
.compute(SpansMetricComputeArgs.builder()
.aggregationType("distribution")
.includePercentiles(false)
.path("@duration")
.build())
.filter(SpansMetricFilterArgs.builder()
.query("@http.status_code:200 service:my-service")
.build())
.groupBies(SpansMetricGroupByArgs.builder()
.path("resource_name")
.tagName("resource_name")
.build())
.build());
}
}
resources:
# Create new spans_metric resource
testingSpansMetric:
type: datadog:SpansMetric
name: testing_spans_metric
properties:
name: testing.span.metric
compute:
- aggregationType: distribution
includePercentiles: false
path: '@duration'
filter:
- query: '@http.status_code:200 service:my-service'
groupBies:
- path: resource_name
tagName: resource_name
Create SpansMetric Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SpansMetric(name: string, args: SpansMetricArgs, opts?: CustomResourceOptions);
@overload
def SpansMetric(resource_name: str,
args: SpansMetricArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SpansMetric(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
compute: Optional[SpansMetricComputeArgs] = None,
filter: Optional[SpansMetricFilterArgs] = None,
group_bies: Optional[Sequence[SpansMetricGroupByArgs]] = None)
func NewSpansMetric(ctx *Context, name string, args SpansMetricArgs, opts ...ResourceOption) (*SpansMetric, error)
public SpansMetric(string name, SpansMetricArgs args, CustomResourceOptions? opts = null)
public SpansMetric(String name, SpansMetricArgs args)
public SpansMetric(String name, SpansMetricArgs args, CustomResourceOptions options)
type: datadog:SpansMetric
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SpansMetricArgs
- 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 SpansMetricArgs
- 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 SpansMetricArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpansMetricArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SpansMetricArgs
- 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 spansMetricResource = new Datadog.SpansMetric("spansMetricResource", new()
{
Name = "string",
Compute = new Datadog.Inputs.SpansMetricComputeArgs
{
AggregationType = "string",
IncludePercentiles = false,
Path = "string",
},
Filter = new Datadog.Inputs.SpansMetricFilterArgs
{
Query = "string",
},
GroupBies = new[]
{
new Datadog.Inputs.SpansMetricGroupByArgs
{
Path = "string",
TagName = "string",
},
},
});
example, err := datadog.NewSpansMetric(ctx, "spansMetricResource", &datadog.SpansMetricArgs{
Name: pulumi.String("string"),
Compute: &datadog.SpansMetricComputeArgs{
AggregationType: pulumi.String("string"),
IncludePercentiles: pulumi.Bool(false),
Path: pulumi.String("string"),
},
Filter: &datadog.SpansMetricFilterArgs{
Query: pulumi.String("string"),
},
GroupBies: datadog.SpansMetricGroupByArray{
&datadog.SpansMetricGroupByArgs{
Path: pulumi.String("string"),
TagName: pulumi.String("string"),
},
},
})
var spansMetricResource = new SpansMetric("spansMetricResource", SpansMetricArgs.builder()
.name("string")
.compute(SpansMetricComputeArgs.builder()
.aggregationType("string")
.includePercentiles(false)
.path("string")
.build())
.filter(SpansMetricFilterArgs.builder()
.query("string")
.build())
.groupBies(SpansMetricGroupByArgs.builder()
.path("string")
.tagName("string")
.build())
.build());
spans_metric_resource = datadog.SpansMetric("spansMetricResource",
name="string",
compute={
"aggregation_type": "string",
"include_percentiles": False,
"path": "string",
},
filter={
"query": "string",
},
group_bies=[{
"path": "string",
"tag_name": "string",
}])
const spansMetricResource = new datadog.SpansMetric("spansMetricResource", {
name: "string",
compute: {
aggregationType: "string",
includePercentiles: false,
path: "string",
},
filter: {
query: "string",
},
groupBies: [{
path: "string",
tagName: "string",
}],
});
type: datadog:SpansMetric
properties:
compute:
aggregationType: string
includePercentiles: false
path: string
filter:
query: string
groupBies:
- path: string
tagName: string
name: string
SpansMetric 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 SpansMetric resource accepts the following input properties:
- Name string
- The name of the span-based metric. This field can't be updated after creation.
- Compute
Spans
Metric Compute - Filter
Spans
Metric Filter - Group
Bies List<SpansMetric Group By>
- Name string
- The name of the span-based metric. This field can't be updated after creation.
- Compute
Spans
Metric Compute Args - Filter
Spans
Metric Filter Args - Group
Bies []SpansMetric Group By Args
- name String
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute - filter
Spans
Metric Filter - group
Bies List<SpansMetric Group By>
- name string
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute - filter
Spans
Metric Filter - group
Bies SpansMetric Group By[]
- name str
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute Args - filter
Spans
Metric Filter Args - group_
bies Sequence[SpansMetric Group By Args]
- name String
- The name of the span-based metric. This field can't be updated after creation.
- compute Property Map
- filter Property Map
- group
Bies List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the SpansMetric 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 SpansMetric Resource
Get an existing SpansMetric 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?: SpansMetricState, opts?: CustomResourceOptions): SpansMetric
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compute: Optional[SpansMetricComputeArgs] = None,
filter: Optional[SpansMetricFilterArgs] = None,
group_bies: Optional[Sequence[SpansMetricGroupByArgs]] = None,
name: Optional[str] = None) -> SpansMetric
func GetSpansMetric(ctx *Context, name string, id IDInput, state *SpansMetricState, opts ...ResourceOption) (*SpansMetric, error)
public static SpansMetric Get(string name, Input<string> id, SpansMetricState? state, CustomResourceOptions? opts = null)
public static SpansMetric get(String name, Output<String> id, SpansMetricState 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.
- Compute
Spans
Metric Compute - Filter
Spans
Metric Filter - Group
Bies List<SpansMetric Group By> - Name string
- The name of the span-based metric. This field can't be updated after creation.
- Compute
Spans
Metric Compute Args - Filter
Spans
Metric Filter Args - Group
Bies []SpansMetric Group By Args - Name string
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute - filter
Spans
Metric Filter - group
Bies List<SpansMetric Group By> - name String
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute - filter
Spans
Metric Filter - group
Bies SpansMetric Group By[] - name string
- The name of the span-based metric. This field can't be updated after creation.
- compute
Spans
Metric Compute Args - filter
Spans
Metric Filter Args - group_
bies Sequence[SpansMetric Group By Args] - name str
- The name of the span-based metric. This field can't be updated after creation.
- compute Property Map
- filter Property Map
- group
Bies List<Property Map> - name String
- The name of the span-based metric. This field can't be updated after creation.
Supporting Types
SpansMetricCompute, SpansMetricComputeArgs
- Aggregation
Type string - The type of aggregation to use. This field can't be updated after creation.
- Include
Percentiles bool - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - Path string
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
- Aggregation
Type string - The type of aggregation to use. This field can't be updated after creation.
- Include
Percentiles bool - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - Path string
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
- aggregation
Type String - The type of aggregation to use. This field can't be updated after creation.
- include
Percentiles Boolean - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - path String
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
- aggregation
Type string - The type of aggregation to use. This field can't be updated after creation.
- include
Percentiles boolean - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - path string
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
- aggregation_
type str - The type of aggregation to use. This field can't be updated after creation.
- include_
percentiles bool - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - path str
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
- aggregation
Type String - The type of aggregation to use. This field can't be updated after creation.
- include
Percentiles Boolean - Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the
aggregation_type
isdistribution
. - path String
- The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution"). This field can't be updated after creation.
SpansMetricFilter, SpansMetricFilterArgs
- Query string
- The search query - following the span search syntax. Defaults to
"*"
.
- Query string
- The search query - following the span search syntax. Defaults to
"*"
.
- query String
- The search query - following the span search syntax. Defaults to
"*"
.
- query string
- The search query - following the span search syntax. Defaults to
"*"
.
- query str
- The search query - following the span search syntax. Defaults to
"*"
.
- query String
- The search query - following the span search syntax. Defaults to
"*"
.
SpansMetricGroupBy, SpansMetricGroupByArgs
Import
$ pulumi import datadog:index/spansMetric:SpansMetric testing_spans_metric testing.span.metric
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.