Skip to main content

slo_history

Creates, updates, deletes, gets or lists a slo_history resource.

Overview

Nameslo_history
TypeResource
Iddatadog.service_management.slo_history

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
type_idinteger (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_tsinteger (int64)The from timestamp in epoch seconds.
group_byarrayFor 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.
groupsarrayFor grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for metric based SLOs.
monitorsarrayFor multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for metric based SLOs.
overallobjectAn 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.
seriesobjectA metric based SLO history response. This is not included in responses for monitor based SLOs.
thresholdsobjectmapping of string timeframe to the SLO threshold.
to_tsinteger (int64)The to timestamp in epoch seconds.
typestringThe type of the service level objective. (metric, monitor, time_slice) (example: metric)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_slohistoryselectslo_id, from_ts, to_tstarget, apply_correctionGet 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.

NameDatatypeDescription
from_tsinteger (int64)The from timestamp for the query window in epoch seconds.
sitestringThe 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_idstringThe ID of the service level objective object.
to_tsinteger (int64)The to timestamp for the query window in epoch seconds.
apply_correctionbooleanDefaults 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.
targetnumber (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 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 }}'
;