For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/service-level-objectives/get-an-slos-history.md. A documentation index is available at /llms.txt.
Language
Datadog site

Obtener el historial de un SLO

GEThttps://api.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.us3.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.us5.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.datadoghq.eu/api/v1/slo/{slo_id}/historyhttps://api.ap1.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.ap2.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.uk1.datadoghq.com/api/v1/slo/{slo_id}/historyhttps://api.ddog-gov.com/api/v1/slo/{slo_id}/historyhttps://api.us2.ddog-gov.com/api/v1/slo/{slo_id}/history

Descripción general

Obtén el historial de un SLO específico, independientemente de su tipo de SLO.

Los datos detallados del historial se estructuran según el tipo de datos de origen. Por ejemplo, los datos de métricas se incluyen para los SLOs de evento que utilizan la fuente de métricas y los tipos de SLOs de monitor incluyen el historial de transición del monitor.

Nota: Existen diferentes formatos de respuesta para los SLOs basados en eventos y en el tiempo. Se muestran ejemplos de ambos.

This endpoint requires the slos_read permission.

OAuth apps require the slos_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
slo_id [required]
string

The ID of the service level objective object.

Cadenas de consulta

Nombre
Type
Descripción
from_ts [required]
integer

The from timestamp for the query window in epoch seconds.

to_ts [required]
integer

The to timestamp for the query window in epoch seconds.

target
number

The SLO target. If target is passed in, the response will include the remaining error budget and a timeframe value of custom.

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.

Respuesta

OK

A service level objective history response.

Campo
Type
Descripción
data
object

An array of service level objective objects.

errors
[object]

A list of errors while querying the history data for the service level objective.

Ejemplo de código

Obtener el historial de un SLO
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export slo_id="CHANGE_ME"
# Required query arguments
export from_ts="CHANGE_ME"
export to_ts="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/slo/${slo_id}/history?from_ts=${from_ts}&to_ts=${to_ts}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"