slo_history
Creates, updates, deletes, gets or lists a slo_history resource.
Overview
| Name | slo_history |
| Type | Resource |
| Id | datadog.service_management.slo_history |
Fields
The following fields are returned by SELECT queries:
- get_slohistory
| Name | Datatype | Description |
|---|---|---|
type_id | integer (int32) | A numeric representation of the type of the service level objective (0 for monitor, 1 for metric). Always included in service level objective responses. Ignored in create/update requests. (0, 1, 2) |
from_ts | integer (int64) | The from timestamp in epoch seconds. |
group_by | array | For metric based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. This is not included in responses for monitor based SLOs. |
groups | array | For grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for metric based SLOs. |
monitors | array | For multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for metric based SLOs. |
overall | object | An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value. This can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs. |
series | object | A metric based SLO history response. This is not included in responses for monitor based SLOs. |
thresholds | object | mapping of string timeframe to the SLO threshold. |
to_ts | integer (int64) | The to timestamp in epoch seconds. |
type | string | The type of the service level objective. (metric, monitor, time_slice) (example: metric) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_slohistory | select | slo_id, from_ts, to_ts | target, apply_correction | Get a specific SLO’s history, regardless of its SLO type.<br /><br />The detailed history data is structured according to the source data type.<br />For example, metric data is included for event SLOs that use<br />the metric source, and monitor SLO types include the monitor transition history.<br /><br />Note: There are different response formats for event based and time based SLOs.<br />Examples of both are shown. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
from_ts | integer (int64) | The from timestamp for the query window in epoch seconds. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
slo_id | string | The ID of the service level objective object. |
to_ts | integer (int64) | The to timestamp for the query window in epoch seconds. |
apply_correction | boolean | Defaults to true. If any SLO corrections are applied and this parameter is set to false, then the corrections will not be applied and the SLI values will not be affected. |
target | number (double) | The SLO target. If target is passed in, the response will include the remaining error budget and a timeframe value of custom. |
SELECT examples
- get_slohistory
Get a specific SLO’s history, regardless of its SLO type.<br /><br />The detailed history data is structured according to the source data type.<br />For example, metric data is included for event SLOs that use<br />the metric source, and monitor SLO types include the monitor transition history.<br /><br />Note: There are different response formats for event based and time based SLOs.<br />Examples of both are shown.
SELECT
type_id,
from_ts,
group_by,
groups,
monitors,
overall,
series,
thresholds,
to_ts,
type
FROM datadog.service_management.slo_history
WHERE slo_id = '{{ slo_id }}' -- required
AND from_ts = '{{ from_ts }}' -- required
AND to_ts = '{{ to_ts }}' -- required
AND target = '{{ target }}'
AND apply_correction = '{{ apply_correction }}'
;