ServiceLevelObjective

Provides a Datadog service level objective resource. This can be used to create and manage Datadog service level objectives.

Example Usage

Metric-Based SLO

using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new Datadog service level objective
        var foo = new Datadog.ServiceLevelObjective("foo", new Datadog.ServiceLevelObjectiveArgs
        {
            Description = "My custom metric SLO",
            Name = "Example Metric SLO",
            Query = new Datadog.Inputs.ServiceLevelObjectiveQueryArgs
            {
                Denominator = "sum:my.custom.count.metric{*}.as_count()",
                Numerator = "sum:my.custom.count.metric{type:good_events}.as_count()",
            },
            Tags = 
            {
                "foo:bar",
                "baz",
            },
            Thresholds = 
            {
                new Datadog.Inputs.ServiceLevelObjectiveThresholdArgs
                {
                    Target = 99.9,
                    TargetDisplay = "99.900",
                    Timeframe = "7d",
                    Warning = 99.99,
                    WarningDisplay = "99.990",
                },
                new Datadog.Inputs.ServiceLevelObjectiveThresholdArgs
                {
                    Target = 99.9,
                    TargetDisplay = "99.900",
                    Timeframe = "30d",
                    Warning = 99.99,
                    WarningDisplay = "99.990",
                },
            },
            Type = "metric",
        });
    }

}

Coming soon!

import pulumi
import pulumi_datadog as datadog

# Create a new Datadog service level objective
foo = datadog.ServiceLevelObjective("foo",
    description="My custom metric SLO",
    name="Example Metric SLO",
    query={
        "denominator": "sum:my.custom.count.metric{*}.as_count()",
        "numerator": "sum:my.custom.count.metric{type:good_events}.as_count()",
    },
    tags=[
        "foo:bar",
        "baz",
    ],
    thresholds=[
        {
            "target": 99.9,
            "targetDisplay": "99.900",
            "timeframe": "7d",
            "warning": 99.99,
            "warningDisplay": "99.990",
        },
        {
            "target": 99.9,
            "targetDisplay": "99.900",
            "timeframe": "30d",
            "warning": 99.99,
            "warningDisplay": "99.990",
        },
    ],
    type="metric")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

// Create a new Datadog service level objective
const foo = new datadog.ServiceLevelObjective("foo", {
    description: "My custom metric SLO",
    name: "Example Metric SLO",
    query: {
        denominator: "sum:my.custom.count.metric{*}.as_count()",
        numerator: "sum:my.custom.count.metric{type:good_events}.as_count()",
    },
    tags: [
        "foo:bar",
        "baz",
    ],
    thresholds: [
        {
            target: 99.9,
            targetDisplay: "99.900",
            timeframe: "7d",
            warning: 99.99,
            warningDisplay: "99.990",
        },
        {
            target: 99.9,
            targetDisplay: "99.900",
            timeframe: "30d",
            warning: 99.99,
            warningDisplay: "99.990",
        },
    ],
    type: "metric",
});

Monitor-Based SLO

using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new Datadog service level objective
        var bar = new Datadog.ServiceLevelObjective("bar", new Datadog.ServiceLevelObjectiveArgs
        {
            Description = "My custom monitor SLO",
            MonitorIds = 
            {
                1,
                2,
                3,
            },
            Name = "Example Monitor SLO",
            Tags = 
            {
                "foo:bar",
                "baz",
            },
            Thresholds = 
            {
                new Datadog.Inputs.ServiceLevelObjectiveThresholdArgs
                {
                    Target = 99.9,
                    Timeframe = "7d",
                    Warning = 99.99,
                },
                new Datadog.Inputs.ServiceLevelObjectiveThresholdArgs
                {
                    Target = 99.9,
                    Timeframe = "30d",
                    Warning = 99.99,
                },
            },
            Type = "monitor",
        });
    }

}

Coming soon!

import pulumi
import pulumi_datadog as datadog

# Create a new Datadog service level objective
bar = datadog.ServiceLevelObjective("bar",
    description="My custom monitor SLO",
    monitor_ids=[
        1,
        2,
        3,
    ],
    name="Example Monitor SLO",
    tags=[
        "foo:bar",
        "baz",
    ],
    thresholds=[
        {
            "target": 99.9,
            "timeframe": "7d",
            "warning": 99.99,
        },
        {
            "target": 99.9,
            "timeframe": "30d",
            "warning": 99.99,
        },
    ],
    type="monitor")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

// Create a new Datadog service level objective
const bar = new datadog.ServiceLevelObjective("bar", {
    description: "My custom monitor SLO",
    monitorIds: [
        1,
        2,
        3,
    ],
    name: "Example Monitor SLO",
    tags: [
        "foo:bar",
        "baz",
    ],
    thresholds: [
        {
            target: 99.9,
            timeframe: "7d",
            warning: 99.99,
        },
        {
            target: 99.9,
            timeframe: "30d",
            warning: 99.99,
        },
    ],
    type: "monitor",
});

Create a ServiceLevelObjective Resource

def ServiceLevelObjective(resource_name, opts=None, description=None, groups=None, monitor_ids=None, name=None, query=None, tags=None, thresholds=None, type=None, __props__=None);
name string
The unique name of the resource.
args ServiceLevelObjectiveArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ServiceLevelObjectiveArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ServiceLevelObjectiveArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ServiceLevelObjective Resource Properties

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

Inputs

The ServiceLevelObjective resource accepts the following input properties:

Name string

Name of Datadog service level objective

Thresholds List<ServiceLevelObjectiveThresholdArgs>
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
Type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

Description string

A description of this service level objective.

Groups List<string>

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

MonitorIds List<int>

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

Query ServiceLevelObjectiveQueryArgs

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

Tags List<string>

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

Name string

Name of Datadog service level objective

Thresholds []ServiceLevelObjectiveThreshold
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
Type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

Description string

A description of this service level objective.

Groups []string

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

MonitorIds []int

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

Query ServiceLevelObjectiveQuery

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

Tags []string

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

name string

Name of Datadog service level objective

thresholds ServiceLevelObjectiveThreshold[]
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

description string

A description of this service level objective.

groups string[]

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

monitorIds number[]

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

query ServiceLevelObjectiveQuery

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

tags string[]

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

name str

Name of Datadog service level objective

thresholds List[ServiceLevelObjectiveThreshold]
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
type str

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

description str

A description of this service level objective.

groups List[str]

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

monitor_ids List[Integer]

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

query Dict[ServiceLevelObjectiveQuery]

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

tags List[str]

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceLevelObjective 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing ServiceLevelObjective Resource

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

static get(resource_name, id, opts=None, description=None, groups=None, monitor_ids=None, name=None, query=None, tags=None, thresholds=None, type=None, __props__=None);
func GetServiceLevelObjective(ctx *Context, name string, id IDInput, state *ServiceLevelObjectiveState, opts ...ResourceOption) (*ServiceLevelObjective, error)
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.

The following state arguments are supported:

Description string

A description of this service level objective.

Groups List<string>

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

MonitorIds List<int>

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

Name string

Name of Datadog service level objective

Query ServiceLevelObjectiveQueryArgs

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

Tags List<string>

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

Thresholds List<ServiceLevelObjectiveThresholdArgs>
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
Type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

Description string

A description of this service level objective.

Groups []string

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

MonitorIds []int

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

Name string

Name of Datadog service level objective

Query ServiceLevelObjectiveQuery

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

Tags []string

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

Thresholds []ServiceLevelObjectiveThreshold
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
Type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

description string

A description of this service level objective.

groups string[]

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

monitorIds number[]

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

name string

Name of Datadog service level objective

query ServiceLevelObjectiveQuery

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

tags string[]

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

thresholds ServiceLevelObjectiveThreshold[]
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
type string

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

description str

A description of this service level objective.

groups List[str]

A custom set of groups from the monitor(s) for which to use as the SLI instead of all the groups.

monitor_ids List[Integer]

A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into monitor_tags field in the API resource.

name str

Name of Datadog service level objective

query Dict[ServiceLevelObjectiveQuery]

The metric query configuration to use for the SLI. This is a dictionary and requires both the numerator and denominator fields which should be count metrics using the sum aggregator.

tags List[str]

A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

thresholds List[ServiceLevelObjectiveThreshold]
  • A list of thresholds and targets that define the service level objectives from the provided SLIs.
type str

The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * metric * monitor

Supporting Types

ServiceLevelObjectiveQuery

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Denominator string

the sum of the total events * Example Usage:

Numerator string

the sum of all the good events

Denominator string

the sum of the total events * Example Usage:

Numerator string

the sum of all the good events

denominator string

the sum of the total events * Example Usage:

numerator string

the sum of all the good events

denominator str

the sum of the total events * Example Usage:

numerator str

the sum of all the good events

ServiceLevelObjectiveThreshold

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Target double

the objective’s target [0,100]

Timeframe string

the time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * 7d * 30d * 90d

TargetDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

Warning double

the objective’s warning value [0,100]. This must be > target value.

WarningDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

Target float64

the objective’s target [0,100]

Timeframe string

the time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * 7d * 30d * 90d

TargetDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

Warning float64

the objective’s warning value [0,100]. This must be > target value.

WarningDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

target number

the objective’s target [0,100]

timeframe string

the time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * 7d * 30d * 90d

targetDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

warning number

the objective’s warning value [0,100]. This must be > target value.

warningDisplay string

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

target float

the objective’s target [0,100]

timeframe str

the time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available options to choose from are: * 7d * 30d * 90d

targetDisplay str

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

warning float

the objective’s warning value [0,100]. This must be > target value.

warningDisplay str

the string version to specify additional digits in the case of 99 but want 3 digits like 99.000 to display.

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.