elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.16k forks source link

[SLO] Ability to create an SLO (Synthetics availability SLI) via the API that has parity with the UI #189856

Open zx8086 opened 1 month ago

zx8086 commented 1 month ago

Describe the feature:

When I create an SLO via the /api/observability/slos/ it is not the same as when it is created via the UI. Alerts are created as part of the SLO creation process via the UI.

Describe a specific use case for the feature:

I would like to automate creation of SLO's and therefore need this ability is needed or a simpler alternative to create the SLO's, then obtain all the information necessary to create a rule. Where do I get all the id's from ? -> "id": "1c3f2495-c2ea-49d8-a09a-8d139fb10305", "id": "59b358c4-89f8-4c92-9c4a-774c03383549", "id": "ae057d6e-1347-4e38-b663-75d1881d5b23" and "id": "20fd5afe-5eef-4c32-9de1-cd532da2936e".

POST kbn:/api/alerting/rule { "params": { "sloId": "7876d3d3-fecb-40bf-8996-f575c861d3e5", "windows": [ { "id": "1c3f2495-c2ea-49d8-a09a-8d139fb10305", "burnRateThreshold": 14.4, "maxBurnRateThreshold": 720, "longWindow": { "value": 1, "unit": "h" }, "shortWindow": { "value": 5, "unit": "m" }, "actionGroup": "slo.burnRate.alert" }, { "id": "59b358c4-89f8-4c92-9c4a-774c03383549", "burnRateThreshold": 6, "maxBurnRateThreshold": 120, "longWindow": { "value": 6, "unit": "h" }, "shortWindow": { "value": 30, "unit": "m" }, "actionGroup": "slo.burnRate.high" }, { "id": "ae057d6e-1347-4e38-b663-75d1881d5b23", "burnRateThreshold": 3, "maxBurnRateThreshold": 30, "longWindow": { "value": 24, "unit": "h" }, "shortWindow": { "value": 120, "unit": "m" }, "actionGroup": "slo.burnRate.medium" }, { "id": "20fd5afe-5eef-4c32-9de1-cd532da2936e", "burnRateThreshold": 1, "maxBurnRateThreshold": 10, "longWindow": { "value": 72, "unit": "h" }, "shortWindow": { "value": 360, "unit": "m" }, "actionGroup": "slo.burnRate.low" } ], "dependencies": [] }, "consumer": "slo", "schedule": { "interval": "1m" }, "tags": [], "name": "Example SLO burn rate rule", "rule_type_id": "slo.rules.burnRate", "actions": [] }

elasticmachine commented 1 month ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)