Batch Execute Slo
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"requests": [
{
"createSloRequest": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
},
"silenceDataValidations": true
}
}
]
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute"
payload = { "requests": [{ "createSloRequest": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"totalEvents": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" }
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": ["500"]
}
],
"groupingKeys": ["environment", "region"],
"latencyConfig": {
"quantile": { "percentile": 0.95 },
"average": {},
"threshold": 500
},
"services": ["my-service", "payment-service"]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": ["500"]
}
],
"groupingKeys": ["environment", "region"],
"latencyConfig": {
"quantile": { "percentile": 0.95 },
"average": {},
"threshold": 500
},
"services": ["my-service", "payment-service"]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": { "labels": ["<string>"] },
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
},
"service": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
},
"team": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"threshold": 0.95
}
},
"silenceDataValidations": True
} }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
createSloRequest: {
slo: {
requestBasedMetricSli: {
goodEvents: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
totalEvents: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'}
},
apmSli: {
errorConfig: {},
filters: [{key: 'environment', value: 'production', values: ['500']}],
groupingKeys: ['environment', 'region'],
latencyConfig: {quantile: {percentile: 0.95}, average: {}, threshold: 500},
services: ['my-service', 'payment-service']
},
apmSliMetadata: {
errorConfig: {},
filters: [{key: 'environment', value: 'production', values: ['500']}],
groupingKeys: ['environment', 'region'],
latencyConfig: {quantile: {percentile: 0.95}, average: {}, threshold: 500},
services: ['my-service', 'payment-service']
},
createTime: '2023-11-07T05:31:56Z',
creator: 'test@domain.com',
description: 'A brief description of my SLO',
grouping: {labels: ['<string>']},
id: 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
labels: {},
name: 'Example Slo Name',
ownershipTags: {
environment: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
},
service: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
},
team: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
}
},
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
targetThresholdPercentage: 99.999,
type: 'request',
updateTime: '2023-11-07T05:31:56Z',
windowBasedMetricSli: {
query: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
threshold: 0.95
}
},
silenceDataValidations: true
}
}
]
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requests' => [
[
'createSloRequest' => [
'slo' => [
'requestBasedMetricSli' => [
'goodEvents' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'totalEvents' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
]
],
'apmSli' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production',
'values' => [
'500'
]
]
],
'groupingKeys' => [
'environment',
'region'
],
'latencyConfig' => [
'quantile' => [
'percentile' => 0.95
],
'average' => [
],
'threshold' => 500
],
'services' => [
'my-service',
'payment-service'
]
],
'apmSliMetadata' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production',
'values' => [
'500'
]
]
],
'groupingKeys' => [
'environment',
'region'
],
'latencyConfig' => [
'quantile' => [
'percentile' => 0.95
],
'average' => [
],
'threshold' => 500
],
'services' => [
'my-service',
'payment-service'
]
],
'createTime' => '2023-11-07T05:31:56Z',
'creator' => 'test@domain.com',
'description' => 'A brief description of my SLO',
'grouping' => [
'labels' => [
'<string>'
]
],
'id' => 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
'labels' => [
],
'name' => 'Example Slo Name',
'ownershipTags' => [
'environment' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
],
'service' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
],
'team' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
]
],
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'targetThresholdPercentage' => 99.999,
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z',
'windowBasedMetricSli' => [
'query' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'threshold' => 0.95
]
],
'silenceDataValidations' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"matchingResponses": [
{
"createSloResponse": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
}
},
"deleteSloResponse": {
"effectedSloAlertIds": [
"<string>"
]
},
"replaceSloResponse": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
},
"effectedSloAlertIds": [
"<string>"
]
}
}
],
"status": {
"details": {},
"message": "<string>"
}
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}SLOs Service
Batch Execute Slo
Triggers execution for all SLOs.
Batch Execute Slo
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"requests": [
{
"createSloRequest": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
},
"silenceDataValidations": true
}
}
]
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute"
payload = { "requests": [{ "createSloRequest": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"totalEvents": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" }
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": ["500"]
}
],
"groupingKeys": ["environment", "region"],
"latencyConfig": {
"quantile": { "percentile": 0.95 },
"average": {},
"threshold": 500
},
"services": ["my-service", "payment-service"]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": ["500"]
}
],
"groupingKeys": ["environment", "region"],
"latencyConfig": {
"quantile": { "percentile": 0.95 },
"average": {},
"threshold": 500
},
"services": ["my-service", "payment-service"]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": { "labels": ["<string>"] },
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
},
"service": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
},
"team": {
"labelKeys": ["deployment_environment", "k8s_namespace"],
"resolvedValues": ["checkout-api", "production", "staging", "payments-ns"],
"staticValues": ["checkout-api"]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"threshold": 0.95
}
},
"silenceDataValidations": True
} }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
createSloRequest: {
slo: {
requestBasedMetricSli: {
goodEvents: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
totalEvents: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'}
},
apmSli: {
errorConfig: {},
filters: [{key: 'environment', value: 'production', values: ['500']}],
groupingKeys: ['environment', 'region'],
latencyConfig: {quantile: {percentile: 0.95}, average: {}, threshold: 500},
services: ['my-service', 'payment-service']
},
apmSliMetadata: {
errorConfig: {},
filters: [{key: 'environment', value: 'production', values: ['500']}],
groupingKeys: ['environment', 'region'],
latencyConfig: {quantile: {percentile: 0.95}, average: {}, threshold: 500},
services: ['my-service', 'payment-service']
},
createTime: '2023-11-07T05:31:56Z',
creator: 'test@domain.com',
description: 'A brief description of my SLO',
grouping: {labels: ['<string>']},
id: 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
labels: {},
name: 'Example Slo Name',
ownershipTags: {
environment: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
},
service: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
},
team: {
labelKeys: ['deployment_environment', 'k8s_namespace'],
resolvedValues: ['checkout-api', 'production', 'staging', 'payments-ns'],
staticValues: ['checkout-api']
}
},
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
targetThresholdPercentage: 99.999,
type: 'request',
updateTime: '2023-11-07T05:31:56Z',
windowBasedMetricSli: {
query: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
threshold: 0.95
}
},
silenceDataValidations: true
}
}
]
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requests' => [
[
'createSloRequest' => [
'slo' => [
'requestBasedMetricSli' => [
'goodEvents' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'totalEvents' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
]
],
'apmSli' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production',
'values' => [
'500'
]
]
],
'groupingKeys' => [
'environment',
'region'
],
'latencyConfig' => [
'quantile' => [
'percentile' => 0.95
],
'average' => [
],
'threshold' => 500
],
'services' => [
'my-service',
'payment-service'
]
],
'apmSliMetadata' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production',
'values' => [
'500'
]
]
],
'groupingKeys' => [
'environment',
'region'
],
'latencyConfig' => [
'quantile' => [
'percentile' => 0.95
],
'average' => [
],
'threshold' => 500
],
'services' => [
'my-service',
'payment-service'
]
],
'createTime' => '2023-11-07T05:31:56Z',
'creator' => 'test@domain.com',
'description' => 'A brief description of my SLO',
'grouping' => [
'labels' => [
'<string>'
]
],
'id' => 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
'labels' => [
],
'name' => 'Example Slo Name',
'ownershipTags' => [
'environment' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
],
'service' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
],
'team' => [
'labelKeys' => [
'deployment_environment',
'k8s_namespace'
],
'resolvedValues' => [
'checkout-api',
'production',
'staging',
'payments-ns'
],
'staticValues' => [
'checkout-api'
]
]
],
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'targetThresholdPercentage' => 99.999,
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z',
'windowBasedMetricSli' => [
'query' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'threshold' => 0.95
]
],
'silenceDataValidations' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/slo/slos/v1/all/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"createSloRequest\": {\n \"slo\": {\n \"requestBasedMetricSli\": {\n \"goodEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"totalEvents\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n }\n },\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"apmSliMetadata\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\",\n \"values\": [\n \"500\"\n ]\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"latencyConfig\": {\n \"quantile\": {\n \"percentile\": 0.95\n },\n \"average\": {},\n \"threshold\": 500\n },\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"ownershipTags\": {\n \"environment\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"service\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n },\n \"team\": {\n \"labelKeys\": [\n \"deployment_environment\",\n \"k8s_namespace\"\n ],\n \"resolvedValues\": [\n \"checkout-api\",\n \"production\",\n \"staging\",\n \"payments-ns\"\n ],\n \"staticValues\": [\n \"checkout-api\"\n ]\n }\n },\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n },\n \"silenceDataValidations\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"matchingResponses": [
{
"createSloResponse": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
}
},
"deleteSloResponse": {
"effectedSloAlertIds": [
"<string>"
]
},
"replaceSloResponse": {
"slo": {
"requestBasedMetricSli": {
"goodEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"totalEvents": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
}
},
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"apmSliMetadata": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production",
"values": [
"500"
]
}
],
"groupingKeys": [
"environment",
"region"
],
"latencyConfig": {
"quantile": {
"percentile": 0.95
},
"average": {},
"threshold": 500
},
"services": [
"my-service",
"payment-service"
]
},
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"ownershipTags": {
"environment": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"service": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
},
"team": {
"labelKeys": [
"deployment_environment",
"k8s_namespace"
],
"resolvedValues": [
"checkout-api",
"production",
"staging",
"payments-ns"
],
"staticValues": [
"checkout-api"
]
}
},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
},
"effectedSloAlertIds": [
"<string>"
]
}
}
],
"status": {
"details": {},
"message": "<string>"
}
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}Authorizations
API key authentication
Body
application/json
Request to batch execute multiple SLO operations.
The requests.
Request for executing an SLO operation.
- SloExecutionRequest
- SloExecutionRequest
- SloExecutionRequest
Show child attributes
Show child attributes
Response
Response containing the results of batch executed SLO operations.
The matching responses.
Response for an executed SLO operation.
- SloExecutionResponse
- SloExecutionResponse
- SloExecutionResponse
- SloExecutionResponse
Show child attributes
Show child attributes
Status of the response, including error code and message.
Show child attributes
Show child attributes
Was this page helpful?
⌘I