Skip to content

Commit

Permalink
Add SLO assets to the package spec (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota authored Jun 25, 2024
1 parent d79da66 commit 6247494
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ For a quick overview, these are the assets typically found in an Elastic Package
* Search
* Security rules
* CSP (cloud security posture) rule templates
* SLOs
* Other
* fields.yml

Expand Down
6 changes: 6 additions & 0 deletions spec/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
## This file documents changes in the package specification. It is NOT a package specification file.
## Newer entries go at the bottom of each in-development version.
##
- version: 3.3.0-next
changes:
- description: Add support for `slo` assets.
type: enhancement
link: https://github.com/elastic/package-spec/pull/767
- version: 3.2.1-next
changes:
- description: Prepare for next version
Expand Down Expand Up @@ -725,3 +730,4 @@
- description: Introduce "value" property for constant_keyword fields
type: enhancement
link: https://github.com/elastic/package-spec/pull/194

16 changes: 15 additions & 1 deletion spec/integration/kibana/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,22 @@ spec:
name: "tags.yml"
required: false
$ref: "./tags.spec.yml"

- description: Folder containing Kibana SLO assets
type: folder
name: slo
required: false
contents:
- description: An SLO asset file
type: file
contentMediaType: "application/json"
pattern: '^{PACKAGE_NAME}-.+\.json$'
forbiddenPatterns:
- '^.+-(ecs|ECS)\.json$' # ECS suffix is forbidden
versions:
- before: 3.3.0
patch:
- op: remove
path: "/contents/13" # remove SLO definitions
- before: 2.10.0
patch:
- op: remove
Expand Down
29 changes: 29 additions & 0 deletions test/packages/good_v3/kibana/slo/good_v3-slo-abc-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"attributes": {
"name": "Admin Console Availability",
"description": "",
"indicator": {
"type": "sli.kql.custom",
"params": {
"index": "kbn-data-forge-fake_stack.admin-console-*",
"filter": "",
"good": "http.response.status_code < 500",
"total": "http.response.status_code : *",
"timestampField": "@timestamp"
}
},
"budgetingMethod": "occurrences",
"timeWindow": {
"duration": "7d",
"type": "rolling"
},
"objective": {
"target": 0.99
},
"tags": [],
"groupBy": "url.domain"
},
"id": "good_v3-slo-abc-1",
"references": [],
"type": "slo"
}
2 changes: 1 addition & 1 deletion test/packages/good_v3/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
format_version: 3.2.0
format_version: 3.3.0
name: good_v3
title: Good package
description: This package is good for format version 3
Expand Down

0 comments on commit 6247494

Please sign in to comment.