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
new ServiceLevelObjective(name: string, args: ServiceLevelObjectiveArgs, opts?: CustomResourceOptions);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);func NewServiceLevelObjective(ctx *Context, name string, args ServiceLevelObjectiveArgs, opts ...ResourceOption) (*ServiceLevelObjective, error)public ServiceLevelObjective(string name, ServiceLevelObjectiveArgs args, CustomResourceOptions? opts = null)- 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<Service
Level Objective Threshold Args> - 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.
- Monitor
Ids List<int> A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- Query
Service
Level Objective Query Args The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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
[]Service
Level Objective Threshold - 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.
- Monitor
Ids []int A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- Query
Service
Level Objective Query The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- []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
Service
Level Objective Threshold[] - 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.
- monitor
Ids number[] A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- query
Service
Level Objective Query The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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[Service
Level Objective Threshold] - 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_tagsfield in the API resource.- query
Dict[Service
Level Objective Query] The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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:
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.
public static get(name: string, id: Input<ID>, state?: ServiceLevelObjectiveState, opts?: CustomResourceOptions): ServiceLevelObjectivestatic 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)public static ServiceLevelObjective Get(string name, Input<string> id, ServiceLevelObjectiveState? state, CustomResourceOptions? opts = null)- 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.
- Monitor
Ids List<int> A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- Name string
Name of Datadog service level objective
- Query
Service
Level Objective Query Args The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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<Service
Level Objective Threshold Args> - 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.
- Monitor
Ids []int A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- Name string
Name of Datadog service level objective
- Query
Service
Level Objective Query The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- []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
[]Service
Level Objective Threshold - 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.
- monitor
Ids number[] A list of numeric monitor IDs for which to use as SLIs. Their tags will be auto-imported into
monitor_tagsfield in the API resource.- name string
Name of Datadog service level objective
- query
Service
Level Objective Query The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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
Service
Level Objective Threshold[] - 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_tagsfield in the API resource.- name str
Name of Datadog service level objective
- query
Dict[Service
Level Objective Query] The metric query configuration to use for the SLI. This is a dictionary and requires both the
numeratoranddenominatorfields which should becountmetrics using thesumaggregator.- 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[Service
Level Objective Threshold] - 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
- Denominator string
the sum of the
totalevents * Example Usage:- Numerator string
the sum of all the
goodevents
- Denominator string
the sum of the
totalevents * Example Usage:- Numerator string
the sum of all the
goodevents
- denominator string
the sum of the
totalevents * Example Usage:- numerator string
the sum of all the
goodevents
- denominator str
the sum of the
totalevents * Example Usage:- numerator str
the sum of all the
goodevents
ServiceLevelObjectiveThreshold
- 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- Target
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to display.- Warning double
the objective’s warning value
[0,100]. This must be> targetvalue.- Warning
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to 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- Target
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to display.- Warning float64
the objective’s warning value
[0,100]. This must be> targetvalue.- Warning
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to 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- target
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to display.- warning number
the objective’s warning value
[0,100]. This must be> targetvalue.- warning
Display string the string version to specify additional digits in the case of
99but want 3 digits like99.000to 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- target
Display str the string version to specify additional digits in the case of
99but want 3 digits like99.000to display.- warning float
the objective’s warning value
[0,100]. This must be> targetvalue.- warning
Display str the string version to specify additional digits in the case of
99but want 3 digits like99.000to display.
Package Details
- Repository
- https://github.com/pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadogTerraform Provider.