From d14b6d9a6ecd32de3fb2a99c9e5df7b18df4808b Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 1 Jul 2024 23:02:44 +0000
Subject: [PATCH 01/13] chore: Update module github.com/aws/aws-sdk-go to
v1.54.12 (#478)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/aws/aws-sdk-go](https://togithub.com/aws/aws-sdk-go) |
`v1.54.11` -> `v1.54.12` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2faws%2faws-sdk-go/v1.54.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2faws%2faws-sdk-go/v1.54.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2faws%2faws-sdk-go/v1.54.11/v1.54.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2faws%2faws-sdk-go/v1.54.11/v1.54.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
aws/aws-sdk-go (github.com/aws/aws-sdk-go)
###
[`v1.54.12`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15412-2024-07-01)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.11...v1.54.12)
\===
##### Service Client Updates
- `service/apigateway`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/cognito-identity`: Updates service API
- `service/connect`: Updates service API, documentation, and paginators
- `service/docdb`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/eks`: Updates service API
- `service/payment-cryptography`: Updates service API and documentation
- `service/payment-cryptography-data`: Updates service API,
documentation, and waiters
- `service/states`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/swf`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/wafv2`: Updates service API and documentation
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index b157d71b..8d627f27 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v1.4.0
github.com/MicahParks/jwkset v0.5.18
github.com/MicahParks/keyfunc/v3 v3.3.3
- github.com/aws/aws-sdk-go v1.54.11
+ github.com/aws/aws-sdk-go v1.54.12
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
diff --git a/go.sum b/go.sum
index b2898d87..ec131629 100644
--- a/go.sum
+++ b/go.sum
@@ -4,8 +4,8 @@ github.com/MicahParks/jwkset v0.5.18 h1:WLdyMngF7rCrnstQxA7mpRoxeaWqGzPM/0z40PJU
github.com/MicahParks/jwkset v0.5.18/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB8jtEmY=
github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48=
-github.com/aws/aws-sdk-go v1.54.11 h1:Zxuv/R+IVS0B66yz4uezhxH9FN9/G2nbxejYqAMFjxk=
-github.com/aws/aws-sdk-go v1.54.11/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.54.12 h1:xPDB+GSBZq0rJbmDZF+EyfMbnWRyfEPcn7PZ7bJjXSw=
+github.com/aws/aws-sdk-go v1.54.12/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
From 06669f2fa554052aef4ebe1a65454dd9e52b4b42 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 3 Jul 2024 22:49:43 +0000
Subject: [PATCH 02/13] chore: Update module github.com/aws/aws-sdk-go to
v1.54.14 (#479)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/aws/aws-sdk-go](https://togithub.com/aws/aws-sdk-go) |
`v1.54.12` -> `v1.54.14` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2faws%2faws-sdk-go/v1.54.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2faws%2faws-sdk-go/v1.54.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2faws%2faws-sdk-go/v1.54.12/v1.54.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2faws%2faws-sdk-go/v1.54.12/v1.54.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
aws/aws-sdk-go (github.com/aws/aws-sdk-go)
###
[`v1.54.14`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15414-2024-07-03)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.13...v1.54.14)
\===
##### Service Client Updates
- `service/application-autoscaling`: Updates service documentation
- `service/directconnect`: Updates service documentation
- This update includes documentation for support of new native 400 GBps
ports for Direct Connect.
- `service/organizations`: Updates service API and documentation
- Added a new reason under ConstraintViolationException in
RegisterDelegatedAdministrator API to prevent registering suspended
accounts as delegated administrator of a service.
- `service/rekognition`: Updates service API and documentation
- This release adds support for tagging projects and datasets with the
CreateProject and CreateDataset APIs.
- `service/workspaces`: Updates service API
- Fix create workspace bundle RootStorage/UserStorage to accept non null
values
###
[`v1.54.13`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15413-2024-07-02)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.12...v1.54.13)
\===
##### Service Client Updates
- `service/ec2`: Updates service API and documentation
- Documentation updates for Elastic Compute Cloud (EC2).
- `service/fms`: Updates service API
- `service/s3`: Updates service API, documentation, and examples
- Added response overrides to Head Object requests.
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 8d627f27..cf2741a5 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v1.4.0
github.com/MicahParks/jwkset v0.5.18
github.com/MicahParks/keyfunc/v3 v3.3.3
- github.com/aws/aws-sdk-go v1.54.12
+ github.com/aws/aws-sdk-go v1.54.14
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
diff --git a/go.sum b/go.sum
index ec131629..05ef5c2f 100644
--- a/go.sum
+++ b/go.sum
@@ -4,8 +4,8 @@ github.com/MicahParks/jwkset v0.5.18 h1:WLdyMngF7rCrnstQxA7mpRoxeaWqGzPM/0z40PJU
github.com/MicahParks/jwkset v0.5.18/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB8jtEmY=
github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48=
-github.com/aws/aws-sdk-go v1.54.12 h1:xPDB+GSBZq0rJbmDZF+EyfMbnWRyfEPcn7PZ7bJjXSw=
-github.com/aws/aws-sdk-go v1.54.12/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.54.14 h1:llJ60MzLzovyDE/rEDbUjS1cICh7krk1PwQwNlKRoeQ=
+github.com/aws/aws-sdk-go v1.54.14/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
From 62bd4dbe3cc5af5df963903fda37e0f39218a2f4 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 4 Jul 2024 02:23:42 +0000
Subject: [PATCH 03/13] chore: Update dependency cspell to v8.10.0 (#480)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cspell](https://streetsidesoftware.github.io/cspell/)
([source](https://togithub.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell))
| [`8.9.1` ->
`8.10.0`](https://renovatebot.com/diffs/npm/cspell/8.9.1/8.10.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/cspell/8.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cspell/8.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cspell/8.9.1/8.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cspell/8.9.1/8.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
streetsidesoftware/cspell (cspell)
###
[`v8.10.0`](https://togithub.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell/CHANGELOG.md#8100-2024-07-02)
[Compare
Source](https://togithub.com/streetsidesoftware/cspell/compare/v8.9.1...v8.10.0)
- chore: Update Integration Test Performance Data
([#5859](https://togithub.com/streetsidesoftware/cspell/issues/5859))
([898e806](https://togithub.com/streetsidesoftware/cspell/commit/898e806)),
closes
[#5859](https://togithub.com/streetsidesoftware/cspell/issues/5859)
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index dc37940a..cc612e31 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"private": true,
"type": "module",
"devDependencies": {
- "cspell": "8.9.1",
+ "cspell": "8.10.0",
"markdownlint-cli": "0.41.0",
"yaml": "2.4.5"
},
From 9b739072f12a7c0a7579ac69b43634e1eb4a50bd Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 6 Jul 2024 01:08:51 +0000
Subject: [PATCH 04/13] chore: Update dependency cspell to v8.10.4 (#483)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cspell](https://streetsidesoftware.github.io/cspell/)
([source](https://togithub.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell))
| [`8.10.0` ->
`8.10.4`](https://renovatebot.com/diffs/npm/cspell/8.10.0/8.10.4) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/cspell/8.10.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cspell/8.10.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cspell/8.10.0/8.10.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cspell/8.10.0/8.10.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
streetsidesoftware/cspell (cspell)
###
[`v8.10.4`](https://togithub.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell/CHANGELOG.md#small8104-2024-07-05-small)
[Compare
Source](https://togithub.com/streetsidesoftware/cspell/compare/v8.10.2...v8.10.4)
- chore: force 8.10.3
([f18b8c7](https://togithub.com/streetsidesoftware/cspell/commit/f18b8c7))
###
[`v8.10.2`](https://togithub.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell/CHANGELOG.md#small8102-2024-07-05-small)
[Compare
Source](https://togithub.com/streetsidesoftware/cspell/compare/v8.10.1...v8.10.2)
- ci: Workflow Bot -- Update ALL Dependencies (main)
([#5862](https://togithub.com/streetsidesoftware/cspell/issues/5862))
([814e15c](https://togithub.com/streetsidesoftware/cspell/commit/814e15c)),
closes
[#5862](https://togithub.com/streetsidesoftware/cspell/issues/5862)
###
[`v8.10.1`](https://togithub.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell/CHANGELOG.md#small8101-2024-07-05-small)
[Compare
Source](https://togithub.com/streetsidesoftware/cspell/compare/v8.10.0...v8.10.1)
- fix(cspell-tools): support adding directives
([#5860](https://togithub.com/streetsidesoftware/cspell/issues/5860))
([b2e014f](https://togithub.com/streetsidesoftware/cspell/commit/b2e014f)),
closes
[#5860](https://togithub.com/streetsidesoftware/cspell/issues/5860)
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index cc612e31..a0406d25 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"private": true,
"type": "module",
"devDependencies": {
- "cspell": "8.10.0",
+ "cspell": "8.10.4",
"markdownlint-cli": "0.41.0",
"yaml": "2.4.5"
},
From 0471894f3e54e3c7d2a568a13276bd89f013be39 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 6 Jul 2024 05:23:19 +0000
Subject: [PATCH 05/13] chore: Update module github.com/aws/aws-sdk-go to
v1.54.15 (#484)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/aws/aws-sdk-go](https://togithub.com/aws/aws-sdk-go) |
`v1.54.14` -> `v1.54.15` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2faws%2faws-sdk-go/v1.54.15?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2faws%2faws-sdk-go/v1.54.15?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2faws%2faws-sdk-go/v1.54.14/v1.54.15?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2faws%2faws-sdk-go/v1.54.14/v1.54.15?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
aws/aws-sdk-go (github.com/aws/aws-sdk-go)
###
[`v1.54.15`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15415-2024-07-05)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.14...v1.54.15)
\===
##### Service Client Updates
- `service/acm`: Updates service API and documentation
- Documentation updates, including fixes for xml formatting, broken
links, and ListCertificates description.
- `service/ecr`: Updates service API
- This release for Amazon ECR makes change to bring the SDK into sync
with the API.
- `service/payment-cryptography-data`: Updates service API and
documentation
- `service/qbusiness`: Updates service API and documentation
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index cf2741a5..1f99ebad 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v1.4.0
github.com/MicahParks/jwkset v0.5.18
github.com/MicahParks/keyfunc/v3 v3.3.3
- github.com/aws/aws-sdk-go v1.54.14
+ github.com/aws/aws-sdk-go v1.54.15
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
diff --git a/go.sum b/go.sum
index 05ef5c2f..a229a670 100644
--- a/go.sum
+++ b/go.sum
@@ -4,8 +4,8 @@ github.com/MicahParks/jwkset v0.5.18 h1:WLdyMngF7rCrnstQxA7mpRoxeaWqGzPM/0z40PJU
github.com/MicahParks/jwkset v0.5.18/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB8jtEmY=
github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48=
-github.com/aws/aws-sdk-go v1.54.14 h1:llJ60MzLzovyDE/rEDbUjS1cICh7krk1PwQwNlKRoeQ=
-github.com/aws/aws-sdk-go v1.54.14/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.54.15 h1:ErgCEVbzuSfuZl9nR+g8FFnzjgeJ/AqAGOEWn6tgAHo=
+github.com/aws/aws-sdk-go v1.54.15/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
From b0b10200bba1e897524b1965e2ac63cc7cfbb11b Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 7 Jul 2024 22:30:39 +0000
Subject: [PATCH 06/13] chore: Update module golang.org/x/tools/cmd/goimports
to v0.23.0 (#485)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| golang.org/x/tools/cmd/goimports | `v0.22.0` -> `v0.23.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2ftools%2fcmd%2fgoimports/v0.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/golang.org%2fx%2ftools%2fcmd%2fgoimports/v0.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/golang.org%2fx%2ftools%2fcmd%2fgoimports/v0.22.0/v0.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2ftools%2fcmd%2fgoimports/v0.22.0/v0.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 6cce7618..afa8b4f8 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ GOLANGCI_LINT_VERSION := v1.59.1
# renovate datasource=go depName=golang.org/x/vuln/cmd/govulncheck
GOVULNCHECK_VERSION := v1.1.2
# renovate datasource=go depName=golang.org/x/tools/cmd/goimports
-GOIMPORTS_VERSION := v0.22.0
+GOIMPORTS_VERSION := v0.23.0
# renovate datasource=go depName=github.com/vburenin/ifacemaker
IFACEMAKER_VERSION := v1.2.1
From ea8a2e13d68c48a27cb3880738c27d5cac164e76 Mon Sep 17 00:00:00 2001
From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com>
Date: Mon, 8 Jul 2024 09:40:46 +0200
Subject: [PATCH 07/13] chore: Switch go-yaml library to Nobl9 fork (#482)
## Motivation
Modules using `nobl9-go` cannot rely on `replace` clause in the SDK if
they are using `go-yaml` package as well, in such scenario these modules
have to using `replace` clause too and this in turn breaks `go install`,
here's an example:
```
go install github.com/nobl9/sloctl/cmd/sloctl@latest
go: downloading github.com/nobl9/sloctl v0.3.2
go: github.com/nobl9/sloctl/cmd/sloctl@latest (in github.com/nobl9/sloctl@v0.3.2):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
```
---
.golangci.yml | 4 ++--
go.mod | 5 +----
go.sum | 4 ++--
internal/cmd/docgen/main.go | 2 +-
internal/manifest/v1alphatest/labels_validation.go | 2 +-
.../manifest/v1alphatest/metadata_annotations_validation.go | 2 +-
internal/validation/example_test.go | 2 +-
manifest/v1alpha/dataexport/data_export.go | 2 +-
manifest/v1alpha/parser/parser.go | 2 +-
sdk/decode.go | 2 +-
sdk/decode_test.go | 2 +-
sdk/encode.go | 2 +-
12 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/.golangci.yml b/.golangci.yml
index 0b04aa87..75a0cbaf 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,8 +1,6 @@
run:
timeout: 5m
modules-download-mode: readonly
- skip-dirs:
- - scripts
skip-dirs-use-default: true
issues:
@@ -24,6 +22,8 @@ issues:
- linters:
- revive
text: "error-strings: error strings should not be capitalized or end with punctuation or a newline"
+ exclude-dirs:
+ - scripts
# Value 0 means show all.
max-issues-per-linter: 0
max-same-issues: 0
diff --git a/go.mod b/go.mod
index 1f99ebad..93837f14 100644
--- a/go.mod
+++ b/go.mod
@@ -8,9 +8,9 @@ require (
github.com/MicahParks/keyfunc/v3 v3.3.3
github.com/aws/aws-sdk-go v1.54.15
github.com/bmatcuk/doublestar/v4 v4.6.1
- github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/hashicorp/go-retryablehttp v0.7.7
+ github.com/nobl9/go-yaml v1.0.1
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/teambition/rrule-go v1.8.2
@@ -31,6 +31,3 @@ require (
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
-
-// We might in the end decide to just go with the fork direcly.
-replace github.com/goccy/go-yaml => github.com/nobl9/go-yaml v0.0.0-20240626115914-6b82fd0d61b9
diff --git a/go.sum b/go.sum
index a229a670..045d479b 100644
--- a/go.sum
+++ b/go.sum
@@ -40,8 +40,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/nobl9/go-yaml v0.0.0-20240626115914-6b82fd0d61b9 h1:HWAY7k8zA8T3dgQRg6llwyWshguD6bIeaVXukNrnen4=
-github.com/nobl9/go-yaml v0.0.0-20240626115914-6b82fd0d61b9/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU=
+github.com/nobl9/go-yaml v1.0.1 h1:Aj1kSaYdRQTKlvS6ihvXzQJhCpoHhtf9nfA95zqWH4Q=
+github.com/nobl9/go-yaml v1.0.1/go.mod h1:t7vCO8ctYdBweZxU5lUgxzAw31+ZcqJYeqRtrv+5RHI=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
diff --git a/internal/cmd/docgen/main.go b/internal/cmd/docgen/main.go
index eab120c0..6a3b42e0 100644
--- a/internal/cmd/docgen/main.go
+++ b/internal/cmd/docgen/main.go
@@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/nobl9/nobl9-go/internal/validation"
"github.com/nobl9/nobl9-go/manifest"
diff --git a/internal/manifest/v1alphatest/labels_validation.go b/internal/manifest/v1alphatest/labels_validation.go
index 8537afe3..e2217b66 100644
--- a/internal/manifest/v1alphatest/labels_validation.go
+++ b/internal/manifest/v1alphatest/labels_validation.go
@@ -6,7 +6,7 @@ import (
"strings"
"testing"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/stretchr/testify/require"
"github.com/nobl9/nobl9-go/internal/testutils"
diff --git a/internal/manifest/v1alphatest/metadata_annotations_validation.go b/internal/manifest/v1alphatest/metadata_annotations_validation.go
index 7e6c6c13..e2cef335 100644
--- a/internal/manifest/v1alphatest/metadata_annotations_validation.go
+++ b/internal/manifest/v1alphatest/metadata_annotations_validation.go
@@ -6,7 +6,7 @@ import (
"strings"
"testing"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/stretchr/testify/require"
"github.com/nobl9/nobl9-go/internal/testutils"
diff --git a/internal/validation/example_test.go b/internal/validation/example_test.go
index e861b1f0..a81efafe 100644
--- a/internal/validation/example_test.go
+++ b/internal/validation/example_test.go
@@ -7,7 +7,7 @@ import (
"regexp"
"time"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/nobl9/nobl9-go/internal/validation"
)
diff --git a/manifest/v1alpha/dataexport/data_export.go b/manifest/v1alpha/dataexport/data_export.go
index 0a86397b..ec6ca317 100644
--- a/manifest/v1alpha/dataexport/data_export.go
+++ b/manifest/v1alpha/dataexport/data_export.go
@@ -3,7 +3,7 @@ package dataexport
import (
"encoding/json"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/nobl9/nobl9-go/internal/serdeutil"
"github.com/nobl9/nobl9-go/manifest"
diff --git a/manifest/v1alpha/parser/parser.go b/manifest/v1alpha/parser/parser.go
index 0765d0a3..e7964023 100644
--- a/manifest/v1alpha/parser/parser.go
+++ b/manifest/v1alpha/parser/parser.go
@@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/pkg/errors"
"github.com/nobl9/nobl9-go/manifest"
diff --git a/sdk/decode.go b/sdk/decode.go
index 2457d196..7f801ed9 100644
--- a/sdk/decode.go
+++ b/sdk/decode.go
@@ -8,7 +8,7 @@ import (
"regexp"
"strings"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/pkg/errors"
"github.com/nobl9/nobl9-go/manifest"
diff --git a/sdk/decode_test.go b/sdk/decode_test.go
index 025d76a6..e8e62e2f 100644
--- a/sdk/decode_test.go
+++ b/sdk/decode_test.go
@@ -8,7 +8,7 @@ import (
"path/filepath"
"testing"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
diff --git a/sdk/encode.go b/sdk/encode.go
index 01373977..f33c335e 100644
--- a/sdk/encode.go
+++ b/sdk/encode.go
@@ -5,7 +5,7 @@ import (
"fmt"
"io"
- "github.com/goccy/go-yaml"
+ "github.com/nobl9/go-yaml"
"github.com/nobl9/nobl9-go/manifest"
)
From 9732f5449673a88bdcbdf7184b26efc6399dbb85 Mon Sep 17 00:00:00 2001
From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com>
Date: Mon, 8 Jul 2024 11:37:32 +0200
Subject: [PATCH 08/13] feat: Define manifest objects examples in code (#477)
## Motivation
We're currently lacking in examples for our `v1alpha` objects.
This PR covers that hole by adding utilities for generating these
examples and verifying them.
## Release Notes
Added extended examples to the `v1alpha` objects with different
configuration variants.
---
Makefile | 9 +-
cspell.yaml | 10 +
internal/cmd/docgen/go_doc.go | 4 +-
internal/cmd/docgen/object_doc.go | 4 +-
internal/cmd/examplegen/main.go | 153 +
internal/manifest/objects_test.go | 4 +-
internal/manifest/v1alpha/examples/agent.go | 169 +
.../manifest/v1alpha/examples/agent_test.go | 19 +
.../manifest/v1alpha/examples/alert_method.go | 197 ++
.../v1alpha/examples/alert_method_test.go | 19 +
.../manifest/v1alpha/examples/alert_policy.go | 312 ++
.../v1alpha/examples/alert_silence.go | 94 +
.../manifest/v1alpha/examples/annotation.go | 41 +
.../v1alpha/examples/budget_adjustment.go | 42 +
.../manifest/v1alpha/examples/data_export.go | 45 +
internal/manifest/v1alpha/examples/direct.go | 190 ++
.../manifest/v1alpha/examples/direct_test.go | 23 +
internal/manifest/v1alpha/examples/example.go | 41 +
internal/manifest/v1alpha/examples/labels.go | 18 +
.../v1alpha/examples/metadata_annotations.go | 18 +
internal/manifest/v1alpha/examples/project.go | 20 +
.../queries/cloudwatch_count_bad.json | 7 +
.../queries/cloudwatch_count_good.json | 7 +
.../queries/cloudwatch_count_total.json | 7 +
.../queries/cloudwatch_threshold.json | 43 +
.../queries/elasticsearch_count_good.json | 50 +
.../queries/elasticsearch_count_total.json | 44 +
.../queries/elasticsearch_threshold.json | 49 +
.../queries/instana_application_query.json | 34 +
.../manifest/v1alpha/examples/role_binding.go | 62 +
internal/manifest/v1alpha/examples/service.go | 21 +
internal/manifest/v1alpha/examples/slo.go | 197 ++
.../manifest/v1alpha/examples/slo_test.go | 19 +
.../manifest/v1alpha/examples/slo_variants.go | 1112 +++++++
internal/manifest/v1alpha/examples/utils.go | 52 +
.../v1alpha/examples/validation_test.go | 135 +
.../manifest/v1alphatest/labels_validation.go | 3 +-
.../metadata_annotations_validation.go | 3 +-
.../path.go => pathutils/root_path.go} | 2 +-
manifest/v1alpha/agent/example.yaml | 10 -
.../agent/examples/amazon-prometheus.yaml | 23 +
.../v1alpha/agent/examples/app-dynamics.yaml | 22 +
.../v1alpha/agent/examples/azure-monitor.yaml | 22 +
.../agent/examples/azure-prometheus.yaml | 23 +
.../v1alpha/agent/examples/big-query.yaml | 14 +
.../v1alpha/agent/examples/cloud-watch.yaml | 21 +
manifest/v1alpha/agent/examples/datadog.yaml | 22 +
.../v1alpha/agent/examples/dynatrace.yaml | 22 +
.../v1alpha/agent/examples/elasticsearch.yaml | 15 +
manifest/v1alpha/agent/examples/generic.yaml | 14 +
.../examples/google-cloud-monitoring.yaml | 21 +
.../v1alpha/agent/examples/grafana-loki.yaml | 15 +
manifest/v1alpha/agent/examples/graphite.yaml | 22 +
.../v1alpha/agent/examples/honeycomb.yaml | 21 +
.../v1alpha/agent/examples/influx-d-b.yaml | 15 +
manifest/v1alpha/agent/examples/instana.yaml | 15 +
.../v1alpha/agent/examples/lightstep.yaml | 24 +
.../v1alpha/agent/examples/logic-monitor.yaml | 15 +
.../v1alpha/agent/examples/new-relic.yaml | 22 +
.../v1alpha/agent/examples/open-t-s-d-b.yaml | 15 +
manifest/v1alpha/agent/examples/pingdom.yaml | 14 +
.../v1alpha/agent/examples/prometheus.yaml | 22 +
manifest/v1alpha/agent/examples/redshift.yaml | 14 +
.../agent/examples/splunk-observability.yaml | 15 +
manifest/v1alpha/agent/examples/splunk.yaml | 22 +
.../v1alpha/agent/examples/sumo-logic.yaml | 15 +
.../v1alpha/agent/examples/thousand-eyes.yaml | 14 +
.../alert/{example.yaml => examples.yaml} | 0
manifest/v1alpha/alertmethod/example.yaml | 10 -
.../v1alpha/alertmethod/examples/discord.yaml | 10 +
.../v1alpha/alertmethod/examples/email.yaml | 17 +
.../v1alpha/alertmethod/examples/jira.yaml | 13 +
.../alertmethod/examples/opsgenie.yaml | 11 +
.../alertmethod/examples/pagerduty.yaml | 12 +
.../alertmethod/examples/servicenow.yaml | 12 +
.../v1alpha/alertmethod/examples/slack.yaml | 10 +
.../v1alpha/alertmethod/examples/teams.yaml | 10 +
.../v1alpha/alertmethod/examples/webhook.yaml | 65 +
manifest/v1alpha/alertpolicy/example.yaml | 20 -
.../examples/budget-almost-exhausted.yaml | 36 +
.../alertpolicy/examples/budget-drop.yaml | 76 +
.../alertpolicy/examples/fast-burn.yaml | 37 +
.../alertpolicy/examples/fast-exhaustion.yaml | 84 +
.../alertpolicy/examples/slow-burn.yaml | 84 +
.../alertpolicy/examples/slow-exhaustion.yaml | 92 +
manifest/v1alpha/alertsilence/example.yaml | 12 -
manifest/v1alpha/alertsilence/examples.yaml | 54 +
manifest/v1alpha/annotation/example.yaml | 11 -
manifest/v1alpha/annotation/examples.yaml | 21 +
manifest/v1alpha/annotation/validation.go | 8 +-
.../v1alpha/budgetadjustment/example.yaml | 14 -
.../v1alpha/budgetadjustment/examples.yaml | 18 +
manifest/v1alpha/data_sources.go | 6 +-
manifest/v1alpha/dataexport/example.yaml | 11 -
manifest/v1alpha/dataexport/examples.yaml | 23 +
manifest/v1alpha/direct/example.yaml | 12 -
.../v1alpha/direct/examples/app-dynamics.yaml | 26 +
.../direct/examples/azure-monitor.yaml | 24 +
.../v1alpha/direct/examples/big-query.yaml | 15 +
.../v1alpha/direct/examples/cloud-watch.yaml | 22 +
manifest/v1alpha/direct/examples/datadog.yaml | 24 +
.../v1alpha/direct/examples/dynatrace.yaml | 23 +
.../examples/google-cloud-monitoring.yaml | 22 +
.../v1alpha/direct/examples/honeycomb.yaml | 22 +
.../v1alpha/direct/examples/influx-d-b.yaml | 17 +
manifest/v1alpha/direct/examples/instana.yaml | 16 +
.../v1alpha/direct/examples/lightstep.yaml | 25 +
.../direct/examples/logic-monitor.yaml | 17 +
.../v1alpha/direct/examples/new-relic.yaml | 23 +
manifest/v1alpha/direct/examples/pingdom.yaml | 15 +
.../v1alpha/direct/examples/redshift.yaml | 18 +
.../direct/examples/splunk-observability.yaml | 16 +
manifest/v1alpha/direct/examples/splunk.yaml | 23 +
.../v1alpha/direct/examples/sumo-logic.yaml | 17 +
.../direct/examples/thousand-eyes.yaml | 15 +
manifest/v1alpha/direct/validation.go | 34 +-
manifest/v1alpha/labels.go | 4 +-
manifest/v1alpha/labels_examples.yaml | 20 +-
manifest/v1alpha/metadata_annotations.go | 4 +-
.../metadata_annotations_examples.yaml | 4 +-
manifest/v1alpha/project/example.yaml | 10 -
manifest/v1alpha/project/examples.yaml | 24 +
manifest/v1alpha/rolebinding/example.yaml | 8 -
manifest/v1alpha/rolebinding/examples.yaml | 30 +
manifest/v1alpha/service/example.yaml | 11 -
manifest/v1alpha/service/examples.yaml | 25 +
manifest/v1alpha/slo/example.yaml | 39 -
.../slo/examples/amazon-prometheus.yaml | 516 +++
.../v1alpha/slo/examples/app-dynamics.yaml | 800 +++++
.../v1alpha/slo/examples/azure-monitor.yaml | 1836 +++++++++++
.../slo/examples/azure-prometheus.yaml | 792 +++++
manifest/v1alpha/slo/examples/big-query.yaml | 540 ++++
.../v1alpha/slo/examples/cloud-watch.yaml | 2840 +++++++++++++++++
manifest/v1alpha/slo/examples/datadog.yaml | 516 +++
manifest/v1alpha/slo/examples/dynatrace.yaml | 516 +++
.../v1alpha/slo/examples/elasticsearch.yaml | 1100 +++++++
manifest/v1alpha/slo/examples/generic.yaml | 516 +++
.../slo/examples/google-cloud-monitoring.yaml | 624 ++++
.../v1alpha/slo/examples/grafana-loki.yaml | 516 +++
manifest/v1alpha/slo/examples/graphite.yaml | 516 +++
manifest/v1alpha/slo/examples/honeycomb.yaml | 800 +++++
manifest/v1alpha/slo/examples/influx-d-b.yaml | 576 ++++
manifest/v1alpha/slo/examples/instana.yaml | 1588 +++++++++
manifest/v1alpha/slo/examples/lightstep.yaml | 1336 ++++++++
.../v1alpha/slo/examples/logic-monitor.yaml | 840 +++++
manifest/v1alpha/slo/examples/new-relic.yaml | 516 +++
.../v1alpha/slo/examples/open-t-s-d-b.yaml | 516 +++
manifest/v1alpha/slo/examples/pingdom.yaml | 824 +++++
manifest/v1alpha/slo/examples/prometheus.yaml | 516 +++
manifest/v1alpha/slo/examples/redshift.yaml | 552 ++++
.../slo/examples/splunk-observability.yaml | 516 +++
manifest/v1alpha/slo/examples/splunk.yaml | 516 +++
manifest/v1alpha/slo/examples/sumo-logic.yaml | 1172 +++++++
.../v1alpha/slo/examples/thousand-eyes.yaml | 1820 +++++++++++
manifest/v1alpha/slo/metrics_validation.go | 1 +
manifest/v1alpha/slo/slo.go | 13 +-
manifest/v1alpha/slo/validation.go | 42 +-
.../usergroup/{example.yaml => examples.yaml} | 0
manifest/version.go | 8 +
159 files changed, 28705 insertions(+), 245 deletions(-)
create mode 100644 internal/cmd/examplegen/main.go
create mode 100644 internal/manifest/v1alpha/examples/agent.go
create mode 100644 internal/manifest/v1alpha/examples/agent_test.go
create mode 100644 internal/manifest/v1alpha/examples/alert_method.go
create mode 100644 internal/manifest/v1alpha/examples/alert_method_test.go
create mode 100644 internal/manifest/v1alpha/examples/alert_policy.go
create mode 100644 internal/manifest/v1alpha/examples/alert_silence.go
create mode 100644 internal/manifest/v1alpha/examples/annotation.go
create mode 100644 internal/manifest/v1alpha/examples/budget_adjustment.go
create mode 100644 internal/manifest/v1alpha/examples/data_export.go
create mode 100644 internal/manifest/v1alpha/examples/direct.go
create mode 100644 internal/manifest/v1alpha/examples/direct_test.go
create mode 100644 internal/manifest/v1alpha/examples/example.go
create mode 100644 internal/manifest/v1alpha/examples/labels.go
create mode 100644 internal/manifest/v1alpha/examples/metadata_annotations.go
create mode 100644 internal/manifest/v1alpha/examples/project.go
create mode 100644 internal/manifest/v1alpha/examples/queries/cloudwatch_count_bad.json
create mode 100644 internal/manifest/v1alpha/examples/queries/cloudwatch_count_good.json
create mode 100644 internal/manifest/v1alpha/examples/queries/cloudwatch_count_total.json
create mode 100644 internal/manifest/v1alpha/examples/queries/cloudwatch_threshold.json
create mode 100644 internal/manifest/v1alpha/examples/queries/elasticsearch_count_good.json
create mode 100644 internal/manifest/v1alpha/examples/queries/elasticsearch_count_total.json
create mode 100644 internal/manifest/v1alpha/examples/queries/elasticsearch_threshold.json
create mode 100644 internal/manifest/v1alpha/examples/queries/instana_application_query.json
create mode 100644 internal/manifest/v1alpha/examples/role_binding.go
create mode 100644 internal/manifest/v1alpha/examples/service.go
create mode 100644 internal/manifest/v1alpha/examples/slo.go
create mode 100644 internal/manifest/v1alpha/examples/slo_test.go
create mode 100644 internal/manifest/v1alpha/examples/slo_variants.go
create mode 100644 internal/manifest/v1alpha/examples/utils.go
create mode 100644 internal/manifest/v1alpha/examples/validation_test.go
rename internal/{testutils/path.go => pathutils/root_path.go} (95%)
delete mode 100644 manifest/v1alpha/agent/example.yaml
create mode 100644 manifest/v1alpha/agent/examples/amazon-prometheus.yaml
create mode 100644 manifest/v1alpha/agent/examples/app-dynamics.yaml
create mode 100644 manifest/v1alpha/agent/examples/azure-monitor.yaml
create mode 100644 manifest/v1alpha/agent/examples/azure-prometheus.yaml
create mode 100644 manifest/v1alpha/agent/examples/big-query.yaml
create mode 100644 manifest/v1alpha/agent/examples/cloud-watch.yaml
create mode 100644 manifest/v1alpha/agent/examples/datadog.yaml
create mode 100644 manifest/v1alpha/agent/examples/dynatrace.yaml
create mode 100644 manifest/v1alpha/agent/examples/elasticsearch.yaml
create mode 100644 manifest/v1alpha/agent/examples/generic.yaml
create mode 100644 manifest/v1alpha/agent/examples/google-cloud-monitoring.yaml
create mode 100644 manifest/v1alpha/agent/examples/grafana-loki.yaml
create mode 100644 manifest/v1alpha/agent/examples/graphite.yaml
create mode 100644 manifest/v1alpha/agent/examples/honeycomb.yaml
create mode 100644 manifest/v1alpha/agent/examples/influx-d-b.yaml
create mode 100644 manifest/v1alpha/agent/examples/instana.yaml
create mode 100644 manifest/v1alpha/agent/examples/lightstep.yaml
create mode 100644 manifest/v1alpha/agent/examples/logic-monitor.yaml
create mode 100644 manifest/v1alpha/agent/examples/new-relic.yaml
create mode 100644 manifest/v1alpha/agent/examples/open-t-s-d-b.yaml
create mode 100644 manifest/v1alpha/agent/examples/pingdom.yaml
create mode 100644 manifest/v1alpha/agent/examples/prometheus.yaml
create mode 100644 manifest/v1alpha/agent/examples/redshift.yaml
create mode 100644 manifest/v1alpha/agent/examples/splunk-observability.yaml
create mode 100644 manifest/v1alpha/agent/examples/splunk.yaml
create mode 100644 manifest/v1alpha/agent/examples/sumo-logic.yaml
create mode 100644 manifest/v1alpha/agent/examples/thousand-eyes.yaml
rename manifest/v1alpha/alert/{example.yaml => examples.yaml} (100%)
delete mode 100644 manifest/v1alpha/alertmethod/example.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/discord.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/email.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/jira.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/opsgenie.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/pagerduty.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/servicenow.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/slack.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/teams.yaml
create mode 100644 manifest/v1alpha/alertmethod/examples/webhook.yaml
delete mode 100644 manifest/v1alpha/alertpolicy/example.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/budget-almost-exhausted.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/budget-drop.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/fast-burn.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/fast-exhaustion.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/slow-burn.yaml
create mode 100644 manifest/v1alpha/alertpolicy/examples/slow-exhaustion.yaml
delete mode 100644 manifest/v1alpha/alertsilence/example.yaml
create mode 100644 manifest/v1alpha/alertsilence/examples.yaml
delete mode 100644 manifest/v1alpha/annotation/example.yaml
create mode 100644 manifest/v1alpha/annotation/examples.yaml
delete mode 100644 manifest/v1alpha/budgetadjustment/example.yaml
create mode 100644 manifest/v1alpha/budgetadjustment/examples.yaml
delete mode 100644 manifest/v1alpha/dataexport/example.yaml
create mode 100644 manifest/v1alpha/dataexport/examples.yaml
delete mode 100644 manifest/v1alpha/direct/example.yaml
create mode 100644 manifest/v1alpha/direct/examples/app-dynamics.yaml
create mode 100644 manifest/v1alpha/direct/examples/azure-monitor.yaml
create mode 100644 manifest/v1alpha/direct/examples/big-query.yaml
create mode 100644 manifest/v1alpha/direct/examples/cloud-watch.yaml
create mode 100644 manifest/v1alpha/direct/examples/datadog.yaml
create mode 100644 manifest/v1alpha/direct/examples/dynatrace.yaml
create mode 100644 manifest/v1alpha/direct/examples/google-cloud-monitoring.yaml
create mode 100644 manifest/v1alpha/direct/examples/honeycomb.yaml
create mode 100644 manifest/v1alpha/direct/examples/influx-d-b.yaml
create mode 100644 manifest/v1alpha/direct/examples/instana.yaml
create mode 100644 manifest/v1alpha/direct/examples/lightstep.yaml
create mode 100644 manifest/v1alpha/direct/examples/logic-monitor.yaml
create mode 100644 manifest/v1alpha/direct/examples/new-relic.yaml
create mode 100644 manifest/v1alpha/direct/examples/pingdom.yaml
create mode 100644 manifest/v1alpha/direct/examples/redshift.yaml
create mode 100644 manifest/v1alpha/direct/examples/splunk-observability.yaml
create mode 100644 manifest/v1alpha/direct/examples/splunk.yaml
create mode 100644 manifest/v1alpha/direct/examples/sumo-logic.yaml
create mode 100644 manifest/v1alpha/direct/examples/thousand-eyes.yaml
delete mode 100644 manifest/v1alpha/project/example.yaml
create mode 100644 manifest/v1alpha/project/examples.yaml
delete mode 100644 manifest/v1alpha/rolebinding/example.yaml
create mode 100644 manifest/v1alpha/rolebinding/examples.yaml
delete mode 100644 manifest/v1alpha/service/example.yaml
create mode 100644 manifest/v1alpha/service/examples.yaml
delete mode 100644 manifest/v1alpha/slo/example.yaml
create mode 100644 manifest/v1alpha/slo/examples/amazon-prometheus.yaml
create mode 100644 manifest/v1alpha/slo/examples/app-dynamics.yaml
create mode 100644 manifest/v1alpha/slo/examples/azure-monitor.yaml
create mode 100644 manifest/v1alpha/slo/examples/azure-prometheus.yaml
create mode 100644 manifest/v1alpha/slo/examples/big-query.yaml
create mode 100644 manifest/v1alpha/slo/examples/cloud-watch.yaml
create mode 100644 manifest/v1alpha/slo/examples/datadog.yaml
create mode 100644 manifest/v1alpha/slo/examples/dynatrace.yaml
create mode 100644 manifest/v1alpha/slo/examples/elasticsearch.yaml
create mode 100644 manifest/v1alpha/slo/examples/generic.yaml
create mode 100644 manifest/v1alpha/slo/examples/google-cloud-monitoring.yaml
create mode 100644 manifest/v1alpha/slo/examples/grafana-loki.yaml
create mode 100644 manifest/v1alpha/slo/examples/graphite.yaml
create mode 100644 manifest/v1alpha/slo/examples/honeycomb.yaml
create mode 100644 manifest/v1alpha/slo/examples/influx-d-b.yaml
create mode 100644 manifest/v1alpha/slo/examples/instana.yaml
create mode 100644 manifest/v1alpha/slo/examples/lightstep.yaml
create mode 100644 manifest/v1alpha/slo/examples/logic-monitor.yaml
create mode 100644 manifest/v1alpha/slo/examples/new-relic.yaml
create mode 100644 manifest/v1alpha/slo/examples/open-t-s-d-b.yaml
create mode 100644 manifest/v1alpha/slo/examples/pingdom.yaml
create mode 100644 manifest/v1alpha/slo/examples/prometheus.yaml
create mode 100644 manifest/v1alpha/slo/examples/redshift.yaml
create mode 100644 manifest/v1alpha/slo/examples/splunk-observability.yaml
create mode 100644 manifest/v1alpha/slo/examples/splunk.yaml
create mode 100644 manifest/v1alpha/slo/examples/sumo-logic.yaml
create mode 100644 manifest/v1alpha/slo/examples/thousand-eyes.yaml
rename manifest/v1alpha/usergroup/{example.yaml => examples.yaml} (100%)
diff --git a/Makefile b/Makefile
index afa8b4f8..9cb2607e 100644
--- a/Makefile
+++ b/Makefile
@@ -107,9 +107,9 @@ check/format:
$(call _print_check_step,Checking if files are formatted)
./scripts/check-formatting.sh
-.PHONY: generate generate/code generate/diagrams
+.PHONY: generate generate/code generate/examples generate/plantuml
## Auto generate files.
-generate: generate/code generate/plantuml
+generate: generate/code generate/examples generate/plantuml
## Generate Golang code.
generate/code:
@@ -119,6 +119,11 @@ generate/code:
go generate ./... ./docs/mock_example
${MAKE} format/go
+## Generate examples from code.
+generate/examples:
+ echo "Generating examples..."
+ go run internal/cmd/examplegen/main.go
+
PLANTUML_JAR_URL := https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
PLANTUML_JAR := $(BIN_DIR)/plantuml.jar
DIAGRAMS_PATH ?= .
diff --git a/cspell.yaml b/cspell.yaml
index 19094f73..3e22f341 100644
--- a/cspell.yaml
+++ b/cspell.yaml
@@ -17,6 +17,7 @@ ignoreRegExpList:
- /nolint.*/g
- /nosec.*/g
- /(errors|fmt|assert|require)\.[^\(]+/g
+ - /access(key)?id.*/ig
ignorePaths:
- sdk/test_data
- .golangci.yml
@@ -30,7 +31,13 @@ ignorePaths:
- "**/test_data/**"
- "docs/mock_example/mocks/*"
words:
+ - 00u2y4e4atkzaYkXP4x8
+ - CONNECTIONFAILURES
+ - CONNECTIONSESTABLISHED
+ - CONNECTIONSUCCESSES
+ - DzpxcSRh
- MAXRTT
+ - TIMEMAX
- aggs
- alertmethod
- alertpolicy
@@ -61,6 +68,7 @@ words:
- dynatrace
- endef
- enduml
+ - examplegen
- fatalf
- gobin
- gofile
@@ -72,6 +80,7 @@ words:
- goreleaser
- gosec
- govulncheck
+ - group-Q72HorLyjjCc
- groupmy
- hrdu
- httpurls
@@ -103,6 +112,7 @@ words:
- opentsdb
- opsgenie
- pagerduty
+ - pathutils
- plantuml
- preconfigured
- promql
diff --git a/internal/cmd/docgen/go_doc.go b/internal/cmd/docgen/go_doc.go
index 54fad0f5..d3b4d277 100644
--- a/internal/cmd/docgen/go_doc.go
+++ b/internal/cmd/docgen/go_doc.go
@@ -15,7 +15,7 @@ import (
"golang.org/x/exp/maps"
- "github.com/nobl9/nobl9-go/internal/testutils"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
)
const moduleRootPath = "github.com/nobl9/nobl9-go"
@@ -32,7 +32,7 @@ func (t goTypeDoc) PkgPath() string {
}
func parseGoDocs() map[string]goTypeDoc {
- root := testutils.FindModuleRoot()
+ root := pathutils.FindModuleRoot()
objectsDirectory := filepath.Join(root, "manifest")
directories, err := listDirectories(objectsDirectory)
if err != nil {
diff --git a/internal/cmd/docgen/object_doc.go b/internal/cmd/docgen/object_doc.go
index 8e8ca379..be8d6d88 100644
--- a/internal/cmd/docgen/object_doc.go
+++ b/internal/cmd/docgen/object_doc.go
@@ -7,7 +7,7 @@ import (
"reflect"
"strings"
- "github.com/nobl9/nobl9-go/internal/testutils"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
"github.com/nobl9/nobl9-go/manifest"
)
@@ -27,7 +27,7 @@ func generateObjectDocs(objectNames []string) []*ObjectDoc {
}
}
- rootPath := testutils.FindModuleRoot()
+ rootPath := pathutils.FindModuleRoot()
// Generate object properties based on reflection.
for _, object := range objects {
mapper := newObjectMapper()
diff --git a/internal/cmd/examplegen/main.go b/internal/cmd/examplegen/main.go
new file mode 100644
index 00000000..db621c1a
--- /dev/null
+++ b/internal/cmd/examplegen/main.go
@@ -0,0 +1,153 @@
+package main
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "sort"
+ "strings"
+
+ "github.com/goccy/go-yaml"
+
+ v1alphaExamples "github.com/nobl9/nobl9-go/internal/manifest/v1alpha/examples"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+type examplesGeneratorConfig struct {
+ Examples []v1alphaExamples.Example
+ Path string
+ Comments yaml.CommentMap
+}
+
+const manifestPath = "manifest"
+
+func main() {
+ rootPath := pathutils.FindModuleRoot()
+ configs := getV1alphaExamplesConfigs()
+ for _, config := range configs {
+ examples := make([]any, 0, len(config.Examples))
+ for _, variant := range config.Examples {
+ examples = append(examples, variant.GetObject())
+ }
+ config.Path = filepath.Join(rootPath, config.Path)
+ var input any
+ if len(examples) == 1 {
+ input = examples[0]
+ } else {
+ input = examples
+ }
+ if err := writeExamples(input, config.Path, config.Comments); err != nil {
+ panic(err.Error())
+ }
+ }
+}
+
+func getV1alphaExamplesConfigs() []examplesGeneratorConfig {
+ basePath := filepath.Join(manifestPath, "v1alpha")
+ // Non-standard examples.
+ configs := []examplesGeneratorConfig{
+ {
+ Examples: v1alphaExamples.Labels(),
+ Path: filepath.Join(basePath, "labels_examples.yaml"),
+ },
+ {
+ Examples: v1alphaExamples.MetadataAnnotations(),
+ Path: filepath.Join(basePath, "metadata_annotations_examples.yaml"),
+ },
+ }
+ // Standard examples.
+ allExamples := [][]v1alphaExamples.Example{
+ v1alphaExamples.Project(),
+ v1alphaExamples.Service(),
+ v1alphaExamples.AlertMethod(),
+ v1alphaExamples.SLO(),
+ v1alphaExamples.Agent(),
+ v1alphaExamples.Direct(),
+ v1alphaExamples.AlertPolicy(),
+ v1alphaExamples.AlertSilence(),
+ v1alphaExamples.Annotation(),
+ v1alphaExamples.BudgetAdjustment(),
+ v1alphaExamples.DataExport(),
+ v1alphaExamples.RoleBinding(),
+ }
+ for _, examples := range allExamples {
+ object := examples[0].GetObject().(manifest.Object)
+ basePath := filepath.Join(
+ manifestPath,
+ object.GetVersion().VersionString(),
+ object.GetKind().ToLower(),
+ )
+ grouped := groupBy(examples, func(e v1alphaExamples.Example) string { return e.GetVariant() })
+ // If we don't have any variants, we can write all examples into examples.yaml file.
+ if len(grouped) == 1 {
+ configs = append(configs, examplesGeneratorConfig{
+ Examples: examples,
+ Path: filepath.Join(basePath, "examples.yaml"),
+ })
+ continue
+ }
+ for variant, examples := range grouped {
+ config := examplesGeneratorConfig{
+ Examples: examples,
+ Path: filepath.Join(basePath, "examples", strings.ReplaceAll(strings.ToLower(variant), " ", "-")+".yaml"),
+ Comments: make(yaml.CommentMap),
+ }
+ if len(examples) == 1 {
+ configs = append(configs, config)
+ continue
+ }
+ if examples[0].GetSubVariant() != "" {
+ sort.Slice(examples, func(i, j int) bool {
+ return examples[i].GetSubVariant() < examples[j].GetSubVariant()
+ })
+ }
+ for i, example := range examples {
+ comments := example.GetYAMLComments()
+ if len(comments) == 0 {
+ continue
+ }
+ for i := range comments {
+ comments[i] = " " + comments[i]
+ }
+ config.Comments[fmt.Sprintf("$[%d]", i)] = []*yaml.Comment{yaml.HeadComment(comments...)}
+ }
+ configs = append(configs, config)
+ }
+ }
+ return configs
+}
+
+func writeExamples(v any, path string, comments yaml.CommentMap) error {
+ if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil {
+ return err
+ }
+ // #nosec G304
+ file, err := os.Create(path)
+ if err != nil {
+ return err
+ }
+ defer func() { _ = file.Close() }()
+ if object, ok := v.(manifest.Object); ok {
+ return sdk.EncodeObject(object, file, manifest.ObjectFormatYAML)
+ }
+ opts := []yaml.EncodeOption{
+ yaml.Indent(2),
+ yaml.UseLiteralStyleIfMultiline(true),
+ }
+ if len(comments) > 0 {
+ opts = append(opts, yaml.WithComment(comments))
+ }
+ enc := yaml.NewEncoder(file, opts...)
+ return enc.Encode(v)
+}
+
+func groupBy[K comparable, V any](s []V, key func(V) K) map[K][]V {
+ m := make(map[K][]V)
+ for _, v := range s {
+ k := key(v)
+ m[k] = append(m[k], v)
+ }
+ return m
+}
diff --git a/internal/manifest/objects_test.go b/internal/manifest/objects_test.go
index 3f279afe..35cd5cef 100644
--- a/internal/manifest/objects_test.go
+++ b/internal/manifest/objects_test.go
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/nobl9/nobl9-go/internal/testutils"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
"github.com/nobl9/nobl9-go/manifest"
v1alphaParser "github.com/nobl9/nobl9-go/manifest/v1alpha/parser"
"github.com/nobl9/nobl9-go/sdk"
@@ -20,7 +20,7 @@ func TestMain(m *testing.M) {
}
func TestObjectExamples(t *testing.T) {
- moduleRoot := testutils.FindModuleRoot()
+ moduleRoot := pathutils.FindModuleRoot()
objects, err := sdk.ReadObjects(context.Background(), filepath.Join(moduleRoot, "manifest/**/example*.yaml"))
require.NoError(t, err)
assert.Greater(t, len(objects), 0, "no object examples found")
diff --git a/internal/manifest/v1alpha/examples/agent.go b/internal/manifest/v1alpha/examples/agent.go
new file mode 100644
index 00000000..040fa172
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/agent.go
@@ -0,0 +1,169 @@
+package v1alphaExamples
+
+import (
+ "fmt"
+
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAgent "github.com/nobl9/nobl9-go/manifest/v1alpha/agent"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+type agentExample struct {
+ standardExample
+ typ v1alpha.DataSourceType
+}
+
+func Agent() []Example {
+ types := v1alpha.DataSourceTypeValues()
+ examples := make([]Example, 0, len(types))
+ for _, typ := range types {
+ example := agentExample{
+ standardExample: standardExample{
+ Variant: toKebabCase(typ.String()),
+ },
+ typ: typ,
+ }
+ example.Object = example.Generate()
+ examples = append(examples, example)
+ }
+ return examples
+}
+
+func (a agentExample) Generate() v1alphaAgent.Agent {
+ titleName := dataSourceTypePrettyName(a.typ)
+ agent := v1alphaAgent.New(
+ v1alphaAgent.Metadata{
+ Name: a.Variant,
+ DisplayName: titleName + " Agent",
+ Project: sdk.DefaultProject,
+ },
+ v1alphaAgent.Spec{
+ Description: fmt.Sprintf("Example %s Agent", titleName),
+ ReleaseChannel: v1alpha.ReleaseChannelStable,
+ },
+ )
+ agent = a.generateVariant(agent)
+ typ, _ := agent.Spec.GetType()
+ if maxDuration, err := v1alpha.GetDataRetrievalMaxDuration(manifest.KindAgent, typ); err == nil {
+ agent.Spec.HistoricalDataRetrieval = &v1alpha.HistoricalDataRetrieval{
+ MaxDuration: maxDuration,
+ DefaultDuration: v1alpha.HistoricalRetrievalDuration{
+ Value: ptr(*maxDuration.Value / 2),
+ Unit: maxDuration.Unit,
+ },
+ }
+ }
+ defaultQueryDelay := v1alpha.GetQueryDelayDefaults()[typ]
+ agent.Spec.QueryDelay = &v1alpha.QueryDelay{
+ Duration: v1alpha.Duration{
+ Value: ptr(*defaultQueryDelay.Value + 1),
+ Unit: defaultQueryDelay.Unit,
+ },
+ }
+ return agent
+}
+
+func (a agentExample) generateVariant(agent v1alphaAgent.Agent) v1alphaAgent.Agent {
+ switch a.typ {
+ case v1alpha.AmazonPrometheus:
+ agent.Spec.AmazonPrometheus = &v1alphaAgent.AmazonPrometheusConfig{
+ URL: "https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-f49ecf99-6dfa-4b00-9f94-a50b10a3010b",
+ Region: "us-east-1",
+ }
+ case v1alpha.AppDynamics:
+ agent.Spec.AppDynamics = &v1alphaAgent.AppDynamicsConfig{
+ URL: "https://my-org.saas.appdynamics.com",
+ }
+ case v1alpha.AzureMonitor:
+ agent.Spec.AzureMonitor = &v1alphaAgent.AzureMonitorConfig{
+ TenantID: "5cdecca3-c2c5-4072-89dd-5555faf05202",
+ }
+ case v1alpha.AzurePrometheus:
+ agent.Spec.AzurePrometheus = &v1alphaAgent.AzurePrometheusConfig{
+ URL: "https://defaultazuremonitorworkspace-westus2-szxw.westus2.prometheus.monitor.azure.com",
+ TenantID: "41372654-f4b6-4bd1-a3fe-75629c024df1",
+ }
+ case v1alpha.BigQuery:
+ agent.Spec.BigQuery = &v1alphaAgent.BigQueryConfig{}
+ case v1alpha.CloudWatch:
+ agent.Spec.CloudWatch = &v1alphaAgent.CloudWatchConfig{}
+ case v1alpha.Datadog:
+ agent.Spec.Datadog = &v1alphaAgent.DatadogConfig{
+ Site: "com",
+ }
+ case v1alpha.Dynatrace:
+ agent.Spec.Dynatrace = &v1alphaAgent.DynatraceConfig{
+ URL: "https://zvf10945.live.dynatrace.com/",
+ }
+ case v1alpha.Elasticsearch:
+ agent.Spec.Elasticsearch = &v1alphaAgent.ElasticsearchConfig{
+ URL: "http://elasticsearch-main.elasticsearch:9200",
+ }
+ case v1alpha.GCM:
+ agent.Spec.GCM = &v1alphaAgent.GCMConfig{}
+ case v1alpha.Generic:
+ agent.Spec.Generic = &v1alphaAgent.GenericConfig{}
+ case v1alpha.GrafanaLoki:
+ agent.Spec.GrafanaLoki = &v1alphaAgent.GrafanaLokiConfig{
+ URL: "http://grafana-loki.loki:3100",
+ }
+ case v1alpha.Graphite:
+ agent.Spec.Graphite = &v1alphaAgent.GraphiteConfig{
+ URL: "http://graphite.graphite:8080/render",
+ }
+ case v1alpha.Honeycomb:
+ agent.Spec.Honeycomb = &v1alphaAgent.HoneycombConfig{}
+ case v1alpha.InfluxDB:
+ agent.Spec.InfluxDB = &v1alphaAgent.InfluxDBConfig{
+ URL: "https://us-west-2-2.aws.cloud2.influxdata.com",
+ }
+ case v1alpha.Instana:
+ agent.Spec.Instana = &v1alphaAgent.InstanaConfig{
+ URL: "https://orange-my-org12.instana.io",
+ }
+ case v1alpha.Lightstep:
+ agent.Spec.Lightstep = &v1alphaAgent.LightstepConfig{
+ Organization: "MyOrg",
+ Project: "prod-app",
+ URL: "https://api.lightstep.com",
+ }
+ case v1alpha.LogicMonitor:
+ agent.Spec.LogicMonitor = &v1alphaAgent.LogicMonitorConfig{
+ Account: "my-account-name",
+ }
+ case v1alpha.NewRelic:
+ agent.Spec.NewRelic = &v1alphaAgent.NewRelicConfig{
+ AccountID: 1234567,
+ }
+ case v1alpha.OpenTSDB:
+ agent.Spec.OpenTSDB = &v1alphaAgent.OpenTSDBConfig{
+ URL: "http://opentsdb.opentsdb:4242",
+ }
+ case v1alpha.Pingdom:
+ agent.Spec.Pingdom = &v1alphaAgent.PingdomConfig{}
+ case v1alpha.Prometheus:
+ agent.Spec.Prometheus = &v1alphaAgent.PrometheusConfig{
+ URL: "http://prometheus.prometheus:9090",
+ }
+ case v1alpha.Redshift:
+ agent.Spec.Redshift = &v1alphaAgent.RedshiftConfig{}
+ case v1alpha.Splunk:
+ agent.Spec.Splunk = &v1alphaAgent.SplunkConfig{
+ URL: "https://splunk.my-org.com/services",
+ }
+ case v1alpha.SplunkObservability:
+ agent.Spec.SplunkObservability = &v1alphaAgent.SplunkObservabilityConfig{
+ Realm: "us1",
+ }
+ case v1alpha.SumoLogic:
+ agent.Spec.SumoLogic = &v1alphaAgent.SumoLogicConfig{
+ URL: "https://service.sumologic.com",
+ }
+ case v1alpha.ThousandEyes:
+ agent.Spec.ThousandEyes = &v1alphaAgent.ThousandEyesConfig{}
+ default:
+ panic(fmt.Sprintf("unexpected v1alpha.DataSourceType: %#v", a.typ))
+ }
+ return agent
+}
diff --git a/internal/manifest/v1alpha/examples/agent_test.go b/internal/manifest/v1alpha/examples/agent_test.go
new file mode 100644
index 00000000..ee298705
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/agent_test.go
@@ -0,0 +1,19 @@
+package v1alphaExamples
+
+import (
+ "slices"
+ "testing"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+)
+
+func TestAgent_SupportsAllAgentTypes(t *testing.T) {
+ variants := Agent()
+ for _, typ := range v1alpha.DataSourceTypeValues() {
+ if !slices.ContainsFunc(variants, func(e Example) bool {
+ return e.(agentExample).typ == typ
+ }) {
+ t.Errorf("%T '%s' is not listed in the examples", typ, typ)
+ }
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/alert_method.go b/internal/manifest/v1alpha/examples/alert_method.go
new file mode 100644
index 00000000..37faaca9
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/alert_method.go
@@ -0,0 +1,197 @@
+package v1alphaExamples
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAlertMethod "github.com/nobl9/nobl9-go/manifest/v1alpha/alertmethod"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+type alertMethodSpecSubVariant = string
+
+const (
+ alertMethodSpecSubVariantWebhookTemplate metricVariant = "template"
+ alertMethodSpecSubVariantWebhookTemplateFields metricVariant = "templateFields"
+)
+
+var standardAlertMethods = []v1alpha.AlertMethodType{
+ v1alpha.AlertMethodTypePagerDuty,
+ v1alpha.AlertMethodTypeSlack,
+ v1alpha.AlertMethodTypeDiscord,
+ v1alpha.AlertMethodTypeOpsgenie,
+ v1alpha.AlertMethodTypeServiceNow,
+ v1alpha.AlertMethodTypeJira,
+ v1alpha.AlertMethodTypeTeams,
+ v1alpha.AlertMethodTypeEmail,
+}
+
+var customAlertMethodsSubVariants = map[v1alpha.AlertMethodType][]alertMethodSpecSubVariant{
+ v1alpha.AlertMethodTypeWebhook: {
+ alertMethodSpecSubVariantWebhookTemplate,
+ alertMethodSpecSubVariantWebhookTemplateFields,
+ },
+}
+
+type alertMethodExample struct {
+ standardExample
+ methodType v1alpha.AlertMethodType
+}
+
+func (a alertMethodExample) GetYAMLComments() []string {
+ comment := fmt.Sprintf("%s Alert Method", a.Variant)
+ if a.SubVariant != "" {
+ comment += fmt.Sprintf(" with %s", a.SubVariant)
+ }
+ return []string{comment}
+}
+
+func AlertMethod() []Example {
+ variants := make([]alertMethodExample, 0, len(standardAlertMethods))
+ for _, typ := range standardAlertMethods {
+ variants = append(variants, alertMethodExample{
+ standardExample: standardExample{
+ Variant: typ.String(),
+ },
+ methodType: typ,
+ })
+ }
+ for typ, subVariants := range customAlertMethodsSubVariants {
+ for _, subVariant := range subVariants {
+ variants = append(variants, alertMethodExample{
+ standardExample: standardExample{
+ Variant: typ.String(),
+ SubVariant: subVariant,
+ },
+ methodType: typ,
+ })
+ }
+ }
+ for i := range variants {
+ variants[i].Object = variants[i].Generate()
+ }
+ return newExampleSlice(variants...)
+}
+
+func (a alertMethodExample) Generate() v1alphaAlertMethod.AlertMethod {
+ am := v1alphaAlertMethod.New(
+ v1alphaAlertMethod.Metadata{
+ Name: strings.ToLower(a.Variant),
+ DisplayName: a.Variant + " Alert Method",
+ Project: sdk.DefaultProject,
+ },
+ v1alphaAlertMethod.Spec{
+ Description: fmt.Sprintf("Example %s Alert Method", a.Variant),
+ },
+ )
+ return a.generateVariant(am)
+}
+
+func (a alertMethodExample) generateVariant(am v1alphaAlertMethod.AlertMethod) v1alphaAlertMethod.AlertMethod {
+ switch a.methodType {
+ case v1alpha.AlertMethodTypeEmail:
+ am.Spec.Email = &v1alphaAlertMethod.EmailAlertMethod{
+ To: []string{"alerts-tests@nobl9.com"},
+ Cc: []string{"alerts-tests+cc@nobl9.com"},
+ Bcc: []string{"alerts-tests+bcc@nobl9.com"},
+ Subject: "Your SLO $slo_name needs attention!",
+ Body: `$alert_policy_name has triggered with the following conditions:
+ $alert_policy_conditions[]
+ Time: $timestamp
+ Severity: $severity
+ Project: $project_name
+ Service: $service_name
+ Organization: $organization`,
+ }
+ case v1alpha.AlertMethodTypeDiscord:
+ am.Spec.Discord = &v1alphaAlertMethod.DiscordAlertMethod{
+ URL: "https://discord.com/api/webhooks/123/secret",
+ }
+ case v1alpha.AlertMethodTypeJira:
+ am.Spec.Jira = &v1alphaAlertMethod.JiraAlertMethod{
+ URL: "https://nobl9.atlassian.net/",
+ Username: "jira-alerts@nobl9.com",
+ APIToken: "123456789",
+ ProjectKey: "AL",
+ }
+ case v1alpha.AlertMethodTypeOpsgenie:
+ am.Spec.Opsgenie = &v1alphaAlertMethod.OpsgenieAlertMethod{
+ Auth: "GenieKey 123",
+ URL: "https://api.opsgenie.com",
+ }
+ case v1alpha.AlertMethodTypePagerDuty:
+ am.Spec.PagerDuty = &v1alphaAlertMethod.PagerDutyAlertMethod{
+ IntegrationKey: "123456789",
+ SendResolution: &v1alphaAlertMethod.SendResolution{
+ Message: ptr("Alert is now resolved"),
+ },
+ }
+ case v1alpha.AlertMethodTypeServiceNow:
+ am.Spec.ServiceNow = &v1alphaAlertMethod.ServiceNowAlertMethod{
+ Username: "user",
+ Password: "super-strong-password",
+ InstanceName: "vm123",
+ }
+ case v1alpha.AlertMethodTypeSlack:
+ am.Spec.Slack = &v1alphaAlertMethod.SlackAlertMethod{
+ URL: "https://hooks.slack.com/services/321/123/secret",
+ }
+ case v1alpha.AlertMethodTypeTeams:
+ am.Spec.Teams = &v1alphaAlertMethod.TeamsAlertMethod{
+ URL: "https://meshmark.webhook.office.com/webhookb2/123@321/IncomingWebhook/123/321",
+ }
+ case v1alpha.AlertMethodTypeWebhook:
+ am.Spec.Webhook = &v1alphaAlertMethod.WebhookAlertMethod{
+ URL: "https://123.execute-api.eu-central-1.amazonaws.com/default/putReq2S3",
+ Headers: []v1alphaAlertMethod.WebhookHeader{
+ {
+ Name: "Authorization",
+ Value: "very-secret",
+ IsSecret: true,
+ },
+ {
+ Name: "X-User-Data",
+ Value: `{"data":"is here"}`,
+ IsSecret: false,
+ },
+ },
+ }
+ switch a.SubVariant {
+ case alertMethodSpecSubVariantWebhookTemplate:
+ am.Spec.Webhook.Template = ptr(`{
+ "message": "Your SLO $slo_name needs attention!",
+ "timestamp": "$timestamp",
+ "severity": "$severity",
+ "slo": "$slo_name",
+ "project": "$project_name",
+ "organization": "$organization",
+ "alert_policy": "$alert_policy_name",
+ "alerting_conditions": $alert_policy_conditions[],
+ "service": "$service_name",
+ "labels": {
+ "slo": "$slo_labels_text",
+ "service": "$service_labels_text",
+ "alert_policy": "$alert_policy_labels_text"
+ }
+}`)
+ case alertMethodSpecSubVariantWebhookTemplateFields:
+ am.Spec.Webhook.TemplateFields = []string{
+ "project_name",
+ "service_name",
+ "organization",
+ "alert_policy_name",
+ "alert_policy_description",
+ "alert_policy_conditions[]",
+ "alert_policy_conditions_text",
+ "severity",
+ "slo_name",
+ "objective_name",
+ "timestamp",
+ }
+ }
+ default:
+ panic(fmt.Sprintf("unexpected v1alpha.AlertMethodType: %#v", a.Variant))
+ }
+ return am
+}
diff --git a/internal/manifest/v1alpha/examples/alert_method_test.go b/internal/manifest/v1alpha/examples/alert_method_test.go
new file mode 100644
index 00000000..f823b354
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/alert_method_test.go
@@ -0,0 +1,19 @@
+package v1alphaExamples
+
+import (
+ "slices"
+ "testing"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+)
+
+func TestAlertMethod_SupportsAllAlertMethodTypes(t *testing.T) {
+ variants := AlertMethod()
+ for _, methodType := range v1alpha.AlertMethodTypeValues() {
+ if !slices.ContainsFunc(variants, func(e Example) bool {
+ return e.(alertMethodExample).methodType == methodType
+ }) {
+ t.Errorf("%T '%s' is not listed in the examples", methodType, methodType)
+ }
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/alert_policy.go b/internal/manifest/v1alpha/examples/alert_policy.go
new file mode 100644
index 00000000..ee361e39
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/alert_policy.go
@@ -0,0 +1,312 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAlertPolicy "github.com/nobl9/nobl9-go/manifest/v1alpha/alertpolicy"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func AlertPolicy() []Example {
+ examples := []standardExample{
+ {
+ Variant: "fast burn",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "fast-burn",
+ DisplayName: "Fast burn (20x5min)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "There’s been a significant spike in burn rate over a brief period",
+ Severity: v1alphaAlertPolicy.SeverityHigh.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementAverageBurnRate.String(),
+ Value: 20.0,
+ AlertingWindow: "5m",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "slow burn",
+ SubVariant: "long windows",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "slow-burn",
+ DisplayName: "Slow burn (1x2d and 2x15min)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The budget is slowly being exhausted and not recovering",
+ Severity: v1alphaAlertPolicy.SeverityMedium.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementAverageBurnRate.String(),
+ Value: 1.0,
+ AlertingWindow: "48h",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementAverageBurnRate.String(),
+ Value: 2.0,
+ AlertingWindow: "15m",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "slow burn",
+ SubVariant: "short windows",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "slow-burn",
+ DisplayName: "Slow burn (1x12h and 2x15min)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The budget is slowly being exhausted and not recovering",
+ Severity: v1alphaAlertPolicy.SeverityMedium.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementAverageBurnRate.String(),
+ Value: 1.0,
+ AlertingWindow: "12h",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementAverageBurnRate.String(),
+ Value: 2.0,
+ AlertingWindow: "15m",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "budget almost exhausted",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "budget-almost-exhausted",
+ DisplayName: "Budget almost exhausted (20%)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The error budget is nearly exhausted (20%)",
+ Severity: v1alphaAlertPolicy.SeverityMedium.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBurnedBudget.String(),
+ Value: 0.8,
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "fast exhaustion",
+ SubVariant: "above budget",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "fast-exhaustion-above-budget",
+ DisplayName: "Fast exhaustion above budget",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The error budget is exhausting significantly and there's still some budget remaining",
+ Severity: v1alphaAlertPolicy.SeverityMedium.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnBudget.String(),
+ Value: "72h",
+ Operator: v1alpha.LessThan.String(),
+ AlertingWindow: "10m",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBurnedBudget.String(),
+ Value: 1.0,
+ LastsForDuration: "0m",
+ Operator: v1alpha.LessThan.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "fast exhaustion",
+ SubVariant: "below budget",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "fast-exhaustion-below-budget",
+ DisplayName: "Fast exhaustion below budget",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The error budget is exhausting significantly and there's no remaining budget left",
+ Severity: v1alphaAlertPolicy.SeverityMedium.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnEntireBudget.String(),
+ Value: "72h",
+ Operator: v1alpha.LessThanEqual.String(),
+ AlertingWindow: "10m",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBurnedBudget.String(),
+ Value: 1.0,
+ LastsForDuration: "0m",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "slow exhaustion",
+ SubVariant: "long window",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "slow-exhaustion-long-window",
+ DisplayName: "Slow exhaustion for long window SLOs",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The error budget is exhausting slowly and not recovering",
+ Severity: v1alphaAlertPolicy.SeverityLow.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnBudget.String(),
+ Value: "480h",
+ Operator: v1alpha.LessThan.String(),
+ AlertingWindow: "48h",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnBudget.String(),
+ Value: "480h",
+ Operator: v1alpha.LessThan.String(),
+ AlertingWindow: "15m",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBurnedBudget.String(),
+ Value: 1.0,
+ LastsForDuration: "0m",
+ Operator: v1alpha.LessThan.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "slow exhaustion",
+ SubVariant: "short window",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "slow-exhaustion-short-window",
+ DisplayName: "Slow exhaustion for short window SLOs",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The error budget is exhausting slowly and not recovering",
+ Severity: v1alphaAlertPolicy.SeverityLow.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnBudget.String(),
+ Value: "120h",
+ Operator: v1alpha.LessThan.String(),
+ AlertingWindow: "12h",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementTimeToBurnBudget.String(),
+ Value: "120h",
+ Operator: v1alpha.LessThan.String(),
+ AlertingWindow: "15m",
+ },
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBurnedBudget.String(),
+ Value: 1.0,
+ LastsForDuration: "0m",
+ Operator: v1alpha.LessThan.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "budget drop",
+ SubVariant: "fast",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "fast-budget-drop",
+ DisplayName: "Fast budget drop (10% over 15 min)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The budget dropped by 10% over the last 15 minutes and is not recovering",
+ Severity: v1alphaAlertPolicy.SeverityHigh.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBudgetDrop.String(),
+ Value: 0.1,
+ AlertingWindow: "15m",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ {
+ Variant: "budget drop",
+ SubVariant: "slow",
+ Object: v1alphaAlertPolicy.New(
+ v1alphaAlertPolicy.Metadata{
+ Name: "slow-budget-drop",
+ DisplayName: "Slow budget drop (5% over 1h)",
+ },
+ v1alphaAlertPolicy.Spec{
+ Description: "The budget dropped by 5% over the last 1 hour and is not recovering",
+ Severity: v1alphaAlertPolicy.SeverityLow.String(),
+ CoolDownDuration: "5m",
+ Conditions: []v1alphaAlertPolicy.AlertCondition{
+ {
+ Measurement: v1alphaAlertPolicy.MeasurementBudgetDrop.String(),
+ Value: 0.05,
+ AlertingWindow: "1h",
+ Operator: v1alpha.GreaterThanEqual.String(),
+ },
+ },
+ },
+ ),
+ },
+ }
+ for i := range examples {
+ ap := examples[i].Object.(v1alphaAlertPolicy.AlertPolicy)
+ ap.Metadata.Project = sdk.DefaultProject
+ ap.Metadata.Labels = exampleLabels()
+ ap.Metadata.Annotations = exampleMetadataAnnotations()
+ var alertMethodName string
+ switch ap.Spec.Severity {
+ case v1alphaAlertPolicy.SeverityHigh.String():
+ alertMethodName = "pagerduty"
+ case v1alphaAlertPolicy.SeverityMedium.String():
+ alertMethodName = "slack"
+ case v1alphaAlertPolicy.SeverityLow.String():
+ alertMethodName = "email"
+ }
+ ap.Spec.AlertMethods = []v1alphaAlertPolicy.AlertMethodRef{
+ {
+ Metadata: v1alphaAlertPolicy.AlertMethodRefMetadata{
+ Name: alertMethodName,
+ Project: sdk.DefaultProject,
+ },
+ },
+ }
+ examples[i].Object = ap
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/alert_silence.go b/internal/manifest/v1alpha/examples/alert_silence.go
new file mode 100644
index 00000000..c9e1f3da
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/alert_silence.go
@@ -0,0 +1,94 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/alertsilence"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func AlertSilence() []Example {
+ examples := []standardExample{
+ {
+ SubVariant: "start and end time",
+ Object: alertsilence.New(
+ alertsilence.Metadata{
+ Name: "scheduled-maintenance-2024-05-01",
+ Project: sdk.DefaultProject,
+ },
+ alertsilence.Spec{
+ Description: "Scheduled maintenance alerts silence",
+ SLO: "api-server-latency",
+ AlertPolicy: alertsilence.AlertPolicySource{
+ Name: "fast-burn",
+ Project: sdk.DefaultProject,
+ },
+ Period: alertsilence.Period{
+ StartTime: ptr(mustParseTime("2024-05-01T12:00:00Z")),
+ EndTime: ptr(mustParseTime("2024-05-01T14:00:00Z")),
+ },
+ },
+ ),
+ },
+ {
+ SubVariant: "start time and duration",
+ Object: alertsilence.New(
+ alertsilence.Metadata{
+ Name: "scheduled-maintenance-2024-05-02",
+ Project: sdk.DefaultProject,
+ },
+ alertsilence.Spec{
+ Description: "Scheduled maintenance alerts silence",
+ SLO: "api-server-latency",
+ AlertPolicy: alertsilence.AlertPolicySource{
+ Name: "fast-burn",
+ Project: sdk.DefaultProject,
+ },
+ Period: alertsilence.Period{
+ StartTime: ptr(mustParseTime("2024-05-02T12:00:00Z")),
+ Duration: "2h",
+ },
+ },
+ ),
+ },
+ {
+ SubVariant: "duration",
+ Object: alertsilence.New(
+ alertsilence.Metadata{
+ Name: "incident-70",
+ Project: sdk.DefaultProject,
+ },
+ alertsilence.Spec{
+ Description: "Alerts silenced for the duration of the active incident 70",
+ SLO: "api-server-latency",
+ AlertPolicy: alertsilence.AlertPolicySource{
+ Name: "fast-burn",
+ Project: sdk.DefaultProject,
+ },
+ Period: alertsilence.Period{
+ Duration: "4h",
+ },
+ },
+ ),
+ },
+ {
+ SubVariant: "end time",
+ Object: alertsilence.New(
+ alertsilence.Metadata{
+ Name: "incident-71",
+ Project: sdk.DefaultProject,
+ },
+ alertsilence.Spec{
+ Description: "Alerts silenced until incident 71 is resolved",
+ SLO: "api-server-latency",
+ AlertPolicy: alertsilence.AlertPolicySource{
+ Name: "fast-burn",
+ Project: sdk.DefaultProject,
+ },
+ Period: alertsilence.Period{
+ EndTime: ptr(mustParseTime("2024-05-01T20:00:00Z")),
+ },
+ },
+ ),
+ },
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/annotation.go b/internal/manifest/v1alpha/examples/annotation.go
new file mode 100644
index 00000000..8f366707
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/annotation.go
@@ -0,0 +1,41 @@
+package v1alphaExamples
+
+import (
+ v1alphaAnnotation "github.com/nobl9/nobl9-go/manifest/v1alpha/annotation"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func Annotation() []Example {
+ examples := []standardExample{
+ {
+ Object: v1alphaAnnotation.New(
+ v1alphaAnnotation.Metadata{
+ Name: "good-objective-data-gap",
+ Project: sdk.DefaultProject,
+ },
+ v1alphaAnnotation.Spec{
+ Slo: "api-server-latency",
+ ObjectiveName: "good",
+ Description: "Data gap occurred",
+ StartTime: mustParseTime("2024-05-01T12:00:00Z"),
+ EndTime: mustParseTime("2024-05-04T10:00:00Z"),
+ },
+ ),
+ },
+ {
+ Object: v1alphaAnnotation.New(
+ v1alphaAnnotation.Metadata{
+ Name: "deployment-2021-01-01",
+ Project: sdk.DefaultProject,
+ },
+ v1alphaAnnotation.Spec{
+ Slo: "api-server-latency",
+ Description: "Deployment was performed here",
+ StartTime: mustParseTime("2024-05-16T14:00:00+01:00"),
+ EndTime: mustParseTime("2024-05-16T15:00:00+01:00"),
+ },
+ ),
+ },
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/budget_adjustment.go b/internal/manifest/v1alpha/examples/budget_adjustment.go
new file mode 100644
index 00000000..ae687310
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/budget_adjustment.go
@@ -0,0 +1,42 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/budgetadjustment"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func BudgetAdjustment() []Example {
+ examples := []standardExample{
+ {
+ Object: budgetadjustment.New(
+ budgetadjustment.Metadata{
+ Name: "monthly-deployment-adjustment",
+ DisplayName: "Monthly deployment adjustment",
+ },
+ budgetadjustment.Spec{
+ Description: "Adjustment for deployment happening monthly on the first Tuesday of each month for 1 hour",
+ FirstEventStart: mustParseTime("2024-01-01T12:00:00Z"),
+ Duration: "1h",
+ Rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1TU",
+ Filters: budgetadjustment.Filters{
+ SLOs: []budgetadjustment.SLORef{
+ {
+ Name: "api-server-latency",
+ Project: sdk.DefaultProject,
+ },
+ {
+ Name: "api-server-uptime",
+ Project: sdk.DefaultProject,
+ },
+ {
+ Name: "proxy-throughput",
+ Project: "proxy",
+ },
+ },
+ },
+ },
+ ),
+ },
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/data_export.go b/internal/manifest/v1alpha/examples/data_export.go
new file mode 100644
index 00000000..3d89b889
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/data_export.go
@@ -0,0 +1,45 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/dataexport"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func DataExport() []Example {
+ examples := []standardExample{
+ {
+ SubVariant: "gcs",
+ Object: dataexport.New(
+ dataexport.Metadata{
+ Name: "gcs-export",
+ DisplayName: "Data export to Google Cloud Storage bucket",
+ Project: sdk.DefaultProject,
+ },
+ dataexport.Spec{
+ ExportType: dataexport.DataExportTypeGCS,
+ Spec: dataexport.GCSDataExportSpec{
+ BucketName: "prod-data-export-bucket",
+ },
+ },
+ ),
+ },
+ {
+ SubVariant: "s3",
+ Object: dataexport.New(
+ dataexport.Metadata{
+ Name: "s3-export",
+ DisplayName: "Data export to AWS S3 bucket",
+ Project: sdk.DefaultProject,
+ },
+ dataexport.Spec{
+ ExportType: dataexport.DataExportTypeS3,
+ Spec: dataexport.S3DataExportSpec{
+ BucketName: "data-export-bucket",
+ RoleARN: "arn:aws:iam::123456578901:role/nobl9-access",
+ },
+ },
+ ),
+ },
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/direct.go b/internal/manifest/v1alpha/examples/direct.go
new file mode 100644
index 00000000..e20e7b5f
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/direct.go
@@ -0,0 +1,190 @@
+package v1alphaExamples
+
+import (
+ "fmt"
+
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaDirect "github.com/nobl9/nobl9-go/manifest/v1alpha/direct"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+type directExample struct {
+ standardExample
+ typ v1alpha.DataSourceType
+}
+
+func Direct() []Example {
+ types := v1alpha.DataSourceTypeValues()
+ examples := make([]Example, 0, len(types))
+ for _, typ := range types {
+ if !v1alphaDirect.IsValidDirectType(typ) {
+ continue
+ }
+ example := directExample{
+ standardExample: standardExample{
+ Variant: toKebabCase(typ.String()),
+ },
+ typ: typ,
+ }
+ example.Object = example.Generate()
+ examples = append(examples, example)
+ }
+ return examples
+}
+
+func (d directExample) Generate() v1alphaDirect.Direct {
+ titleName := dataSourceTypePrettyName(d.typ)
+ direct := v1alphaDirect.New(
+ v1alphaDirect.Metadata{
+ Name: d.Variant,
+ DisplayName: titleName + " Direct",
+ Project: sdk.DefaultProject,
+ },
+ v1alphaDirect.Spec{
+ Description: fmt.Sprintf("Example %s Direct", titleName),
+ ReleaseChannel: v1alpha.ReleaseChannelStable,
+ },
+ )
+ direct = d.generateVariant(direct)
+ typ, _ := direct.Spec.GetType()
+ if maxDuration, err := v1alpha.GetDataRetrievalMaxDuration(manifest.KindDirect, typ); err == nil {
+ direct.Spec.HistoricalDataRetrieval = &v1alpha.HistoricalDataRetrieval{
+ MaxDuration: maxDuration,
+ DefaultDuration: v1alpha.HistoricalRetrievalDuration{
+ Value: ptr(*maxDuration.Value / 2),
+ Unit: maxDuration.Unit,
+ },
+ }
+ }
+ defaultQueryDelay := v1alpha.GetQueryDelayDefaults()[typ]
+ direct.Spec.QueryDelay = &v1alpha.QueryDelay{
+ Duration: v1alpha.Duration{
+ Value: ptr(*defaultQueryDelay.Value + 1),
+ Unit: defaultQueryDelay.Unit,
+ },
+ }
+ return direct
+}
+
+func (d directExample) generateVariant(direct v1alphaDirect.Direct) v1alphaDirect.Direct {
+ switch d.typ {
+ case v1alpha.AppDynamics:
+ direct.Spec.AppDynamics = &v1alphaDirect.AppDynamicsConfig{
+ URL: "https://my-org.saas.appdynamics.com",
+ ClientName: "prod-direct",
+ AccountName: "my-account",
+ ClientSecret: "[secret]",
+ }
+ case v1alpha.AzureMonitor:
+ direct.Spec.AzureMonitor = &v1alphaDirect.AzureMonitorConfig{
+ TenantID: "5cdecca3-c2c5-4072-89dd-5555faf05202",
+ ClientID: "70747025-9367-41a5-98f1-59b18b5793c3",
+ ClientSecret: "[secret]",
+ }
+ case v1alpha.BigQuery:
+ direct.Spec.BigQuery = &v1alphaDirect.BigQueryConfig{
+ ServiceAccountKey: gcloudServiceAccountKey,
+ }
+ case v1alpha.CloudWatch:
+ direct.Spec.CloudWatch = &v1alphaDirect.CloudWatchConfig{
+ RoleARN: "arn:aws:iam::123456578901:role/awsCrossAccountProdCloudwatch-prod-app",
+ }
+ case v1alpha.Datadog:
+ direct.Spec.Datadog = &v1alphaDirect.DatadogConfig{
+ Site: "com",
+ APIKey: "[secret]",
+ ApplicationKey: "[secret]",
+ }
+ case v1alpha.Dynatrace:
+ direct.Spec.Dynatrace = &v1alphaDirect.DynatraceConfig{
+ URL: "https://zvf10945.live.dynatrace.com/",
+ DynatraceToken: "[secret]",
+ }
+ case v1alpha.GCM:
+ direct.Spec.GCM = &v1alphaDirect.GCMConfig{
+ ServiceAccountKey: gcloudServiceAccountKey,
+ }
+ case v1alpha.Honeycomb:
+ direct.Spec.Honeycomb = &v1alphaDirect.HoneycombConfig{
+ APIKey: "[secret]",
+ }
+ case v1alpha.InfluxDB:
+ direct.Spec.InfluxDB = &v1alphaDirect.InfluxDBConfig{
+ URL: "https://us-west-2-2.aws.cloud2.influxdata.com",
+ APIToken: "[secret]",
+ OrganizationID: "my-org",
+ }
+ case v1alpha.Instana:
+ direct.Spec.Instana = &v1alphaDirect.InstanaConfig{
+ APIToken: "[secret]",
+ URL: "https://orange-my-org12.instana.io",
+ }
+ case v1alpha.Lightstep:
+ direct.Spec.Lightstep = &v1alphaDirect.LightstepConfig{
+ Organization: "MyOrg",
+ Project: "prod-app",
+ AppToken: "[secret]",
+ URL: "https://api.lightstep.com",
+ }
+ case v1alpha.LogicMonitor:
+ direct.Spec.LogicMonitor = &v1alphaDirect.LogicMonitorConfig{
+ Account: "my-account-name",
+ AccessID: "9xA2BssShK21ld9LoOYu",
+ AccessKey: "[secret]",
+ }
+ case v1alpha.NewRelic:
+ direct.Spec.NewRelic = &v1alphaDirect.NewRelicConfig{
+ AccountID: 1234567,
+ InsightsQueryKey: "NRIQ-2f66237213814496669180ba",
+ }
+ case v1alpha.Pingdom:
+ direct.Spec.Pingdom = &v1alphaDirect.PingdomConfig{
+ APIToken: "[secret]",
+ }
+ case v1alpha.Redshift:
+ direct.Spec.Redshift = &v1alphaDirect.RedshiftConfig{
+ AccessKeyID: "AKIA4NPYKXO34R341XUX",
+ SecretAccessKey: "[secret]",
+ SecretARN: "arn:aws:secretsmanager:eu-central-1:123456578901:secret:prod-redshift-db-user",
+ RoleARN: "arn:aws:iam::123456578901:role/awsCrossAccountProdRedshift-prod-app",
+ }
+ case v1alpha.Splunk:
+ direct.Spec.Splunk = &v1alphaDirect.SplunkConfig{
+ URL: "https://splunk.my-org.com/services",
+ AccessToken: "[secret]",
+ }
+ case v1alpha.SplunkObservability:
+ direct.Spec.SplunkObservability = &v1alphaDirect.SplunkObservabilityConfig{
+ Realm: "us1",
+ AccessToken: "[secret]",
+ }
+ case v1alpha.SumoLogic:
+ direct.Spec.SumoLogic = &v1alphaDirect.SumoLogicConfig{
+ AccessID: "wzeulXAULylic8",
+ AccessKey: "[secret]",
+ URL: "https://service.sumologic.com",
+ }
+ case v1alpha.ThousandEyes:
+ direct.Spec.ThousandEyes = &v1alphaDirect.ThousandEyesConfig{
+ OauthBearerToken: "[secret]",
+ }
+ default:
+ panic(fmt.Sprintf("unexpected v1alpha.DataSourceType: %#v", d.typ))
+ }
+ return direct
+}
+
+// #nosec G101
+const gcloudServiceAccountKey = `{
+ "type": "service_account",
+ "project_id": "prod-app",
+ "private_key_id": "669180ba44964eddba9e2f6623721381",
+ "private_key": "-----BEGIN PRIVATE KEY-----\nSECRET_KEY_GOES_HERE\n-----END PRIVATE KEY-----\n",
+ "client_email": "nobl9@nobl9.iam.gserviceaccount.com",
+ "client_id": "eddba9e2f66237213812",
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://oauth2.googleapis.com/token",
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/nobl9%40nobl9.iam.gserviceaccount.com"
+}`
diff --git a/internal/manifest/v1alpha/examples/direct_test.go b/internal/manifest/v1alpha/examples/direct_test.go
new file mode 100644
index 00000000..7521c599
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/direct_test.go
@@ -0,0 +1,23 @@
+package v1alphaExamples
+
+import (
+ "slices"
+ "testing"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaDirect "github.com/nobl9/nobl9-go/manifest/v1alpha/direct"
+)
+
+func TestDirect_SupportsAllDirectTypes(t *testing.T) {
+ variants := Direct()
+ for _, typ := range v1alpha.DataSourceTypeValues() {
+ if !v1alphaDirect.IsValidDirectType(typ) {
+ continue
+ }
+ if !slices.ContainsFunc(variants, func(e Example) bool {
+ return e.(directExample).typ == typ
+ }) {
+ t.Errorf("%T '%s' is not listed in the examples", typ, typ)
+ }
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/example.go b/internal/manifest/v1alpha/examples/example.go
new file mode 100644
index 00000000..84407825
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/example.go
@@ -0,0 +1,41 @@
+package v1alphaExamples
+
+type Example interface {
+ GetObject() any
+ GetVariant() string
+ GetSubVariant() string
+ GetYAMLComments() []string
+}
+
+func newExampleSlice[T Example](tv ...T) []Example {
+ examples := make([]Example, 0, len(tv))
+ for _, v := range tv {
+ examples = append(examples, v)
+ }
+ return examples
+}
+
+type standardExample struct {
+ Variant string
+ SubVariant string
+ Object any
+}
+
+func (s standardExample) GetObject() any {
+ return s.Object
+}
+
+func (s standardExample) GetVariant() string {
+ return s.Variant
+}
+
+func (s standardExample) GetSubVariant() string {
+ return s.SubVariant
+}
+
+func (s standardExample) GetYAMLComments() []string {
+ if s.SubVariant == "" {
+ return nil
+ }
+ return []string{s.SubVariant}
+}
diff --git a/internal/manifest/v1alpha/examples/labels.go b/internal/manifest/v1alpha/examples/labels.go
new file mode 100644
index 00000000..d8646c47
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/labels.go
@@ -0,0 +1,18 @@
+package v1alphaExamples
+
+import "github.com/nobl9/nobl9-go/manifest/v1alpha"
+
+func Labels() []Example {
+ return newExampleSlice(standardExample{
+ Object: exampleLabels(),
+ })
+}
+
+func exampleLabels() v1alpha.Labels {
+ return v1alpha.Labels{
+ "team": {"green", "sales"},
+ "env": {"prod", "dev"},
+ "region": {"us", "eu"},
+ "area": {"latency", "slow-check"},
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/metadata_annotations.go b/internal/manifest/v1alpha/examples/metadata_annotations.go
new file mode 100644
index 00000000..ef51e4a7
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/metadata_annotations.go
@@ -0,0 +1,18 @@
+package v1alphaExamples
+
+import "github.com/nobl9/nobl9-go/manifest/v1alpha"
+
+func MetadataAnnotations() []Example {
+ return newExampleSlice(standardExample{
+ Object: exampleMetadataAnnotations(),
+ })
+}
+
+func exampleMetadataAnnotations() v1alpha.MetadataAnnotations {
+ return v1alpha.MetadataAnnotations{
+ "team": "sales",
+ "env": "prod",
+ "region": "us",
+ "area": "latency",
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/project.go b/internal/manifest/v1alpha/examples/project.go
new file mode 100644
index 00000000..53394abf
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/project.go
@@ -0,0 +1,20 @@
+package v1alphaExamples
+
+import (
+ v1alphaProject "github.com/nobl9/nobl9-go/manifest/v1alpha/project"
+)
+
+func Project() []Example {
+ return newExampleSlice(standardExample{
+ Object: v1alphaProject.New(
+ v1alphaProject.Metadata{
+ Name: "default",
+ Labels: exampleLabels(),
+ Annotations: exampleMetadataAnnotations(),
+ },
+ v1alphaProject.Spec{
+ Description: "Example Project",
+ },
+ )},
+ )
+}
diff --git a/internal/manifest/v1alpha/examples/queries/cloudwatch_count_bad.json b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_bad.json
new file mode 100644
index 00000000..c28db98b
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_bad.json
@@ -0,0 +1,7 @@
+[
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+]
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/cloudwatch_count_good.json b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_good.json
new file mode 100644
index 00000000..c28db98b
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_good.json
@@ -0,0 +1,7 @@
+[
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+]
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/cloudwatch_count_total.json b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_total.json
new file mode 100644
index 00000000..015c22fa
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/cloudwatch_count_total.json
@@ -0,0 +1,7 @@
+[
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+]
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/cloudwatch_threshold.json b/internal/manifest/v1alpha/examples/queries/cloudwatch_threshold.json
new file mode 100644
index 00000000..8d29c522
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/cloudwatch_threshold.json
@@ -0,0 +1,43 @@
+[
+ {
+ "Id": "e1",
+ "Expression": "m1 / m2",
+ "Period": 60
+ },
+ {
+ "Id": "m1",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionEstablishedCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ },
+ {
+ "Id": "m2",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionAttemptCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ }
+]
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/elasticsearch_count_good.json b/internal/manifest/v1alpha/examples/queries/elasticsearch_count_good.json
new file mode 100644
index 00000000..675f04a5
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/elasticsearch_count_good.json
@@ -0,0 +1,50 @@
+{
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ "
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/elasticsearch_count_total.json b/internal/manifest/v1alpha/examples/queries/elasticsearch_count_total.json
new file mode 100644
index 00000000..06eec029
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/elasticsearch_count_total.json
@@ -0,0 +1,44 @@
+{
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}"
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/elasticsearch_threshold.json b/internal/manifest/v1alpha/examples/queries/elasticsearch_threshold.json
new file mode 100644
index 00000000..755620df
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/elasticsearch_threshold.json
@@ -0,0 +1,49 @@
+{
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "avg": {
+ "field": "transaction.duration.us"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/internal/manifest/v1alpha/examples/queries/instana_application_query.json b/internal/manifest/v1alpha/examples/queries/instana_application_query.json
new file mode 100644
index 00000000..6c502785
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/queries/instana_application_query.json
@@ -0,0 +1,34 @@
+{
+ "type": "EXPRESSION",
+ "logicalOperator": "AND",
+ "elements": [
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.cluster.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "n9-dev-tooling-cluster"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.container.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "data-node"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "call.type",
+ "operator": "EQUALS",
+ "entity": "NOT_APPLICABLE",
+ "value": "HTTP"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "endpoint.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "GET /"
+ }
+ ]
+}
diff --git a/internal/manifest/v1alpha/examples/role_binding.go b/internal/manifest/v1alpha/examples/role_binding.go
new file mode 100644
index 00000000..7e400765
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/role_binding.go
@@ -0,0 +1,62 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/rolebinding"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+func RoleBinding() []Example {
+ examples := []standardExample{
+ {
+ SubVariant: "project binding",
+ Object: rolebinding.New(
+ rolebinding.Metadata{
+ Name: "default-project-binding",
+ },
+ rolebinding.Spec{
+ User: ptr("00u2y4e4atkzaYkXP4x8"),
+ RoleRef: "project-viewer",
+ ProjectRef: sdk.DefaultProject,
+ },
+ ),
+ },
+ {
+ SubVariant: "organization binding",
+ Object: rolebinding.New(
+ rolebinding.Metadata{
+ Name: "organization-binding-john-admin",
+ },
+ rolebinding.Spec{
+ User: ptr("00u2y4e4atkzaYkXP4x8"),
+ RoleRef: "organization-admin",
+ },
+ ),
+ },
+ {
+ SubVariant: "organization group binding",
+ Object: rolebinding.New(
+ rolebinding.Metadata{
+ Name: "group-binding-admin",
+ },
+ rolebinding.Spec{
+ GroupRef: ptr("group-Q72HorLyjjCc"),
+ RoleRef: "organization-admin",
+ },
+ ),
+ },
+ {
+ SubVariant: "project group binding",
+ Object: rolebinding.New(
+ rolebinding.Metadata{
+ Name: "default-group-project-binding",
+ },
+ rolebinding.Spec{
+ GroupRef: ptr("group-Q72HorLyjjCc"),
+ RoleRef: "project-viewer",
+ ProjectRef: sdk.DefaultProject,
+ },
+ ),
+ },
+ }
+ return newExampleSlice(examples...)
+}
diff --git a/internal/manifest/v1alpha/examples/service.go b/internal/manifest/v1alpha/examples/service.go
new file mode 100644
index 00000000..a344adda
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/service.go
@@ -0,0 +1,21 @@
+package v1alphaExamples
+
+import (
+ v1alphaService "github.com/nobl9/nobl9-go/manifest/v1alpha/service"
+)
+
+func Service() []Example {
+ return newExampleSlice(standardExample{
+ Object: v1alphaService.New(
+ v1alphaService.Metadata{
+ Name: "prometheus",
+ Project: "default",
+ Labels: exampleLabels(),
+ Annotations: exampleMetadataAnnotations(),
+ },
+ v1alphaService.Spec{
+ Description: "Example Service",
+ },
+ )},
+ )
+}
diff --git a/internal/manifest/v1alpha/examples/slo.go b/internal/manifest/v1alpha/examples/slo.go
new file mode 100644
index 00000000..79b9cee3
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/slo.go
@@ -0,0 +1,197 @@
+package v1alphaExamples
+
+import (
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaSLO "github.com/nobl9/nobl9-go/manifest/v1alpha/slo"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/twindow"
+)
+
+var standardGoodOverTotalMetrics = []v1alpha.DataSourceType{
+ v1alpha.Prometheus,
+ v1alpha.Datadog,
+ v1alpha.NewRelic,
+ v1alpha.Splunk,
+ v1alpha.SplunkObservability,
+ v1alpha.Dynatrace,
+ v1alpha.Elasticsearch,
+ v1alpha.Graphite,
+ v1alpha.BigQuery,
+ v1alpha.OpenTSDB,
+ v1alpha.GrafanaLoki,
+ v1alpha.AmazonPrometheus,
+ v1alpha.Redshift,
+ v1alpha.InfluxDB,
+ v1alpha.GCM,
+ v1alpha.Generic,
+}
+
+var standardBadOverTotalMetrics = []v1alpha.DataSourceType{
+ v1alpha.AppDynamics,
+ v1alpha.LogicMonitor,
+ v1alpha.Honeycomb,
+ v1alpha.AzurePrometheus,
+}
+
+var customMetricExamples = map[v1alpha.DataSourceType]map[metricVariant][]metricSubVariant{
+ v1alpha.Lightstep: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantLightstepMetrics,
+ metricSubVariantLightstepLatency,
+ metricSubVariantLightstepError,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantLightstepMetrics,
+ metricSubVariantLightstepError,
+ },
+ },
+ v1alpha.ThousandEyes: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantThousandEyesWebPageLoad,
+ metricSubVariantThousandEyesResponseTime,
+ metricSubVariantThousandEyesNetLatency,
+ metricSubVariantThousandEyesNetLoss,
+ metricSubVariantThousandEyesDOMLoad,
+ metricSubVariantThousandEyesServerAvailability,
+ metricSubVariantThousandEyesServerThroughput,
+ },
+ },
+ v1alpha.CloudWatch: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantCloudWatchStandard,
+ metricSubVariantCloudWatchJSON,
+ metricSubVariantCloudWatchSQLQuery,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantCloudWatchStandard,
+ metricSubVariantCloudWatchJSON,
+ metricSubVariantCloudWatchSQLQuery,
+ },
+ metricVariantBadRatio: []metricSubVariant{
+ metricSubVariantCloudWatchStandard,
+ metricSubVariantCloudWatchJSON,
+ metricSubVariantCloudWatchSQLQuery,
+ },
+ },
+ v1alpha.Pingdom: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantPingdomUptime,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantPingdomUptime,
+ metricSubVariantPingdomTransaction,
+ },
+ },
+ v1alpha.SumoLogic: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantSumoLogicMetrics,
+ metricSubVariantSumoLogicLogs,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantSumoLogicMetrics,
+ metricSubVariantSumoLogicLogs,
+ },
+ },
+ v1alpha.Instana: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantInstanaInfrastructureQuery,
+ metricSubVariantInstanaInfrastructureSnapshotID,
+ metricSubVariantInstanaApplication,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantInstanaInfrastructureQuery,
+ metricSubVariantInstanaInfrastructureSnapshotID,
+ },
+ },
+ v1alpha.AzureMonitor: {
+ metricVariantThreshold: []metricSubVariant{
+ metricSubVariantAzureMonitorMetrics,
+ metricSubVariantAzureMonitorLogs,
+ },
+ metricVariantGoodRatio: []metricSubVariant{
+ metricSubVariantAzureMonitorMetrics,
+ metricSubVariantAzureMonitorLogs,
+ },
+ metricVariantBadRatio: []metricSubVariant{
+ metricSubVariantAzureMonitorMetrics,
+ metricSubVariantAzureMonitorLogs,
+ },
+ },
+}
+
+var goodOverTotalVariants = []string{
+ metricVariantThreshold,
+ metricVariantGoodRatio,
+}
+
+var badOverTotalVariants = []string{
+ metricVariantThreshold,
+ metricVariantGoodRatio,
+ metricVariantBadRatio,
+}
+
+func SLO() []Example {
+ baseExamples := make([]sloExample, 0)
+ for _, dataSourceType := range standardGoodOverTotalMetrics {
+ baseExamples = append(baseExamples, createVariants(dataSourceType, goodOverTotalVariants, nil)...)
+ }
+ for _, dataSourceType := range standardBadOverTotalMetrics {
+ baseExamples = append(baseExamples, createVariants(dataSourceType, badOverTotalVariants, nil)...)
+ }
+ for dataSourceType, customExamples := range customMetricExamples {
+ for variant, subVariants := range customExamples {
+ baseExamples = append(baseExamples, createVariants(
+ dataSourceType,
+ []metricVariant{variant},
+ subVariants,
+ )...)
+ }
+ }
+ variants := make([]sloExample, 0, len(baseExamples)*4)
+ for _, example := range baseExamples {
+ for _, timeWindow := range []twindow.TimeWindowTypeEnum{
+ twindow.Rolling,
+ twindow.Calendar,
+ } {
+ for _, method := range []v1alphaSLO.BudgetingMethod{
+ v1alphaSLO.BudgetingMethodTimeslices,
+ v1alphaSLO.BudgetingMethodOccurrences,
+ } {
+ example = sloExample{
+ DataSourceType: example.DataSourceType,
+ BudgetingMethod: method,
+ TimeWindowType: timeWindow,
+ MetricVariant: example.MetricVariant,
+ MetricSubVariant: example.MetricSubVariant,
+ }
+ example.SLO = example.Generate()
+ variants = append(variants, example)
+ }
+ }
+ }
+ return newExampleSlice(variants...)
+}
+
+func createVariants(
+ dataSourceType v1alpha.DataSourceType,
+ metricVariants []metricVariant,
+ metricSubVariants []metricSubVariant,
+) []sloExample {
+ examples := make([]sloExample, 0, len(metricVariants)*(1+len(metricSubVariants)))
+ for _, example := range metricVariants {
+ if len(metricSubVariants) == 0 {
+ examples = append(examples, sloExample{
+ DataSourceType: dataSourceType,
+ MetricVariant: example,
+ })
+ continue
+ }
+ for _, subVariant := range metricSubVariants {
+ examples = append(examples, sloExample{
+ DataSourceType: dataSourceType,
+ MetricVariant: example,
+ MetricSubVariant: subVariant,
+ })
+ }
+ }
+ return examples
+}
diff --git a/internal/manifest/v1alpha/examples/slo_test.go b/internal/manifest/v1alpha/examples/slo_test.go
new file mode 100644
index 00000000..1bbd9174
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/slo_test.go
@@ -0,0 +1,19 @@
+package v1alphaExamples
+
+import (
+ "slices"
+ "testing"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+)
+
+func TestSLO_SupportsAllDataSourceTypes(t *testing.T) {
+ variants := SLO()
+ for _, dataSourceType := range v1alpha.DataSourceTypeValues() {
+ if !slices.ContainsFunc(variants, func(e Example) bool {
+ return e.(sloExample).DataSourceType == dataSourceType
+ }) {
+ t.Errorf("%T '%s' is not listed in the examples", dataSourceType, dataSourceType)
+ }
+ }
+}
diff --git a/internal/manifest/v1alpha/examples/slo_variants.go b/internal/manifest/v1alpha/examples/slo_variants.go
new file mode 100644
index 00000000..20444184
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/slo_variants.go
@@ -0,0 +1,1112 @@
+package v1alphaExamples
+
+import (
+ "embed"
+ "fmt"
+ "path/filepath"
+ "reflect"
+ "slices"
+
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaSLO "github.com/nobl9/nobl9-go/manifest/v1alpha/slo"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha/twindow"
+ "github.com/nobl9/nobl9-go/sdk"
+)
+
+//go:embed queries
+var queriesFS embed.FS
+
+type sloExample struct {
+ DataSourceType v1alpha.DataSourceType
+ BudgetingMethod v1alphaSLO.BudgetingMethod
+ TimeWindowType twindow.TimeWindowTypeEnum
+ MetricVariant metricVariant
+ MetricSubVariant metricSubVariant
+
+ SLO v1alphaSLO.SLO
+}
+
+func (s sloExample) GetObject() any {
+ return s.SLO
+}
+
+func (s sloExample) GetVariant() string {
+ return toKebabCase(s.DataSourceType.String())
+}
+
+func (s sloExample) GetSubVariant() string {
+ return s.String()
+}
+
+func (s sloExample) GetYAMLComments() []string {
+ comments := []string{
+ fmt.Sprintf("Metric type: %s", s.MetricVariant),
+ fmt.Sprintf("Budgeting method: %s", s.BudgetingMethod),
+ fmt.Sprintf("Time window type: %s", s.TimeWindowType),
+ }
+ if s.MetricSubVariant != "" {
+ comments = slices.Insert(comments, 1, fmt.Sprintf("Metric variant: %s", s.MetricSubVariant))
+ }
+ return comments
+}
+
+func (s sloExample) String() string {
+ subVariantStr := s.MetricSubVariant
+ if subVariantStr != "" {
+ subVariantStr = subVariantStr + " "
+ }
+ return fmt.Sprintf(
+ "%s %s %sSLO using %s budgeting method and %s time window",
+ s.DataSourceType,
+ s.MetricVariant,
+ subVariantStr,
+ s.BudgetingMethod,
+ s.TimeWindowType,
+ )
+}
+
+func (s sloExample) Generate() v1alphaSLO.SLO {
+ slo := v1alphaSLO.New(
+ v1alphaSLO.Metadata{
+ Name: "api-server-slo",
+ DisplayName: "API Server SLO",
+ Project: sdk.DefaultProject,
+ Labels: exampleLabels(),
+ Annotations: exampleMetadataAnnotations(),
+ },
+ v1alphaSLO.Spec{
+ Description: fmt.Sprintf("Example %s SLO", dataSourceTypePrettyName(s.DataSourceType)),
+ Service: "api-server",
+ Indicator: &v1alphaSLO.Indicator{
+ MetricSource: v1alphaSLO.MetricSourceSpec{
+ Name: toKebabCase(s.DataSourceType.String()),
+ Project: sdk.DefaultProject,
+ Kind: manifest.KindDirect,
+ },
+ },
+ BudgetingMethod: s.BudgetingMethod.String(),
+ Attachments: []v1alphaSLO.Attachment{
+ {
+ URL: "https://docs.nobl9.com",
+ DisplayName: ptr("Nobl9 Documentation"),
+ },
+ },
+ AlertPolicies: []string{"fast-burn-5x-for-last-10m"},
+ AnomalyConfig: &v1alphaSLO.AnomalyConfig{
+ NoData: &v1alphaSLO.AnomalyConfigNoData{
+ AlertMethods: []v1alphaSLO.AnomalyConfigAlertMethod{
+ {
+ Name: "slack-notification",
+ Project: sdk.DefaultProject,
+ },
+ },
+ },
+ },
+ })
+ objective := v1alphaSLO.Objective{
+ ObjectiveBase: v1alphaSLO.ObjectiveBase{
+ DisplayName: "Good response (200)",
+ Name: "ok",
+ Value: nil,
+ },
+ BudgetTarget: ptr(0.95),
+ Primary: ptr(true),
+ RawMetric: &v1alphaSLO.RawMetricSpec{},
+ CountMetrics: &v1alphaSLO.CountMetricsSpec{
+ Incremental: ptr(true),
+ },
+ }
+ if s.BudgetingMethod == v1alphaSLO.BudgetingMethodTimeslices {
+ objective.TimeSliceTarget = ptr(0.90)
+ }
+ switch s.TimeWindowType {
+ case twindow.Calendar:
+ slo.Spec.TimeWindows = []v1alphaSLO.TimeWindow{
+ {
+ Unit: "Month",
+ Count: 1.0,
+ Calendar: &v1alphaSLO.Calendar{
+ StartTime: "2022-12-01 00:00:00",
+ TimeZone: "UTC",
+ },
+ },
+ }
+ case twindow.Rolling:
+ slo.Spec.TimeWindows = []v1alphaSLO.TimeWindow{
+ {
+ Unit: twindow.Hour.String(),
+ Count: 1.0,
+ IsRolling: true,
+ },
+ }
+ }
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ objective.Value = ptr(200.0)
+ objective.Operator = ptr(v1alpha.LessThanEqual.String())
+ case metricVariantGoodRatio:
+ objective.Value = ptr(1.0)
+ case metricVariantBadRatio:
+ objective.Value = ptr(1.0)
+ default:
+ panic(fmt.Sprintf("unsupported metric variant: %s", s.MetricVariant))
+ }
+ slo.Spec.Objectives = append(slo.Spec.Objectives, objective)
+ // Set the metric spec variant as the last step.
+ // This way the getVariant function can modify the SLO object as needed
+ // without any chance that these changes would be overwritten.
+ return s.generateMetricVariant(slo)
+}
+
+// metricVariant lists the standard metric variants.
+// If a metric source has non-standard variants (e.g. Lightstep), it can extend with metricSubVariant.
+type metricVariant = string
+
+const (
+ metricVariantThreshold metricVariant = "threshold"
+ metricVariantGoodRatio metricVariant = "good over total"
+ metricVariantBadRatio metricVariant = "bad over total"
+)
+
+// metricSubVariant allows extending standard metric variants with metric source specific sub-variants.
+type metricSubVariant = string
+
+const (
+ // Lightstep.
+ metricSubVariantLightstepMetrics metricVariant = "metrics"
+ metricSubVariantLightstepLatency metricVariant = "latency"
+ metricSubVariantLightstepError metricVariant = "error"
+ // ThousandEyes.
+ metricSubVariantThousandEyesWebPageLoad metricVariant = "web page load"
+ metricSubVariantThousandEyesResponseTime metricVariant = "response time"
+ metricSubVariantThousandEyesNetLatency metricVariant = "net latency"
+ metricSubVariantThousandEyesNetLoss metricVariant = "net loss"
+ metricSubVariantThousandEyesDOMLoad metricVariant = "DOM load"
+ metricSubVariantThousandEyesServerAvailability metricVariant = "server availability"
+ metricSubVariantThousandEyesServerThroughput metricVariant = "server throughput"
+ // CloudWatch.
+ metricSubVariantCloudWatchStandard metricVariant = "standard configuration"
+ metricSubVariantCloudWatchSQLQuery metricVariant = "sql query"
+ metricSubVariantCloudWatchJSON metricVariant = "JSON"
+ // Pingdom.
+ metricSubVariantPingdomUptime metricVariant = "uptime"
+ metricSubVariantPingdomTransaction metricVariant = "transaction"
+ // SumoLogic.
+ metricSubVariantSumoLogicMetrics metricVariant = "metrics"
+ metricSubVariantSumoLogicLogs metricVariant = "logs"
+ // Instana.
+ metricSubVariantInstanaInfrastructureQuery metricVariant = "infrastructure query"
+ metricSubVariantInstanaInfrastructureSnapshotID metricVariant = "infrastructure snapshot id"
+ metricSubVariantInstanaApplication metricVariant = "application"
+ // AzureMonitor.
+ metricSubVariantAzureMonitorMetrics metricVariant = "metrics"
+ metricSubVariantAzureMonitorLogs metricVariant = "logs"
+)
+
+// generateMetricVariant returns a [v1alphaSLO.SLO] with all [v1alphaSLO.MetricSpec] variants filled out.
+// The standard variants are: raw, good/total, and bad/total (only supported sources).
+// If a metric source has non-standard variants (e.g. Lightstep), it can extend metricVariant with it's own types.
+// It is up to the caller to nil-out the unwanted fields.
+func (s sloExample) generateMetricVariant(slo v1alphaSLO.SLO) v1alphaSLO.SLO {
+ switch s.DataSourceType {
+ case v1alpha.Prometheus:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.PrometheusMetric{
+ PromQL: ptr(`api_server_requestMsec{host="*",job="nginx"}`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.PrometheusMetric{
+ PromQL: ptr(`sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})`),
+ }), newMetricSpec(v1alphaSLO.PrometheusMetric{
+ PromQL: ptr(`sum(http_request_duration_seconds_count{handler="/api/v1/slos"})`),
+ }))
+ }
+ case v1alpha.Datadog:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.DatadogMetric{
+ Query: ptr(`avg:trace.http.request.duration{*}`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.DatadogMetric{
+ Query: ptr(`sum:trace.http.request.hits.by_http_status{http.status_class:2xx}.as_count()`),
+ }), newMetricSpec(v1alphaSLO.DatadogMetric{
+ Query: ptr(`sum:trace.http.request.hits.by_http_status{*}.as_count()`),
+ }))
+ }
+ case v1alpha.NewRelic:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.NewRelicMetric{
+ NRQL: ptr(`select average(duration) from transaction timeseries`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.NewRelicMetric{
+ NRQL: ptr(`SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES`),
+ }), newMetricSpec(v1alphaSLO.NewRelicMetric{
+ NRQL: ptr(`SELECT count(*) FROM Transaction TIMESERIES`),
+ }))
+ }
+ case v1alpha.AppDynamics:
+ total := newMetricSpec(&v1alphaSLO.AppDynamicsMetric{
+ ApplicationName: ptr("api-server"),
+ MetricPath: ptr("End User Experience|App|Normal Requests"),
+ })
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.AppDynamicsMetric{
+ ApplicationName: ptr("api-server"),
+ MetricPath: ptr("Overall Application Performance|Average Response Time (ms)"),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AppDynamicsMetric{
+ ApplicationName: ptr("api-server"),
+ MetricPath: ptr("End User Experience|App|Slow Requests"),
+ }), total)
+ case metricVariantBadRatio:
+ return setBadOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AppDynamicsMetric{
+ ApplicationName: ptr("api-server"),
+ MetricPath: ptr("End User Experience|App|Slow Requests"),
+ }), total)
+ }
+ case v1alpha.Splunk:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.SplunkMetric{
+ Query: ptr(`index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats avg(response_time) as n9value by _time | rename _time as n9time | fields n9time n9value`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.SplunkMetric{
+ Query: ptr(`index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value`),
+ }), newMetricSpec(v1alphaSLO.SplunkMetric{
+ Query: ptr(`index=* source=udp:5072 sourcetype=syslog | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value`),
+ }))
+ }
+ case v1alpha.Lightstep:
+ slo.Spec.Objectives[0].CountMetrics.Incremental = ptr(false)
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantLightstepMetrics:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepMetricDataType),
+ UQL: ptr(`metric cpu.utilization | rate | group_by [], mean`),
+ }))
+ case metricVariantThreshold + metricSubVariantLightstepLatency:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepLatencyDataType),
+ StreamID: ptr("DzpxcSRh"),
+ Percentile: ptr(95.0),
+ }))
+ case metricVariantThreshold + metricSubVariantLightstepError:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepErrorRateDataType),
+ StreamID: ptr("DzpxcSRh"),
+ }))
+ case metricVariantGoodRatio + metricSubVariantLightstepMetrics:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepMetricDataType),
+ UQL: ptr(`metric cpu.utilization | rate | group_by [], mean`),
+ }), newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepMetricDataType),
+ UQL: ptr(`metric cpu.utilization | rate | group_by [], max`),
+ }))
+ case metricVariantGoodRatio + metricSubVariantLightstepError:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepGoodCountDataType),
+ StreamID: ptr("DzpxcSRh"),
+ }), newMetricSpec(v1alphaSLO.LightstepMetric{
+ TypeOfData: ptr(v1alphaSLO.LightstepTotalCountDataType),
+ StreamID: ptr("DzpxcSRh"),
+ }))
+ }
+ case v1alpha.SplunkObservability:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.SplunkObservabilityMetric{
+ Program: ptr(`data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.SplunkObservabilityMetric{
+ Program: ptr(`data('demo.trans.count', filter=filter('api_server'), rollup='rate').stddev().publish()`),
+ }), newMetricSpec(v1alphaSLO.SplunkObservabilityMetric{
+ Program: ptr(`data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()`),
+ }))
+ }
+ case v1alpha.Dynatrace:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.DynatraceMetric{
+ MetricSelector: ptr(`builtin:service.response.server:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.equals(~"APIServer~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending)):limit(100)`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.DynatraceMetric{
+ MetricSelector: ptr(`builtin:synthetic.http.request.statusCode:filter(and(or(eq("Status code",SC_2xx)))):splitBy():sort(value(auto,descending)):limit(20)`),
+ }), newMetricSpec(v1alphaSLO.DynatraceMetric{
+ MetricSelector: ptr(`builtin:synthetic.http.request.statusCode:splitBy():sort(value(auto,descending)):limit(20)`),
+ }))
+ }
+ case v1alpha.Elasticsearch:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ElasticsearchMetric{
+ Index: ptr("apm-7.13.3-transaction"),
+ Query: ptr(mustLoadQuery("elasticsearch_threshold.json")),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.ElasticsearchMetric{
+ Index: ptr("apm-7.13.3-transaction"),
+ Query: ptr(mustLoadQuery("elasticsearch_count_good.json")),
+ }), newMetricSpec(v1alphaSLO.ElasticsearchMetric{
+ Index: ptr("apm-7.13.3-transaction"),
+ Query: ptr(mustLoadQuery("elasticsearch_count_total.json")),
+ }))
+ }
+ case v1alpha.ThousandEyes:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantThousandEyesWebPageLoad:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesWebPageLoad),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesResponseTime:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesHTTPResponseTime),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesNetLatency:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesNetLatency),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesNetLoss:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesNetLoss),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesDOMLoad:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesWebDOMLoad),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesServerAvailability:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesServerAvailability),
+ }))
+ case metricVariantThreshold + metricSubVariantThousandEyesServerThroughput:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
+ TestID: ptr[int64](2280492),
+ TestType: ptr(v1alphaSLO.ThousandEyesServerThroughput),
+ }))
+ }
+ case v1alpha.Graphite:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.GraphiteMetric{
+ MetricPath: ptr(`carbon.agents.9b365cce.cpuUsage`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.GraphiteMetric{
+ MetricPath: ptr(`stats_counts.response.200`),
+ }), newMetricSpec(v1alphaSLO.GraphiteMetric{
+ MetricPath: ptr(`stats_counts.response.all`),
+ }))
+ }
+ case v1alpha.BigQuery:
+ projectID := "api-server-256112"
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.BigQueryMetric{
+ ProjectID: projectID,
+ Location: "US",
+ Query: fmt.Sprintf("SELECT response_time AS n9value, created AS n9date FROM `%s.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)`", projectID),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.BigQueryMetric{
+ ProjectID: projectID,
+ Location: "US",
+ Query: fmt.Sprintf("SELECT http_code AS n9value, created AS n9date FROM `%s.metrics.http_response` WHERE http_code = 200 AND created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)", projectID),
+ }), newMetricSpec(v1alphaSLO.BigQueryMetric{
+ ProjectID: projectID,
+ Location: "US",
+ Query: fmt.Sprintf("SELECT http_code AS n9value, created AS n9date FROM `%s.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)", projectID),
+ }))
+ }
+ case v1alpha.OpenTSDB:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.OpenTSDBMetric{
+ Query: ptr(`start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-avg-zero:transaction.duration{host=host.01}`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.OpenTSDBMetric{
+ Query: ptr(`start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{code=2xx}`),
+ }), newMetricSpec(v1alphaSLO.OpenTSDBMetric{
+ Query: ptr(`start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{type=http.status_code}`),
+ }))
+ }
+ case v1alpha.GrafanaLoki:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.GrafanaLokiMetric{
+ Logql: ptr(`sum(sum_over_time({topic="cdc"} |= "kafka_consumergroup_lag" | logfmt | line_format "{{.kafka_consumergroup_lag}}" | unwrap kafka_consumergroup_lag [1m]))`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.GrafanaLokiMetric{
+ Logql: ptr(`count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code >= 200 and http_status_code < 300)[1m]))`),
+ }), newMetricSpec(v1alphaSLO.GrafanaLokiMetric{
+ Logql: ptr(`count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code > 0)[1m]))`),
+ }))
+ }
+ case v1alpha.CloudWatch:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantCloudWatchStandard:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ AccountID: ptr("123456789012"),
+ Region: ptr("us-west-2"),
+ Namespace: ptr("AWS/RDS"),
+ MetricName: ptr("ReadLatency"),
+ Stat: ptr("Average"),
+ Dimensions: []v1alphaSLO.CloudWatchMetricDimension{
+ {
+ Name: ptr("LoadBalancer"),
+ Value: ptr("app/api-server"),
+ },
+ },
+ }))
+ case metricVariantGoodRatio + metricSubVariantCloudWatchStandard:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ AccountID: ptr("123456789012"),
+ Region: ptr("us-west-2"),
+ Namespace: ptr("AWS/ApplicationELB"),
+ MetricName: ptr("HTTPCode_Target_2XX_Count"),
+ Stat: ptr("SampleCount"),
+ Dimensions: []v1alphaSLO.CloudWatchMetricDimension{
+ {
+ Name: ptr("LoadBalancer"),
+ Value: ptr("app/api-server"),
+ },
+ },
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ AccountID: ptr("123456789012"),
+ Region: ptr("us-west-2"),
+ Namespace: ptr("AWS/ApplicationELB"),
+ MetricName: ptr("RequestCount"),
+ Stat: ptr("SampleCount"),
+ Dimensions: []v1alphaSLO.CloudWatchMetricDimension{
+ {
+ Name: ptr("LoadBalancer"),
+ Value: ptr("app/api-server"),
+ },
+ },
+ }))
+ case metricVariantBadRatio + metricSubVariantCloudWatchStandard:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ AccountID: ptr("123456789012"),
+ Region: ptr("us-west-2"),
+ Namespace: ptr("AWS/ApplicationELB"),
+ MetricName: ptr("HTTPCode_Target_5XX_Count"),
+ Stat: ptr("SampleCount"),
+ Dimensions: []v1alphaSLO.CloudWatchMetricDimension{
+ {
+ Name: ptr("LoadBalancer"),
+ Value: ptr("app/api-server"),
+ },
+ },
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ AccountID: ptr("123456789012"),
+ Region: ptr("us-west-2"),
+ Namespace: ptr("AWS/ApplicationELB"),
+ MetricName: ptr("RequestCount"),
+ Stat: ptr("SampleCount"),
+ Dimensions: []v1alphaSLO.CloudWatchMetricDimension{
+ {
+ Name: ptr("LoadBalancer"),
+ Value: ptr("app/api-server"),
+ },
+ },
+ }))
+ case metricVariantThreshold + metricSubVariantCloudWatchSQLQuery:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ SQL: ptr(`SELECT AVG(CPUUtilization) FROM "AWS/EC2”`),
+ }))
+ case metricVariantGoodRatio + metricSubVariantCloudWatchSQLQuery:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ SQL: ptr(`SELECT AVG(CPUUtilization) FROM "AWS/EC2"`),
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ SQL: ptr(`SELECT MAX(CPUUtilization) FROM "AWS/EC2"`),
+ }))
+ // TODO this needs to be better adjusted.
+ case metricVariantBadRatio + metricSubVariantCloudWatchSQLQuery:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ SQL: ptr(`SELECT AVG(CPUUtilization) FROM "AWS/EC2"`),
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ SQL: ptr(`SELECT MAX(CPUUtilization) FROM "AWS/EC2"`),
+ }))
+ case metricVariantThreshold + metricSubVariantCloudWatchJSON:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ JSON: ptr(mustLoadQuery("cloudwatch_threshold.json")),
+ }))
+ case metricVariantGoodRatio + metricSubVariantCloudWatchJSON:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ JSON: ptr(mustLoadQuery("cloudwatch_count_good.json")),
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ JSON: ptr(mustLoadQuery("cloudwatch_count_total.json")),
+ }))
+ // TODO this needs to be better adjusted.
+ case metricVariantBadRatio + metricSubVariantCloudWatchJSON:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ JSON: ptr(mustLoadQuery("cloudwatch_count_bad.json")),
+ }), newMetricSpec(v1alphaSLO.CloudWatchMetric{
+ Region: ptr("us-west-2"),
+ JSON: ptr(mustLoadQuery("cloudwatch_count_total.json")),
+ }))
+ }
+ case v1alpha.Pingdom:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantPingdomUptime:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.PingdomMetric{
+ CheckID: ptr("1234567"),
+ CheckType: ptr(v1alphaSLO.PingdomTypeUptime),
+ Status: ptr("up"),
+ }))
+ case metricVariantGoodRatio + metricSubVariantPingdomUptime:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.PingdomMetric{
+ CheckID: ptr("1234567"),
+ CheckType: ptr(v1alphaSLO.PingdomTypeUptime),
+ Status: ptr("up"),
+ }), newMetricSpec(v1alphaSLO.PingdomMetric{
+ CheckID: ptr("1234567"),
+ CheckType: ptr(v1alphaSLO.PingdomTypeUptime),
+ Status: ptr("up,down"),
+ }))
+ case metricVariantGoodRatio + metricSubVariantPingdomTransaction:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.PingdomMetric{
+ CheckID: ptr("1234567"),
+ CheckType: ptr(v1alphaSLO.PingdomTypeTransaction),
+ }), newMetricSpec(v1alphaSLO.PingdomMetric{
+ CheckID: ptr("1234567"),
+ CheckType: ptr(v1alphaSLO.PingdomTypeTransaction),
+ }))
+ }
+ case v1alpha.AmazonPrometheus:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.AmazonPrometheusMetric{
+ PromQL: ptr(`api_server_requestMsec{host="*",job="nginx"}`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AmazonPrometheusMetric{
+ PromQL: ptr(`sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})`),
+ }), newMetricSpec(v1alphaSLO.AmazonPrometheusMetric{
+ PromQL: ptr(`sum(http_request_duration_seconds_count{handler="/api/v1/slos"})`),
+ }))
+ }
+ case v1alpha.Redshift:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.RedshiftMetric{
+ Region: ptr("eu-central-1"),
+ ClusterID: ptr("prod-cluster"),
+ DatabaseName: ptr("db"),
+ Query: ptr(`SELECT value as n9value, timestamp as n9date FROM sinusoid WHERE timestamp BETWEEN :n9date_from AND :n9date_to`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.RedshiftMetric{
+ Region: ptr("eu-central-1"),
+ ClusterID: ptr("prod-cluster"),
+ DatabaseName: ptr("db"),
+ Query: ptr(`SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE value = '200' AND timestamp BETWEEN :n9date_from AND :n9date_to`),
+ }), newMetricSpec(v1alphaSLO.RedshiftMetric{
+ Region: ptr("eu-central-1"),
+ ClusterID: ptr("prod-cluster"),
+ DatabaseName: ptr("db"),
+ Query: ptr(`SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE timestamp BETWEEN :n9date_from AND :n9date_to`),
+ }))
+ }
+ case v1alpha.SumoLogic:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantSumoLogicMetrics:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("metrics"),
+ Rollup: ptr("Avg"),
+ Quantization: ptr("15s"),
+ Query: ptr(`metric=CPU_Usage`),
+ }))
+ case metricVariantGoodRatio + metricSubVariantSumoLogicMetrics:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("metrics"),
+ Rollup: ptr("Avg"),
+ Quantization: ptr("15s"),
+ Query: ptr(`metric=Mem_Used`),
+ }), newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("metrics"),
+ Rollup: ptr("Avg"),
+ Quantization: ptr("15s"),
+ Query: ptr(`metric=Mem_Total`),
+ }))
+ case metricVariantThreshold + metricSubVariantSumoLogicLogs:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("logs"),
+ Query: ptr(`_sourceCategory=uploads/nginx
+| timeslice 1m as n9_time
+| parse "HTTP/1.1" * * " as (status_code, size, tail)
+| if (status_code matches "20" or status_code matches "30*",1,0) as resp_ok
+| sum(resp_ok) as n9_value by n9_time
+| sort by n9_time asc`),
+ }))
+ case metricVariantGoodRatio + metricSubVariantSumoLogicLogs:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("logs"),
+ Query: ptr(`_collector="app-cluster" _source="logs"
+| json "log"
+| timeslice 15s as n9_time
+| parse "level=* *" as (log_level, tail)
+| if (log_level matches "error" ,0,1) as log_level_not_error
+| sum(log_level_not_error) as n9_value by n9_time
+| sort by n9_time asc`),
+ }), newMetricSpec(v1alphaSLO.SumoLogicMetric{
+ Type: ptr("logs"),
+ Query: ptr(`_collector="app-cluster" _source="logs"
+| json "log"
+| timeslice 15s as n9_time
+| parse "level=* *" as (log_level, tail)
+| count(*) as n9_value by n9_time
+| sort by n9_time asc`),
+ }))
+ }
+ case v1alpha.Instana:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantInstanaInfrastructureQuery:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "query",
+ Query: ptr("entity.selfType:zookeeper AND entity.label:replica.1"),
+ MetricID: "max_request_latency",
+ PluginID: "zooKeeper",
+ },
+ }))
+ case metricVariantThreshold + metricSubVariantInstanaInfrastructureSnapshotID:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "snapshot",
+ SnapshotID: ptr("00u2y4e4atkzaYkXP4x8"),
+ MetricID: "max_request_latency",
+ PluginID: "zooKeeper",
+ },
+ }))
+ case metricVariantThreshold + metricSubVariantInstanaApplication:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "application",
+ Application: &v1alphaSLO.InstanaApplicationMetricType{
+ MetricID: "calls",
+ Aggregation: "sum",
+ GroupBy: v1alphaSLO.InstanaApplicationMetricGroupBy{
+ Tag: "application.name",
+ TagEntity: "DESTINATION",
+ },
+ APIQuery: mustLoadQuery("instana_application_query.json"),
+ },
+ }))
+ case metricVariantGoodRatio + metricSubVariantInstanaInfrastructureQuery:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "query",
+ Query: ptr("entity.selfType:zookeeper AND entity.label:replica.1"),
+ MetricID: "error_requests_count",
+ PluginID: "zooKeeper",
+ },
+ }), newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "query",
+ Query: ptr("entity.selfType:zookeeper AND entity.label:replica.1"),
+ MetricID: "total_requests_count",
+ PluginID: "zooKeeper",
+ },
+ }))
+ case metricVariantGoodRatio + metricSubVariantInstanaInfrastructureSnapshotID:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "snapshot",
+ SnapshotID: ptr("00u2y4e4atkzaYkXP4x8"),
+ MetricID: "error_requests_count",
+ PluginID: "zooKeeper",
+ },
+ }), newMetricSpec(v1alphaSLO.InstanaMetric{
+ MetricType: "infrastructure",
+ Infrastructure: &v1alphaSLO.InstanaInfrastructureMetricType{
+ MetricRetrievalMethod: "snapshot",
+ SnapshotID: ptr("00u2y4e4atkzaYkXP4x8"),
+ MetricID: "total_requests_count",
+ PluginID: "zooKeeper",
+ },
+ }))
+ }
+ case v1alpha.InfluxDB:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.InfluxDBMetric{
+ Query: ptr(`from(bucket: "integrations")
+|> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+|> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+|> filter(fn: (r) => r["_measurement"] == "internal_write")
+|> filter(fn: (r) => r["_field"] == "write_time_ns")`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.InfluxDBMetric{
+ Query: ptr(`from(bucket: "integrations")
+|> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+|> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+|> filter(fn: (r) => r["_measurement"] == "internal_write")
+|> filter(fn: (r) => r["_field"] == "write_time_ns")`),
+ }), newMetricSpec(v1alphaSLO.InfluxDBMetric{
+ Query: ptr(`from(bucket: "integrations")
+|> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+|> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+|> filter(fn: (r) => r["_measurement"] == "internal_write")
+|> filter(fn: (r) => r["_field"] == "write_time_ns")`),
+ }))
+ }
+ case v1alpha.GCM:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.GCMMetric{
+ ProjectID: "my-project-id",
+ Query: `fetch api-server
+| metric 'serviceruntime.googleapis.com/api/request_latencies'
+| filter (resource.service == 'monitoring.googleapis.com')
+| align delta(1m)
+| every 1m
+| group_by [resource.service],
+ [value_request_latencies_mean: mean(value.request_latencies)]`}))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.GCMMetric{
+ ProjectID: "my-project-id",
+ Query: `fetch api-server
+| metric 'serviceruntime.googleapis.com/api/request_count'
+| filter
+ (resource.service == 'monitoring.googleapis.com')
+ && (metric.response_code == '200')
+| align rate(1m)
+| every 1m
+| group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]`,
+ }), newMetricSpec(v1alphaSLO.GCMMetric{
+ ProjectID: "my-project-id",
+ Query: `fetch api-server
+| metric 'serviceruntime.googleapis.com/api/request_count'
+| filter
+ (resource.service == 'monitoring.googleapis.com')
+| align rate(1m)
+| every 1m
+| group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]`}))
+ }
+ case v1alpha.AzureMonitor:
+ switch s.MetricVariant + s.MetricSubVariant {
+ case metricVariantThreshold + metricSubVariantAzureMonitorMetrics:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeMetrics,
+ ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server",
+ MetricName: "Percentage CPU",
+ MetricNamespace: "azure.applicationinsights",
+ Aggregation: "Avg",
+ }))
+ case metricVariantGoodRatio + metricSubVariantAzureMonitorMetrics:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeMetrics,
+ ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server",
+ MetricName: "Http2xx",
+ Aggregation: "Sum",
+ }), newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeMetrics,
+ ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server",
+ MetricName: "Requests",
+ Aggregation: "Sum",
+ }))
+ case metricVariantBadRatio + metricSubVariantAzureMonitorMetrics:
+ return setBadOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeMetrics,
+ ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server",
+ MetricName: "Http4xx",
+ Aggregation: "Sum",
+ }), newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeMetrics,
+ ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server",
+ MetricName: "Requests",
+ Aggregation: "Sum",
+ }))
+ case metricVariantThreshold + metricSubVariantAzureMonitorLogs:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeLogs,
+ KQLQuery: `AppRequests
+| where AppRoleName == "api-server"
+| summarize n9_value = avg(DurationMs) by bin(TimeGenerated, 15s)
+| project n9_time = TimeGenerated, n9_value`,
+ Workspace: &v1alphaSLO.AzureMonitorMetricLogAnalyticsWorkspace{
+ SubscriptionID: "00000000-0000-0000-0000-000000000000",
+ ResourceGroup: "myResourceGroup",
+ WorkspaceID: "11111111-1111-1111-1111-111111111111",
+ },
+ }))
+ case metricVariantGoodRatio + metricSubVariantAzureMonitorLogs:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeLogs,
+ KQLQuery: `AppRequests
+| where AppRoleName == "my-app"
+| where ResultCode >= 200 and ResultCode < 400
+| summarize n9_value = count() by bin(TimeGenerated, 15s)
+| project n9_time = TimeGenerated, n9_value`,
+ Workspace: &v1alphaSLO.AzureMonitorMetricLogAnalyticsWorkspace{
+ SubscriptionID: "00000000-0000-0000-0000-000000000000",
+ ResourceGroup: "myResourceGroup",
+ WorkspaceID: "11111111-1111-1111-1111-111111111111",
+ },
+ }), newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeLogs,
+ KQLQuery: `AppRequests
+| where AppRoleName == "my-app"
+| summarize n9_value = count() by bin(TimeGenerated, 15s)
+| project n9_time = TimeGenerated, n9_value`,
+ Workspace: &v1alphaSLO.AzureMonitorMetricLogAnalyticsWorkspace{
+ SubscriptionID: "00000000-0000-0000-0000-000000000000",
+ ResourceGroup: "myResourceGroup",
+ WorkspaceID: "11111111-1111-1111-1111-111111111111",
+ },
+ }))
+ case metricVariantBadRatio + metricSubVariantAzureMonitorLogs:
+ return setBadOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeLogs,
+ KQLQuery: `AppRequests
+| where AppRoleName == "my-app"
+| where ResultCode == 0 or ResultCode >= 400
+| summarize n9_value = count() by bin(TimeGenerated, 15s)
+| project n9_time = TimeGenerated, n9_value`,
+ Workspace: &v1alphaSLO.AzureMonitorMetricLogAnalyticsWorkspace{
+ SubscriptionID: "00000000-0000-0000-0000-000000000000",
+ ResourceGroup: "myResourceGroup",
+ WorkspaceID: "11111111-1111-1111-1111-111111111111",
+ },
+ }), newMetricSpec(v1alphaSLO.AzureMonitorMetric{
+ DataType: v1alphaSLO.AzureMonitorDataTypeLogs,
+ KQLQuery: `AppRequests
+| where AppRoleName == "my-app"
+| summarize n9_value = count() by bin(TimeGenerated, 15s)
+| project n9_time = TimeGenerated, n9_value`,
+ Workspace: &v1alphaSLO.AzureMonitorMetricLogAnalyticsWorkspace{
+ SubscriptionID: "00000000-0000-0000-0000-000000000000",
+ ResourceGroup: "myResourceGroup",
+ WorkspaceID: "11111111-1111-1111-1111-111111111111",
+ },
+ }))
+ }
+ case v1alpha.Generic:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.GenericMetric{
+ Query: ptr(`SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics("infra:database.cpu.utilization", "aws-cloudwatch"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)`),
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.GenericMetric{
+ Query: ptr(`SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics("infra:database.requests.good", "aws-cloudwatch"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)`),
+ }), newMetricSpec(v1alphaSLO.GenericMetric{
+ Query: ptr(`SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics("infra:database.requests.total", "aws-cloudwatch"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)`),
+ }))
+ }
+ case v1alpha.Honeycomb:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.HoneycombMetric{
+ Calculation: "AVG",
+ Attribute: "requestsLatency",
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.HoneycombMetric{
+ Calculation: "SUM",
+ Attribute: "counterGood",
+ }), newMetricSpec(v1alphaSLO.HoneycombMetric{
+ Calculation: "SUM",
+ Attribute: "counterTotal",
+ }))
+ case metricVariantBadRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.HoneycombMetric{
+ Calculation: "SUM",
+ Attribute: "counterBad",
+ }), newMetricSpec(v1alphaSLO.HoneycombMetric{
+ Calculation: "SUM",
+ Attribute: "counterTotal",
+ }))
+ }
+ case v1alpha.LogicMonitor:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.LogicMonitorMetric{
+ QueryType: "device_metrics",
+ DeviceDataSourceInstanceID: 933147615,
+ GraphID: 9978,
+ Line: "TIMEMAX",
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.LogicMonitorMetric{
+ QueryType: "device_metrics",
+ DeviceDataSourceInstanceID: 933147615,
+ GraphID: 11438,
+ Line: "CONNECTIONSUCCESSES",
+ }), newMetricSpec(v1alphaSLO.LogicMonitorMetric{
+ QueryType: "device_metrics",
+ DeviceDataSourceInstanceID: 933147615,
+ GraphID: 11436,
+ Line: "CONNECTIONSESTABLISHED",
+ }))
+ case metricVariantBadRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.LogicMonitorMetric{
+ QueryType: "device_metrics",
+ DeviceDataSourceInstanceID: 933147615,
+ GraphID: 11437,
+ Line: "CONNECTIONFAILURES",
+ }), newMetricSpec(v1alphaSLO.LogicMonitorMetric{
+ QueryType: "device_metrics",
+ DeviceDataSourceInstanceID: 933147615,
+ GraphID: 11436,
+ Line: "CONNECTIONSESTABLISHED",
+ }))
+ }
+ case v1alpha.AzurePrometheus:
+ switch s.MetricVariant {
+ case metricVariantThreshold:
+ return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.AzurePrometheusMetric{
+ PromQL: `sum((rate(container_cpu_usage_seconds_total{container!="POD",container!=""}[30m])
+- on (namespace,pod,container) group_left avg by (namespace,pod,container)(kube_pod_container_resource_requests{resource="cpu"}))
+* -1 >0)`,
+ }))
+ case metricVariantGoodRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzurePrometheusMetric{
+ PromQL: `sum(api_server_requests_total{code="2xx"})`,
+ }), newMetricSpec(v1alphaSLO.AzurePrometheusMetric{
+ PromQL: `sum(api_server_requests_total{})`,
+ }))
+ case metricVariantBadRatio:
+ return setGoodOverTotalMetric(slo, newMetricSpec(v1alphaSLO.AzurePrometheusMetric{
+ PromQL: `sum(api_server_requests_total{code="5xx"})`,
+ }), newMetricSpec(v1alphaSLO.AzurePrometheusMetric{
+ PromQL: `sum(api_server_requests_total{})`,
+ }))
+ }
+ default:
+ panic(fmt.Sprintf("unsupported data source type: %s", s.DataSourceType))
+ }
+ panic(fmt.Sprintf("unsupported data source type and/or variants: %s %s %s",
+ s.DataSourceType, s.MetricVariant, s.MetricSubVariant))
+}
+
+func setThresholdMetric(slo v1alphaSLO.SLO, metricSpec *v1alphaSLO.MetricSpec) v1alphaSLO.SLO {
+ slo.Spec.Objectives[0].CountMetrics = nil
+ slo.Spec.Objectives[0].RawMetric.MetricQuery = metricSpec
+ return slo
+}
+
+func setGoodOverTotalMetric(slo v1alphaSLO.SLO, good, total *v1alphaSLO.MetricSpec) v1alphaSLO.SLO {
+ slo.Spec.Objectives[0].RawMetric = nil
+ slo.Spec.Objectives[0].CountMetrics.GoodMetric = good
+ slo.Spec.Objectives[0].CountMetrics.TotalMetric = total
+ return slo
+}
+
+func setBadOverTotalMetric(slo v1alphaSLO.SLO, bad, total *v1alphaSLO.MetricSpec) v1alphaSLO.SLO {
+ slo.Spec.Objectives[0].RawMetric = nil
+ slo.Spec.Objectives[0].CountMetrics.GoodMetric = bad
+ slo.Spec.Objectives[0].CountMetrics.TotalMetric = total
+ return slo
+}
+
+func newMetricSpec(metric any) *v1alphaSLO.MetricSpec {
+ v := reflect.ValueOf(metric)
+ if v.Kind() == reflect.Ptr {
+ metric = v.Elem().Interface()
+ }
+ spec := &v1alphaSLO.MetricSpec{}
+ switch v := metric.(type) {
+ case v1alphaSLO.PrometheusMetric:
+ spec.Prometheus = &v
+ case v1alphaSLO.DatadogMetric:
+ spec.Datadog = &v
+ case v1alphaSLO.NewRelicMetric:
+ spec.NewRelic = &v
+ case v1alphaSLO.AppDynamicsMetric:
+ spec.AppDynamics = &v
+ case v1alphaSLO.SplunkMetric:
+ spec.Splunk = &v
+ case v1alphaSLO.LightstepMetric:
+ spec.Lightstep = &v
+ case v1alphaSLO.SplunkObservabilityMetric:
+ spec.SplunkObservability = &v
+ case v1alphaSLO.DynatraceMetric:
+ spec.Dynatrace = &v
+ case v1alphaSLO.ElasticsearchMetric:
+ spec.Elasticsearch = &v
+ case v1alphaSLO.ThousandEyesMetric:
+ spec.ThousandEyes = &v
+ case v1alphaSLO.GraphiteMetric:
+ spec.Graphite = &v
+ case v1alphaSLO.BigQueryMetric:
+ spec.BigQuery = &v
+ case v1alphaSLO.OpenTSDBMetric:
+ spec.OpenTSDB = &v
+ case v1alphaSLO.GrafanaLokiMetric:
+ spec.GrafanaLoki = &v
+ case v1alphaSLO.CloudWatchMetric:
+ spec.CloudWatch = &v
+ case v1alphaSLO.PingdomMetric:
+ spec.Pingdom = &v
+ case v1alphaSLO.AmazonPrometheusMetric:
+ spec.AmazonPrometheus = &v
+ case v1alphaSLO.RedshiftMetric:
+ spec.Redshift = &v
+ case v1alphaSLO.SumoLogicMetric:
+ spec.SumoLogic = &v
+ case v1alphaSLO.InstanaMetric:
+ spec.Instana = &v
+ case v1alphaSLO.InfluxDBMetric:
+ spec.InfluxDB = &v
+ case v1alphaSLO.GCMMetric:
+ spec.GCM = &v
+ case v1alphaSLO.AzureMonitorMetric:
+ spec.AzureMonitor = &v
+ case v1alphaSLO.GenericMetric:
+ spec.Generic = &v
+ case v1alphaSLO.HoneycombMetric:
+ spec.Honeycomb = &v
+ case v1alphaSLO.LogicMonitorMetric:
+ spec.LogicMonitor = &v
+ case v1alphaSLO.AzurePrometheusMetric:
+ spec.AzurePrometheus = &v
+ default:
+ panic(fmt.Sprintf("unsupported metric type: %T", metric))
+ }
+ return spec
+}
+
+func mustLoadQuery(name string) string {
+ data, err := queriesFS.ReadFile(filepath.Join("queries", name))
+ if err != nil {
+ panic(fmt.Sprintf("failed to load query: %s", err))
+ }
+ return string(data)
+}
+
+func ptr[T any](v T) *T { return &v }
diff --git a/internal/manifest/v1alpha/examples/utils.go b/internal/manifest/v1alpha/examples/utils.go
new file mode 100644
index 00000000..c03e2bb1
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/utils.go
@@ -0,0 +1,52 @@
+package v1alphaExamples
+
+import (
+ "strings"
+ "time"
+ "unicode"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+)
+
+func mustParseTime(s string) time.Time {
+ t, err := time.Parse(time.RFC3339, s)
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+func toKebabCase(input string) string {
+ b := strings.Builder{}
+ for i, r := range input {
+ if unicode.IsUpper(r) {
+ if i != 0 {
+ b.WriteRune('-')
+ }
+ b.WriteRune(unicode.ToLower(r))
+ } else {
+ b.WriteRune(r)
+ }
+ }
+ return b.String()
+}
+
+func dataSourceTypePrettyName(typ v1alpha.DataSourceType) string {
+ switch typ {
+ case v1alpha.AppDynamics, v1alpha.ThousandEyes, v1alpha.BigQuery,
+ v1alpha.OpenTSDB, v1alpha.CloudWatch, v1alpha.InfluxDB, v1alpha.LogicMonitor:
+ return typ.String()
+ }
+ return splitCamelCase(typ.String())
+}
+
+func splitCamelCase(input string) string {
+ b := strings.Builder{}
+ for i, r := range input {
+ if i != 0 && unicode.IsUpper(r) {
+ b.WriteRune(' ')
+ }
+ b.WriteRune(r)
+ }
+ return b.String()
+}
diff --git a/internal/manifest/v1alpha/examples/validation_test.go b/internal/manifest/v1alpha/examples/validation_test.go
new file mode 100644
index 00000000..cba10d3d
--- /dev/null
+++ b/internal/manifest/v1alpha/examples/validation_test.go
@@ -0,0 +1,135 @@
+package v1alphaExamples
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAgent "github.com/nobl9/nobl9-go/manifest/v1alpha/agent"
+ v1alphaAlertMethod "github.com/nobl9/nobl9-go/manifest/v1alpha/alertmethod"
+ v1alphaAlertPolicy "github.com/nobl9/nobl9-go/manifest/v1alpha/alertpolicy"
+ v1alphaAlertSilence "github.com/nobl9/nobl9-go/manifest/v1alpha/alertsilence"
+ v1alphaAnnotation "github.com/nobl9/nobl9-go/manifest/v1alpha/annotation"
+ v1alphaBudgetAdjustment "github.com/nobl9/nobl9-go/manifest/v1alpha/budgetadjustment"
+ v1alphaDataExport "github.com/nobl9/nobl9-go/manifest/v1alpha/dataexport"
+ v1alphaDirect "github.com/nobl9/nobl9-go/manifest/v1alpha/direct"
+ v1alphaProject "github.com/nobl9/nobl9-go/manifest/v1alpha/project"
+ v1alphaRoleBinding "github.com/nobl9/nobl9-go/manifest/v1alpha/rolebinding"
+ v1alphaService "github.com/nobl9/nobl9-go/manifest/v1alpha/service"
+)
+
+func TestExamples_Validate_SLO(t *testing.T) {
+ for _, variant := range SLO() {
+ v := variant.(sloExample)
+ t.Run(v.String(), func(t *testing.T) {
+ assert.NoError(t, v.SLO.Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Project(t *testing.T) {
+ for _, variant := range Project() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaProject.Project).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Service(t *testing.T) {
+ for _, variant := range Service() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaService.Service).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_AlertMethod(t *testing.T) {
+ for _, variant := range AlertMethod() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaAlertMethod.AlertMethod).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Agent(t *testing.T) {
+ for _, variant := range Agent() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaAgent.Agent).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Direct(t *testing.T) {
+ for _, variant := range Direct() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaDirect.Direct).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_AlertPolicy(t *testing.T) {
+ for _, variant := range AlertPolicy() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaAlertPolicy.AlertPolicy).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_AlertSilence(t *testing.T) {
+ for _, variant := range AlertSilence() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaAlertSilence.AlertSilence).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Annotation(t *testing.T) {
+ for _, variant := range Annotation() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaAnnotation.Annotation).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_BudgetAdjustment(t *testing.T) {
+ for _, variant := range BudgetAdjustment() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaBudgetAdjustment.BudgetAdjustment).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_DataExport(t *testing.T) {
+ for _, variant := range DataExport() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaDataExport.DataExport).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_RoleBinding(t *testing.T) {
+ for _, variant := range RoleBinding() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.NoError(t, variant.GetObject().(v1alphaRoleBinding.RoleBinding).Validate())
+ })
+ }
+}
+
+func TestExamples_Validate_Labels(t *testing.T) {
+ for _, variant := range Labels() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.Nil(t, v1alpha.LabelsValidationRules().Validate(variant.GetObject().(v1alpha.Labels)))
+ })
+ }
+}
+
+func TestExamples_Validate_MetadataAnnotations(t *testing.T) {
+ for _, variant := range MetadataAnnotations() {
+ t.Run(variant.GetVariant()+" "+variant.GetSubVariant(), func(t *testing.T) {
+ assert.Nil(t,
+ v1alpha.MetadataAnnotationsValidationRules().
+ Validate(variant.GetObject().(v1alpha.MetadataAnnotations)))
+ })
+ }
+}
diff --git a/internal/manifest/v1alphatest/labels_validation.go b/internal/manifest/v1alphatest/labels_validation.go
index e2217b66..abfe086b 100644
--- a/internal/manifest/v1alphatest/labels_validation.go
+++ b/internal/manifest/v1alphatest/labels_validation.go
@@ -9,6 +9,7 @@ import (
"github.com/nobl9/go-yaml"
"github.com/stretchr/testify/require"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
"github.com/nobl9/nobl9-go/internal/testutils"
"github.com/nobl9/nobl9-go/internal/validation"
"github.com/nobl9/nobl9-go/manifest"
@@ -34,7 +35,7 @@ func GetLabelsTestCases[T manifest.Object](t *testing.T, propertyPath string) ma
t.Helper()
sourcedTestCases, err := os.ReadFile(filepath.Join(
- testutils.FindModuleRoot(),
+ pathutils.FindModuleRoot(),
"manifest/v1alpha/labels_examples.yaml"))
require.NoError(t, err)
var examples v1alpha.Labels
diff --git a/internal/manifest/v1alphatest/metadata_annotations_validation.go b/internal/manifest/v1alphatest/metadata_annotations_validation.go
index e2cef335..57bb74fd 100644
--- a/internal/manifest/v1alphatest/metadata_annotations_validation.go
+++ b/internal/manifest/v1alphatest/metadata_annotations_validation.go
@@ -9,6 +9,7 @@ import (
"github.com/nobl9/go-yaml"
"github.com/stretchr/testify/require"
+ "github.com/nobl9/nobl9-go/internal/pathutils"
"github.com/nobl9/nobl9-go/internal/testutils"
"github.com/nobl9/nobl9-go/internal/validation"
"github.com/nobl9/nobl9-go/manifest"
@@ -37,7 +38,7 @@ func GetMetadataAnnotationsTestCases[T manifest.Object](
t.Helper()
sourcedTestCases, err := os.ReadFile(filepath.Join(
- testutils.FindModuleRoot(),
+ pathutils.FindModuleRoot(),
"manifest/v1alpha/metadata_annotations_examples.yaml"))
require.NoError(t, err)
var examples v1alpha.MetadataAnnotations
diff --git a/internal/testutils/path.go b/internal/pathutils/root_path.go
similarity index 95%
rename from internal/testutils/path.go
rename to internal/pathutils/root_path.go
index 5967cd72..cd8264af 100644
--- a/internal/testutils/path.go
+++ b/internal/pathutils/root_path.go
@@ -1,4 +1,4 @@
-package testutils
+package pathutils
import (
"os"
diff --git a/manifest/v1alpha/agent/example.yaml b/manifest/v1alpha/agent/example.yaml
deleted file mode 100644
index 78cfeaca..00000000
--- a/manifest/v1alpha/agent/example.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: n9/v1alpha
-kind: Agent
-metadata:
- name: prometheus
- displayName: My Prometheus
- project: default
-spec:
- description: Example Prometheus Agent
- prometheus:
- url: https://prometheus-service.monitoring:8080
\ No newline at end of file
diff --git a/manifest/v1alpha/agent/examples/amazon-prometheus.yaml b/manifest/v1alpha/agent/examples/amazon-prometheus.yaml
new file mode 100644
index 00000000..eb854699
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/amazon-prometheus.yaml
@@ -0,0 +1,23 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: amazon-prometheus
+ displayName: Amazon Prometheus Agent
+ project: default
+spec:
+ description: Example Amazon Prometheus Agent
+ releaseChannel: stable
+ amazonPrometheus:
+ url: https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-f49ecf99-6dfa-4b00-9f94-a50b10a3010b
+ region: us-east-1
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/app-dynamics.yaml b/manifest/v1alpha/agent/examples/app-dynamics.yaml
new file mode 100644
index 00000000..b969abfc
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/app-dynamics.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: app-dynamics
+ displayName: AppDynamics Agent
+ project: default
+spec:
+ description: Example AppDynamics Agent
+ releaseChannel: stable
+ appDynamics:
+ url: https://my-org.saas.appdynamics.com
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/azure-monitor.yaml b/manifest/v1alpha/agent/examples/azure-monitor.yaml
new file mode 100644
index 00000000..ba9ce9c0
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/azure-monitor.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: azure-monitor
+ displayName: Azure Monitor Agent
+ project: default
+spec:
+ description: Example Azure Monitor Agent
+ releaseChannel: stable
+ azureMonitor:
+ tenantId: 5cdecca3-c2c5-4072-89dd-5555faf05202
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/azure-prometheus.yaml b/manifest/v1alpha/agent/examples/azure-prometheus.yaml
new file mode 100644
index 00000000..0c79fe94
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/azure-prometheus.yaml
@@ -0,0 +1,23 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: azure-prometheus
+ displayName: Azure Prometheus Agent
+ project: default
+spec:
+ description: Example Azure Prometheus Agent
+ releaseChannel: stable
+ azurePrometheus:
+ url: https://defaultazuremonitorworkspace-westus2-szxw.westus2.prometheus.monitor.azure.com
+ tenantId: 41372654-f4b6-4bd1-a3fe-75629c024df1
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/big-query.yaml b/manifest/v1alpha/agent/examples/big-query.yaml
new file mode 100644
index 00000000..78753170
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/big-query.yaml
@@ -0,0 +1,14 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: big-query
+ displayName: BigQuery Agent
+ project: default
+spec:
+ description: Example BigQuery Agent
+ releaseChannel: stable
+ bigQuery: {}
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/cloud-watch.yaml b/manifest/v1alpha/agent/examples/cloud-watch.yaml
new file mode 100644
index 00000000..b7b23155
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/cloud-watch.yaml
@@ -0,0 +1,21 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: cloud-watch
+ displayName: CloudWatch Agent
+ project: default
+spec:
+ description: Example CloudWatch Agent
+ releaseChannel: stable
+ cloudWatch: {}
+ historicalDataRetrieval:
+ maxDuration:
+ value: 15
+ unit: Day
+ defaultDuration:
+ value: 7
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/datadog.yaml b/manifest/v1alpha/agent/examples/datadog.yaml
new file mode 100644
index 00000000..53a8e63e
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/datadog.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: datadog
+ displayName: Datadog Agent
+ project: default
+spec:
+ description: Example Datadog Agent
+ releaseChannel: stable
+ datadog:
+ site: com
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/dynatrace.yaml b/manifest/v1alpha/agent/examples/dynatrace.yaml
new file mode 100644
index 00000000..2c44f84f
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/dynatrace.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: dynatrace
+ displayName: Dynatrace Agent
+ project: default
+spec:
+ description: Example Dynatrace Agent
+ releaseChannel: stable
+ dynatrace:
+ url: https://zvf10945.live.dynatrace.com/
+ historicalDataRetrieval:
+ maxDuration:
+ value: 28
+ unit: Day
+ defaultDuration:
+ value: 14
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/elasticsearch.yaml b/manifest/v1alpha/agent/examples/elasticsearch.yaml
new file mode 100644
index 00000000..05727e1f
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/elasticsearch.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: elasticsearch
+ displayName: Elasticsearch Agent
+ project: default
+spec:
+ description: Example Elasticsearch Agent
+ releaseChannel: stable
+ elasticsearch:
+ url: http://elasticsearch-main.elasticsearch:9200
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/generic.yaml b/manifest/v1alpha/agent/examples/generic.yaml
new file mode 100644
index 00000000..a96c604e
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/generic.yaml
@@ -0,0 +1,14 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: generic
+ displayName: Generic Agent
+ project: default
+spec:
+ description: Example Generic Agent
+ releaseChannel: stable
+ generic: {}
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/google-cloud-monitoring.yaml b/manifest/v1alpha/agent/examples/google-cloud-monitoring.yaml
new file mode 100644
index 00000000..cca450a0
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/google-cloud-monitoring.yaml
@@ -0,0 +1,21 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: google-cloud-monitoring
+ displayName: Google Cloud Monitoring Agent
+ project: default
+spec:
+ description: Example Google Cloud Monitoring Agent
+ releaseChannel: stable
+ gcm: {}
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/grafana-loki.yaml b/manifest/v1alpha/agent/examples/grafana-loki.yaml
new file mode 100644
index 00000000..dfa57297
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/grafana-loki.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: grafana-loki
+ displayName: Grafana Loki Agent
+ project: default
+spec:
+ description: Example Grafana Loki Agent
+ releaseChannel: stable
+ grafanaLoki:
+ url: http://grafana-loki.loki:3100
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/graphite.yaml b/manifest/v1alpha/agent/examples/graphite.yaml
new file mode 100644
index 00000000..fe920467
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/graphite.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: graphite
+ displayName: Graphite Agent
+ project: default
+spec:
+ description: Example Graphite Agent
+ releaseChannel: stable
+ graphite:
+ url: http://graphite.graphite:8080/render
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/honeycomb.yaml b/manifest/v1alpha/agent/examples/honeycomb.yaml
new file mode 100644
index 00000000..8f3aba32
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/honeycomb.yaml
@@ -0,0 +1,21 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: honeycomb
+ displayName: Honeycomb Agent
+ project: default
+spec:
+ description: Example Honeycomb Agent
+ releaseChannel: stable
+ honeycomb: {}
+ historicalDataRetrieval:
+ maxDuration:
+ value: 7
+ unit: Day
+ defaultDuration:
+ value: 3
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/influx-d-b.yaml b/manifest/v1alpha/agent/examples/influx-d-b.yaml
new file mode 100644
index 00000000..6d3ecc26
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/influx-d-b.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: influx-d-b
+ displayName: InfluxDB Agent
+ project: default
+spec:
+ description: Example InfluxDB Agent
+ releaseChannel: stable
+ influxdb:
+ url: https://us-west-2-2.aws.cloud2.influxdata.com
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/instana.yaml b/manifest/v1alpha/agent/examples/instana.yaml
new file mode 100644
index 00000000..a6437549
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/instana.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: instana
+ displayName: Instana Agent
+ project: default
+spec:
+ description: Example Instana Agent
+ releaseChannel: stable
+ instana:
+ url: https://orange-my-org12.instana.io
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/lightstep.yaml b/manifest/v1alpha/agent/examples/lightstep.yaml
new file mode 100644
index 00000000..9e8040a3
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/lightstep.yaml
@@ -0,0 +1,24 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: lightstep
+ displayName: Lightstep Agent
+ project: default
+spec:
+ description: Example Lightstep Agent
+ releaseChannel: stable
+ lightstep:
+ organization: MyOrg
+ project: prod-app
+ url: https://api.lightstep.com
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/logic-monitor.yaml b/manifest/v1alpha/agent/examples/logic-monitor.yaml
new file mode 100644
index 00000000..a3790738
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/logic-monitor.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: logic-monitor
+ displayName: LogicMonitor Agent
+ project: default
+spec:
+ description: Example LogicMonitor Agent
+ releaseChannel: stable
+ logicMonitor:
+ account: my-account-name
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/new-relic.yaml b/manifest/v1alpha/agent/examples/new-relic.yaml
new file mode 100644
index 00000000..02d94f2c
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/new-relic.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: new-relic
+ displayName: New Relic Agent
+ project: default
+spec:
+ description: Example New Relic Agent
+ releaseChannel: stable
+ newRelic:
+ accountId: 1234567
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/open-t-s-d-b.yaml b/manifest/v1alpha/agent/examples/open-t-s-d-b.yaml
new file mode 100644
index 00000000..374c0290
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/open-t-s-d-b.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: open-t-s-d-b
+ displayName: OpenTSDB Agent
+ project: default
+spec:
+ description: Example OpenTSDB Agent
+ releaseChannel: stable
+ opentsdb:
+ url: http://opentsdb.opentsdb:4242
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/pingdom.yaml b/manifest/v1alpha/agent/examples/pingdom.yaml
new file mode 100644
index 00000000..d3f01652
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/pingdom.yaml
@@ -0,0 +1,14 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: pingdom
+ displayName: Pingdom Agent
+ project: default
+spec:
+ description: Example Pingdom Agent
+ releaseChannel: stable
+ pingdom: {}
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/prometheus.yaml b/manifest/v1alpha/agent/examples/prometheus.yaml
new file mode 100644
index 00000000..0082c3f3
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/prometheus.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: prometheus
+ displayName: Prometheus Agent
+ project: default
+spec:
+ description: Example Prometheus Agent
+ releaseChannel: stable
+ prometheus:
+ url: http://prometheus.prometheus:9090
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/redshift.yaml b/manifest/v1alpha/agent/examples/redshift.yaml
new file mode 100644
index 00000000..bb30b821
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/redshift.yaml
@@ -0,0 +1,14 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: redshift
+ displayName: Redshift Agent
+ project: default
+spec:
+ description: Example Redshift Agent
+ releaseChannel: stable
+ redshift: {}
+ queryDelay:
+ duration:
+ value: 31
+ unit: Second
diff --git a/manifest/v1alpha/agent/examples/splunk-observability.yaml b/manifest/v1alpha/agent/examples/splunk-observability.yaml
new file mode 100644
index 00000000..4af30261
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/splunk-observability.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: splunk-observability
+ displayName: Splunk Observability Agent
+ project: default
+spec:
+ description: Example Splunk Observability Agent
+ releaseChannel: stable
+ splunkObservability:
+ realm: us1
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/splunk.yaml b/manifest/v1alpha/agent/examples/splunk.yaml
new file mode 100644
index 00000000..db4196cf
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/splunk.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: splunk
+ displayName: Splunk Agent
+ project: default
+spec:
+ description: Example Splunk Agent
+ releaseChannel: stable
+ splunk:
+ url: https://splunk.my-org.com/services
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/sumo-logic.yaml b/manifest/v1alpha/agent/examples/sumo-logic.yaml
new file mode 100644
index 00000000..4b8bfe86
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/sumo-logic.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: sumo-logic
+ displayName: Sumo Logic Agent
+ project: default
+spec:
+ description: Example Sumo Logic Agent
+ releaseChannel: stable
+ sumoLogic:
+ url: https://service.sumologic.com
+ queryDelay:
+ duration:
+ value: 5
+ unit: Minute
diff --git a/manifest/v1alpha/agent/examples/thousand-eyes.yaml b/manifest/v1alpha/agent/examples/thousand-eyes.yaml
new file mode 100644
index 00000000..6cd163d9
--- /dev/null
+++ b/manifest/v1alpha/agent/examples/thousand-eyes.yaml
@@ -0,0 +1,14 @@
+apiVersion: n9/v1alpha
+kind: Agent
+metadata:
+ name: thousand-eyes
+ displayName: ThousandEyes Agent
+ project: default
+spec:
+ description: Example ThousandEyes Agent
+ releaseChannel: stable
+ thousandEyes: {}
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/alert/example.yaml b/manifest/v1alpha/alert/examples.yaml
similarity index 100%
rename from manifest/v1alpha/alert/example.yaml
rename to manifest/v1alpha/alert/examples.yaml
diff --git a/manifest/v1alpha/alertmethod/example.yaml b/manifest/v1alpha/alertmethod/example.yaml
deleted file mode 100644
index 4d283954..00000000
--- a/manifest/v1alpha/alertmethod/example.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: n9/v1alpha
-kind: AlertMethod
-metadata:
- name: my-alert-method
- displayName: My Alert Method
- project: default
-spec:
- description: Example alert method
- pagerduty:
- integrationKey: ABC12345
\ No newline at end of file
diff --git a/manifest/v1alpha/alertmethod/examples/discord.yaml b/manifest/v1alpha/alertmethod/examples/discord.yaml
new file mode 100644
index 00000000..b22fe06d
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/discord.yaml
@@ -0,0 +1,10 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: discord
+ displayName: Discord Alert Method
+ project: default
+spec:
+ description: Example Discord Alert Method
+ discord:
+ url: https://discord.com/api/webhooks/123/secret
diff --git a/manifest/v1alpha/alertmethod/examples/email.yaml b/manifest/v1alpha/alertmethod/examples/email.yaml
new file mode 100644
index 00000000..75a6fad9
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/email.yaml
@@ -0,0 +1,17 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: email
+ displayName: Email Alert Method
+ project: default
+spec:
+ description: Example Email Alert Method
+ email:
+ to:
+ - alerts-tests@nobl9.com
+ cc:
+ - alerts-tests+cc@nobl9.com
+ bcc:
+ - alerts-tests+bcc@nobl9.com
+ subject: Your SLO $slo_name needs attention!
+ body: "$alert_policy_name has triggered with the following conditions:\n $alert_policy_conditions[]\n Time: $timestamp\n Severity: $severity\n Project: $project_name\n Service: $service_name\n Organization: $organization"
diff --git a/manifest/v1alpha/alertmethod/examples/jira.yaml b/manifest/v1alpha/alertmethod/examples/jira.yaml
new file mode 100644
index 00000000..5ad47c4b
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/jira.yaml
@@ -0,0 +1,13 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: jira
+ displayName: Jira Alert Method
+ project: default
+spec:
+ description: Example Jira Alert Method
+ jira:
+ url: https://nobl9.atlassian.net/
+ username: jira-alerts@nobl9.com
+ apiToken: "123456789"
+ projectKey: AL
diff --git a/manifest/v1alpha/alertmethod/examples/opsgenie.yaml b/manifest/v1alpha/alertmethod/examples/opsgenie.yaml
new file mode 100644
index 00000000..c36b8686
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/opsgenie.yaml
@@ -0,0 +1,11 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: opsgenie
+ displayName: Opsgenie Alert Method
+ project: default
+spec:
+ description: Example Opsgenie Alert Method
+ opsgenie:
+ auth: GenieKey 123
+ url: https://api.opsgenie.com
diff --git a/manifest/v1alpha/alertmethod/examples/pagerduty.yaml b/manifest/v1alpha/alertmethod/examples/pagerduty.yaml
new file mode 100644
index 00000000..dc7e26ae
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/pagerduty.yaml
@@ -0,0 +1,12 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: pagerduty
+ displayName: PagerDuty Alert Method
+ project: default
+spec:
+ description: Example PagerDuty Alert Method
+ pagerduty:
+ integrationKey: "123456789"
+ sendResolution:
+ message: Alert is now resolved
diff --git a/manifest/v1alpha/alertmethod/examples/servicenow.yaml b/manifest/v1alpha/alertmethod/examples/servicenow.yaml
new file mode 100644
index 00000000..b3d5b77b
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/servicenow.yaml
@@ -0,0 +1,12 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: servicenow
+ displayName: ServiceNow Alert Method
+ project: default
+spec:
+ description: Example ServiceNow Alert Method
+ servicenow:
+ username: user
+ password: super-strong-password
+ instanceName: vm123
diff --git a/manifest/v1alpha/alertmethod/examples/slack.yaml b/manifest/v1alpha/alertmethod/examples/slack.yaml
new file mode 100644
index 00000000..d4a42656
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/slack.yaml
@@ -0,0 +1,10 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: slack
+ displayName: Slack Alert Method
+ project: default
+spec:
+ description: Example Slack Alert Method
+ slack:
+ url: https://hooks.slack.com/services/321/123/secret
diff --git a/manifest/v1alpha/alertmethod/examples/teams.yaml b/manifest/v1alpha/alertmethod/examples/teams.yaml
new file mode 100644
index 00000000..fae8ed0c
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/teams.yaml
@@ -0,0 +1,10 @@
+apiVersion: n9/v1alpha
+kind: AlertMethod
+metadata:
+ name: teams
+ displayName: Teams Alert Method
+ project: default
+spec:
+ description: Example Teams Alert Method
+ msteams:
+ url: https://meshmark.webhook.office.com/webhookb2/123@321/IncomingWebhook/123/321
diff --git a/manifest/v1alpha/alertmethod/examples/webhook.yaml b/manifest/v1alpha/alertmethod/examples/webhook.yaml
new file mode 100644
index 00000000..05af9674
--- /dev/null
+++ b/manifest/v1alpha/alertmethod/examples/webhook.yaml
@@ -0,0 +1,65 @@
+# Webhook Alert Method with template
+- apiVersion: n9/v1alpha
+ kind: AlertMethod
+ metadata:
+ name: webhook
+ displayName: Webhook Alert Method
+ project: default
+ spec:
+ description: Example Webhook Alert Method
+ webhook:
+ url: https://123.execute-api.eu-central-1.amazonaws.com/default/putReq2S3
+ template: |-
+ {
+ "message": "Your SLO $slo_name needs attention!",
+ "timestamp": "$timestamp",
+ "severity": "$severity",
+ "slo": "$slo_name",
+ "project": "$project_name",
+ "organization": "$organization",
+ "alert_policy": "$alert_policy_name",
+ "alerting_conditions": $alert_policy_conditions[],
+ "service": "$service_name",
+ "labels": {
+ "slo": "$slo_labels_text",
+ "service": "$service_labels_text",
+ "alert_policy": "$alert_policy_labels_text"
+ }
+ }
+ headers:
+ - name: Authorization
+ value: very-secret
+ isSecret: true
+ - name: X-User-Data
+ value: "{\"data\":\"is here\"}"
+ isSecret: false
+# Webhook Alert Method with templateFields
+- apiVersion: n9/v1alpha
+ kind: AlertMethod
+ metadata:
+ name: webhook
+ displayName: Webhook Alert Method
+ project: default
+ spec:
+ description: Example Webhook Alert Method
+ webhook:
+ url: https://123.execute-api.eu-central-1.amazonaws.com/default/putReq2S3
+ templateFields:
+ - project_name
+ - service_name
+ - organization
+ - alert_policy_name
+ - alert_policy_description
+ - alert_policy_conditions[]
+ - alert_policy_conditions_text
+ - severity
+ - slo_name
+ - objective_name
+ - timestamp
+ headers:
+ - name: Authorization
+ value: very-secret
+ isSecret: true
+ - name: X-User-Data
+ value: "{\"data\":\"is here\"}"
+ isSecret: false
diff --git a/manifest/v1alpha/alertpolicy/example.yaml b/manifest/v1alpha/alertpolicy/example.yaml
deleted file mode 100644
index 81cf90c4..00000000
--- a/manifest/v1alpha/alertpolicy/example.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-apiVersion: n9/v1alpha
-kind: AlertPolicy
-metadata:
- name: my-alert-policy
- displayName: My Alert Policy
- project: default
- labels:
- team: [ green, orange ]
- region: [ eu-central-1 ]
-spec:
- description: Example alert policy
- severity: High
- coolDown: "5m"
- conditions:
- - measurement: burnedBudget
- value: 0.80
- alertMethods:
- - metadata:
- name: my-alert-method
- project: my-project
\ No newline at end of file
diff --git a/manifest/v1alpha/alertpolicy/examples/budget-almost-exhausted.yaml b/manifest/v1alpha/alertpolicy/examples/budget-almost-exhausted.yaml
new file mode 100644
index 00000000..b024535d
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/budget-almost-exhausted.yaml
@@ -0,0 +1,36 @@
+apiVersion: n9/v1alpha
+kind: AlertPolicy
+metadata:
+ name: budget-almost-exhausted
+ displayName: Budget almost exhausted (20%)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+spec:
+ description: The error budget is nearly exhausted (20%)
+ severity: Medium
+ coolDown: 5m
+ conditions:
+ - measurement: burnedBudget
+ value: 0.8
+ op: gte
+ alertMethods:
+ - metadata:
+ name: slack
+ project: default
diff --git a/manifest/v1alpha/alertpolicy/examples/budget-drop.yaml b/manifest/v1alpha/alertpolicy/examples/budget-drop.yaml
new file mode 100644
index 00000000..5ef231ab
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/budget-drop.yaml
@@ -0,0 +1,76 @@
+# fast
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: fast-budget-drop
+ displayName: Fast budget drop (10% over 15 min)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The budget dropped by 10% over the last 15 minutes and is not recovering
+ severity: High
+ coolDown: 5m
+ conditions:
+ - measurement: budgetDrop
+ value: 0.1
+ alertingWindow: 15m
+ op: gte
+ alertMethods:
+ - metadata:
+ name: pagerduty
+ project: default
+# slow
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: slow-budget-drop
+ displayName: Slow budget drop (5% over 1h)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The budget dropped by 5% over the last 1 hour and is not recovering
+ severity: Low
+ coolDown: 5m
+ conditions:
+ - measurement: budgetDrop
+ value: 0.05
+ alertingWindow: 1h
+ op: gte
+ alertMethods:
+ - metadata:
+ name: email
+ project: default
diff --git a/manifest/v1alpha/alertpolicy/examples/fast-burn.yaml b/manifest/v1alpha/alertpolicy/examples/fast-burn.yaml
new file mode 100644
index 00000000..3298d7f3
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/fast-burn.yaml
@@ -0,0 +1,37 @@
+apiVersion: n9/v1alpha
+kind: AlertPolicy
+metadata:
+ name: fast-burn
+ displayName: Fast burn (20x5min)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+spec:
+ description: There’s been a significant spike in burn rate over a brief period
+ severity: High
+ coolDown: 5m
+ conditions:
+ - measurement: averageBurnRate
+ value: 20.0
+ alertingWindow: 5m
+ op: gte
+ alertMethods:
+ - metadata:
+ name: pagerduty
+ project: default
diff --git a/manifest/v1alpha/alertpolicy/examples/fast-exhaustion.yaml b/manifest/v1alpha/alertpolicy/examples/fast-exhaustion.yaml
new file mode 100644
index 00000000..181b9e01
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/fast-exhaustion.yaml
@@ -0,0 +1,84 @@
+# above budget
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: fast-exhaustion-above-budget
+ displayName: Fast exhaustion above budget
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The error budget is exhausting significantly and there's still some budget remaining
+ severity: Medium
+ coolDown: 5m
+ conditions:
+ - measurement: timeToBurnBudget
+ value: 72h
+ alertingWindow: 10m
+ op: lt
+ - measurement: burnedBudget
+ value: 1.0
+ lastsFor: 0m
+ op: lt
+ alertMethods:
+ - metadata:
+ name: slack
+ project: default
+# below budget
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: fast-exhaustion-below-budget
+ displayName: Fast exhaustion below budget
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The error budget is exhausting significantly and there's no remaining budget left
+ severity: Medium
+ coolDown: 5m
+ conditions:
+ - measurement: timeToBurnEntireBudget
+ value: 72h
+ alertingWindow: 10m
+ op: lte
+ - measurement: burnedBudget
+ value: 1.0
+ lastsFor: 0m
+ op: gte
+ alertMethods:
+ - metadata:
+ name: slack
+ project: default
diff --git a/manifest/v1alpha/alertpolicy/examples/slow-burn.yaml b/manifest/v1alpha/alertpolicy/examples/slow-burn.yaml
new file mode 100644
index 00000000..74dcaee0
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/slow-burn.yaml
@@ -0,0 +1,84 @@
+# long windows
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: slow-burn
+ displayName: Slow burn (1x2d and 2x15min)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The budget is slowly being exhausted and not recovering
+ severity: Medium
+ coolDown: 5m
+ conditions:
+ - measurement: averageBurnRate
+ value: 1.0
+ alertingWindow: 48h
+ op: gte
+ - measurement: averageBurnRate
+ value: 2.0
+ alertingWindow: 15m
+ op: gte
+ alertMethods:
+ - metadata:
+ name: slack
+ project: default
+# short windows
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: slow-burn
+ displayName: Slow burn (1x12h and 2x15min)
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The budget is slowly being exhausted and not recovering
+ severity: Medium
+ coolDown: 5m
+ conditions:
+ - measurement: averageBurnRate
+ value: 1.0
+ alertingWindow: 12h
+ op: gte
+ - measurement: averageBurnRate
+ value: 2.0
+ alertingWindow: 15m
+ op: gte
+ alertMethods:
+ - metadata:
+ name: slack
+ project: default
diff --git a/manifest/v1alpha/alertpolicy/examples/slow-exhaustion.yaml b/manifest/v1alpha/alertpolicy/examples/slow-exhaustion.yaml
new file mode 100644
index 00000000..36aed891
--- /dev/null
+++ b/manifest/v1alpha/alertpolicy/examples/slow-exhaustion.yaml
@@ -0,0 +1,92 @@
+# long window
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: slow-exhaustion-long-window
+ displayName: Slow exhaustion for long window SLOs
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The error budget is exhausting slowly and not recovering
+ severity: Low
+ coolDown: 5m
+ conditions:
+ - measurement: timeToBurnBudget
+ value: 480h
+ alertingWindow: 48h
+ op: lt
+ - measurement: timeToBurnBudget
+ value: 480h
+ alertingWindow: 15m
+ op: lt
+ - measurement: burnedBudget
+ value: 1.0
+ lastsFor: 0m
+ op: lt
+ alertMethods:
+ - metadata:
+ name: email
+ project: default
+# short window
+- apiVersion: n9/v1alpha
+ kind: AlertPolicy
+ metadata:
+ name: slow-exhaustion-short-window
+ displayName: Slow exhaustion for short window SLOs
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: The error budget is exhausting slowly and not recovering
+ severity: Low
+ coolDown: 5m
+ conditions:
+ - measurement: timeToBurnBudget
+ value: 120h
+ alertingWindow: 12h
+ op: lt
+ - measurement: timeToBurnBudget
+ value: 120h
+ alertingWindow: 15m
+ op: lt
+ - measurement: burnedBudget
+ value: 1.0
+ lastsFor: 0m
+ op: lt
+ alertMethods:
+ - metadata:
+ name: email
+ project: default
diff --git a/manifest/v1alpha/alertsilence/example.yaml b/manifest/v1alpha/alertsilence/example.yaml
deleted file mode 100644
index 1a75569d..00000000
--- a/manifest/v1alpha/alertsilence/example.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: n9/v1alpha
-kind: AlertSilence
-metadata:
- name: 5661613e-0e3d-11ed-861d-random-1
- project: default
-spec:
- description: Example alert silence
- slo: existing-slo
- alertPolicy:
- name: my-alert-policy
- period:
- duration: 1h
\ No newline at end of file
diff --git a/manifest/v1alpha/alertsilence/examples.yaml b/manifest/v1alpha/alertsilence/examples.yaml
new file mode 100644
index 00000000..ae867eee
--- /dev/null
+++ b/manifest/v1alpha/alertsilence/examples.yaml
@@ -0,0 +1,54 @@
+- apiVersion: n9/v1alpha
+ kind: AlertSilence
+ metadata:
+ name: scheduled-maintenance-2024-05-01
+ project: default
+ spec:
+ description: Scheduled maintenance alerts silence
+ slo: api-server-latency
+ alertPolicy:
+ name: fast-burn
+ project: default
+ period:
+ startTime: 2024-05-01T12:00:00Z
+ endTime: 2024-05-01T14:00:00Z
+- apiVersion: n9/v1alpha
+ kind: AlertSilence
+ metadata:
+ name: scheduled-maintenance-2024-05-02
+ project: default
+ spec:
+ description: Scheduled maintenance alerts silence
+ slo: api-server-latency
+ alertPolicy:
+ name: fast-burn
+ project: default
+ period:
+ startTime: 2024-05-02T12:00:00Z
+ duration: 2h
+- apiVersion: n9/v1alpha
+ kind: AlertSilence
+ metadata:
+ name: incident-70
+ project: default
+ spec:
+ description: Alerts silenced for the duration of the active incident 70
+ slo: api-server-latency
+ alertPolicy:
+ name: fast-burn
+ project: default
+ period:
+ duration: 4h
+- apiVersion: n9/v1alpha
+ kind: AlertSilence
+ metadata:
+ name: incident-71
+ project: default
+ spec:
+ description: Alerts silenced until incident 71 is resolved
+ slo: api-server-latency
+ alertPolicy:
+ name: fast-burn
+ project: default
+ period:
+ endTime: 2024-05-01T20:00:00Z
diff --git a/manifest/v1alpha/annotation/example.yaml b/manifest/v1alpha/annotation/example.yaml
deleted file mode 100644
index c1f7e111..00000000
--- a/manifest/v1alpha/annotation/example.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-apiVersion: n9/v1alpha
-kind: Annotation
-metadata:
- name: my-annotation
- project: my-project
-spec:
- slo: existing-slo
- objectiveName: existing-slo-objective-1
- description: Example annotation
- startTime: 2023-05-01T17:10:05Z
- endTime: 2023-05-02T17:10:05Z
diff --git a/manifest/v1alpha/annotation/examples.yaml b/manifest/v1alpha/annotation/examples.yaml
new file mode 100644
index 00000000..ff13dc1a
--- /dev/null
+++ b/manifest/v1alpha/annotation/examples.yaml
@@ -0,0 +1,21 @@
+- apiVersion: n9/v1alpha
+ kind: Annotation
+ metadata:
+ name: good-objective-data-gap
+ project: default
+ spec:
+ slo: api-server-latency
+ objectiveName: good
+ description: Data gap occurred
+ startTime: 2024-05-01T12:00:00Z
+ endTime: 2024-05-04T10:00:00Z
+- apiVersion: n9/v1alpha
+ kind: Annotation
+ metadata:
+ name: deployment-2021-01-01
+ project: default
+ spec:
+ slo: api-server-latency
+ description: Deployment was performed here
+ startTime: 2024-05-16T14:00:00+01:00
+ endTime: 2024-05-16T15:00:00+01:00
diff --git a/manifest/v1alpha/annotation/validation.go b/manifest/v1alpha/annotation/validation.go
index 12542731..98c91a92 100644
--- a/manifest/v1alpha/annotation/validation.go
+++ b/manifest/v1alpha/annotation/validation.go
@@ -13,7 +13,7 @@ func validate(p Annotation) *v1alpha.ObjectError {
return v1alpha.ValidateObject(validator, p, manifest.KindAnnotation)
}
-var validator = validation.New[Annotation](
+var validator = validation.New(
validationV1Alpha.FieldRuleAPIVersion(func(a Annotation) manifest.Version { return a.APIVersion }),
validationV1Alpha.FieldRuleKind(func(a Annotation) manifest.Kind { return a.Kind }, manifest.KindAnnotation),
validation.For(func(p Annotation) Metadata { return p.Metadata }).
@@ -23,7 +23,7 @@ var validator = validation.New[Annotation](
Include(specValidation),
)
-var metadataValidation = validation.New[Metadata](
+var metadataValidation = validation.New(
validationV1Alpha.FieldRuleMetadataName(func(m Metadata) string { return m.Name }),
validation.For(func(m Metadata) string { return m.Project }).
WithName("metadata.project").
@@ -31,7 +31,7 @@ var metadataValidation = validation.New[Metadata](
Rules(validation.StringIsDNSSubdomain()),
)
-var specValidation = validation.New[Spec](
+var specValidation = validation.New(
validation.For(func(s Spec) string { return s.Slo }).
WithName("slo").
Required().
@@ -58,7 +58,6 @@ var endTimeNotBeforeStartTime = validation.NewSingleRule(func(s Spec) error {
Code: errorCodeEndTimeNotBeforeStartTime,
}
}
-
return nil
})
@@ -71,6 +70,5 @@ var categoryUserDefined = validation.NewSingleRule(func(s Spec) error {
Code: errorCodeCategoryUserDefined,
}
}
-
return nil
})
diff --git a/manifest/v1alpha/budgetadjustment/example.yaml b/manifest/v1alpha/budgetadjustment/example.yaml
deleted file mode 100644
index ef1b492d..00000000
--- a/manifest/v1alpha/budgetadjustment/example.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-apiVersion: n9/v1alpha
-kind: BudgetAdjustment
-metadata:
- name: budget-adjustment
- displayName: My budget adjustment
-spec:
- description: Example budget adjustment
- firstEventStart: 2024-02-05T05:00:00Z
- duration: 1h0m0s
- rrule: FREQ=WEEKLY;INTERVAL=1
- filters:
- slos:
- - name: slo-name
- project: default
\ No newline at end of file
diff --git a/manifest/v1alpha/budgetadjustment/examples.yaml b/manifest/v1alpha/budgetadjustment/examples.yaml
new file mode 100644
index 00000000..3e70e760
--- /dev/null
+++ b/manifest/v1alpha/budgetadjustment/examples.yaml
@@ -0,0 +1,18 @@
+apiVersion: n9/v1alpha
+kind: BudgetAdjustment
+metadata:
+ name: monthly-deployment-adjustment
+ displayName: Monthly deployment adjustment
+spec:
+ description: Adjustment for deployment happening monthly on the first Tuesday of each month for 1 hour
+ firstEventStart: 2024-01-01T12:00:00Z
+ duration: 1h
+ rrule: FREQ=MONTHLY;INTERVAL=1;BYDAY=1TU
+ filters:
+ slos:
+ - name: api-server-latency
+ project: default
+ - name: api-server-uptime
+ project: default
+ - name: proxy-throughput
+ project: proxy
diff --git a/manifest/v1alpha/data_sources.go b/manifest/v1alpha/data_sources.go
index 30774d17..517f4cd7 100644
--- a/manifest/v1alpha/data_sources.go
+++ b/manifest/v1alpha/data_sources.go
@@ -64,7 +64,7 @@ type HistoricalDataRetrieval struct {
}
func HistoricalDataRetrievalValidation() validation.Validator[HistoricalDataRetrieval] {
- return validation.New[HistoricalDataRetrieval](
+ return validation.New(
validation.For(validation.GetSelf[HistoricalDataRetrieval]()).
Rules(defaultDataRetrievalDurationValidation),
validation.For(func(h HistoricalDataRetrieval) HistoricalRetrievalDuration { return h.MaxDuration }).
@@ -78,7 +78,7 @@ func HistoricalDataRetrievalValidation() validation.Validator[HistoricalDataRetr
)
}
-var historicalRetrievalDurationValidation = validation.New[HistoricalRetrievalDuration](
+var historicalRetrievalDurationValidation = validation.New(
validation.ForPointer(func(h HistoricalRetrievalDuration) *int { return h.Value }).
WithName("value").
Required().
@@ -129,7 +129,7 @@ var maxQueryDelay = Duration{
}
func QueryDelayValidation() validation.Validator[QueryDelay] {
- return validation.New[QueryDelay](
+ return validation.New(
validation.For(func(q QueryDelay) Duration { return q.Duration }).
Rules(validation.NewSingleRule(func(d Duration) error {
if d.Duration() > maxQueryDelay.Duration() {
diff --git a/manifest/v1alpha/dataexport/example.yaml b/manifest/v1alpha/dataexport/example.yaml
deleted file mode 100644
index eb3af663..00000000
--- a/manifest/v1alpha/dataexport/example.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-apiVersion: n9/v1alpha
-kind: DataExport
-metadata:
- name: s3-data-export
- displayName: S3 data export
- project: default
-spec:
- exportType: S3
- spec:
- bucketName: example-bucket
- roleArn: arn:aws:iam::341861879477:role/n9-access
\ No newline at end of file
diff --git a/manifest/v1alpha/dataexport/examples.yaml b/manifest/v1alpha/dataexport/examples.yaml
new file mode 100644
index 00000000..9f5deb11
--- /dev/null
+++ b/manifest/v1alpha/dataexport/examples.yaml
@@ -0,0 +1,23 @@
+- apiVersion: n9/v1alpha
+ kind: DataExport
+ metadata:
+ name: gcs-export
+ displayName: Data export to Google Cloud Storage bucket
+ project: default
+ spec:
+ exportType: GCS
+ spec:
+ bucketName: prod-data-export-bucket
+ status: null
+- apiVersion: n9/v1alpha
+ kind: DataExport
+ metadata:
+ name: s3-export
+ displayName: Data export to AWS S3 bucket
+ project: default
+ spec:
+ exportType: S3
+ spec:
+ bucketName: data-export-bucket
+ roleArn: arn:aws:iam::123456578901:role/nobl9-access
+ status: null
diff --git a/manifest/v1alpha/direct/example.yaml b/manifest/v1alpha/direct/example.yaml
deleted file mode 100644
index 35aa3de2..00000000
--- a/manifest/v1alpha/direct/example.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: n9/v1alpha
-kind: Direct
-metadata:
- name: datadog
- displayName: My Datadog
- project: default
-spec:
- description: Example Datadog Direct
- datadog:
- site: com
- apiKey: secret
- applicationKey: secret
diff --git a/manifest/v1alpha/direct/examples/app-dynamics.yaml b/manifest/v1alpha/direct/examples/app-dynamics.yaml
new file mode 100644
index 00000000..62a6b329
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/app-dynamics.yaml
@@ -0,0 +1,26 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: app-dynamics
+ displayName: AppDynamics Direct
+ project: default
+spec:
+ description: Example AppDynamics Direct
+ releaseChannel: stable
+ appDynamics:
+ url: https://my-org.saas.appdynamics.com
+ clientID: ""
+ clientName: prod-direct
+ accountName: my-account
+ clientSecret: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/azure-monitor.yaml b/manifest/v1alpha/direct/examples/azure-monitor.yaml
new file mode 100644
index 00000000..81a70f6b
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/azure-monitor.yaml
@@ -0,0 +1,24 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: azure-monitor
+ displayName: Azure Monitor Direct
+ project: default
+spec:
+ description: Example Azure Monitor Direct
+ releaseChannel: stable
+ azureMonitor:
+ tenantId: 5cdecca3-c2c5-4072-89dd-5555faf05202
+ clientId: 70747025-9367-41a5-98f1-59b18b5793c3
+ clientSecret: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/big-query.yaml b/manifest/v1alpha/direct/examples/big-query.yaml
new file mode 100644
index 00000000..27d69a70
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/big-query.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: big-query
+ displayName: BigQuery Direct
+ project: default
+spec:
+ description: Example BigQuery Direct
+ releaseChannel: stable
+ bigQuery:
+ serviceAccountKey: "{\n \"type\": \"service_account\",\n \"project_id\": \"prod-app\",\n \"private_key_id\": \"669180ba44964eddba9e2f6623721381\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nSECRET_KEY_GOES_HERE\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\": \"nobl9@nobl9.iam.gserviceaccount.com\",\n \"client_id\": \"eddba9e2f66237213812\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/nobl9%40nobl9.iam.gserviceaccount.com\"\n}"
+ queryDelay:
+ duration:
+ value: 1
+ unit: Second
diff --git a/manifest/v1alpha/direct/examples/cloud-watch.yaml b/manifest/v1alpha/direct/examples/cloud-watch.yaml
new file mode 100644
index 00000000..ccf7589f
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/cloud-watch.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: cloud-watch
+ displayName: CloudWatch Direct
+ project: default
+spec:
+ description: Example CloudWatch Direct
+ releaseChannel: stable
+ cloudWatch:
+ roleARN: arn:aws:iam::123456578901:role/awsCrossAccountProdCloudwatch-prod-app
+ historicalDataRetrieval:
+ maxDuration:
+ value: 15
+ unit: Day
+ defaultDuration:
+ value: 7
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/datadog.yaml b/manifest/v1alpha/direct/examples/datadog.yaml
new file mode 100644
index 00000000..d5d8d647
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/datadog.yaml
@@ -0,0 +1,24 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: datadog
+ displayName: Datadog Direct
+ project: default
+spec:
+ description: Example Datadog Direct
+ releaseChannel: stable
+ datadog:
+ site: com
+ apiKey: "[secret]"
+ applicationKey: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/dynatrace.yaml b/manifest/v1alpha/direct/examples/dynatrace.yaml
new file mode 100644
index 00000000..52e225b2
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/dynatrace.yaml
@@ -0,0 +1,23 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: dynatrace
+ displayName: Dynatrace Direct
+ project: default
+spec:
+ description: Example Dynatrace Direct
+ releaseChannel: stable
+ dynatrace:
+ url: https://zvf10945.live.dynatrace.com/
+ dynatraceToken: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 28
+ unit: Day
+ defaultDuration:
+ value: 14
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/google-cloud-monitoring.yaml b/manifest/v1alpha/direct/examples/google-cloud-monitoring.yaml
new file mode 100644
index 00000000..80bb9ef6
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/google-cloud-monitoring.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: google-cloud-monitoring
+ displayName: Google Cloud Monitoring Direct
+ project: default
+spec:
+ description: Example Google Cloud Monitoring Direct
+ releaseChannel: stable
+ gcm:
+ serviceAccountKey: "{\n \"type\": \"service_account\",\n \"project_id\": \"prod-app\",\n \"private_key_id\": \"669180ba44964eddba9e2f6623721381\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nSECRET_KEY_GOES_HERE\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\": \"nobl9@nobl9.iam.gserviceaccount.com\",\n \"client_id\": \"eddba9e2f66237213812\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/nobl9%40nobl9.iam.gserviceaccount.com\"\n}"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/honeycomb.yaml b/manifest/v1alpha/direct/examples/honeycomb.yaml
new file mode 100644
index 00000000..8b771c2a
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/honeycomb.yaml
@@ -0,0 +1,22 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: honeycomb
+ displayName: Honeycomb Direct
+ project: default
+spec:
+ description: Example Honeycomb Direct
+ releaseChannel: stable
+ honeycomb:
+ apiKey: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 7
+ unit: Day
+ defaultDuration:
+ value: 3
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/influx-d-b.yaml b/manifest/v1alpha/direct/examples/influx-d-b.yaml
new file mode 100644
index 00000000..932adc5a
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/influx-d-b.yaml
@@ -0,0 +1,17 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: influx-d-b
+ displayName: InfluxDB Direct
+ project: default
+spec:
+ description: Example InfluxDB Direct
+ releaseChannel: stable
+ influxdb:
+ url: https://us-west-2-2.aws.cloud2.influxdata.com
+ apiToken: "[secret]"
+ organizationID: my-org
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/instana.yaml b/manifest/v1alpha/direct/examples/instana.yaml
new file mode 100644
index 00000000..e0c388ee
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/instana.yaml
@@ -0,0 +1,16 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: instana
+ displayName: Instana Direct
+ project: default
+spec:
+ description: Example Instana Direct
+ releaseChannel: stable
+ instana:
+ apiToken: "[secret]"
+ url: https://orange-my-org12.instana.io
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/lightstep.yaml b/manifest/v1alpha/direct/examples/lightstep.yaml
new file mode 100644
index 00000000..1d2a3908
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/lightstep.yaml
@@ -0,0 +1,25 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: lightstep
+ displayName: Lightstep Direct
+ project: default
+spec:
+ description: Example Lightstep Direct
+ releaseChannel: stable
+ lightstep:
+ organization: MyOrg
+ project: prod-app
+ appToken: "[secret]"
+ url: https://api.lightstep.com
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/logic-monitor.yaml b/manifest/v1alpha/direct/examples/logic-monitor.yaml
new file mode 100644
index 00000000..5d1d7d90
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/logic-monitor.yaml
@@ -0,0 +1,17 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: logic-monitor
+ displayName: LogicMonitor Direct
+ project: default
+spec:
+ description: Example LogicMonitor Direct
+ releaseChannel: stable
+ logicMonitor:
+ account: my-account-name
+ accessId: 9xA2BssShK21ld9LoOYu
+ accessKey: "[secret]"
+ queryDelay:
+ duration:
+ value: 3
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/new-relic.yaml b/manifest/v1alpha/direct/examples/new-relic.yaml
new file mode 100644
index 00000000..259de8ca
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/new-relic.yaml
@@ -0,0 +1,23 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: new-relic
+ displayName: New Relic Direct
+ project: default
+spec:
+ description: Example New Relic Direct
+ releaseChannel: stable
+ newRelic:
+ accountId: 1234567
+ insightsQueryKey: NRIQ-2f66237213814496669180ba
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/pingdom.yaml b/manifest/v1alpha/direct/examples/pingdom.yaml
new file mode 100644
index 00000000..99c464e4
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/pingdom.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: pingdom
+ displayName: Pingdom Direct
+ project: default
+spec:
+ description: Example Pingdom Direct
+ releaseChannel: stable
+ pingdom:
+ apiToken: "[secret]"
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/redshift.yaml b/manifest/v1alpha/direct/examples/redshift.yaml
new file mode 100644
index 00000000..c1371e60
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/redshift.yaml
@@ -0,0 +1,18 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: redshift
+ displayName: Redshift Direct
+ project: default
+spec:
+ description: Example Redshift Direct
+ releaseChannel: stable
+ redshift:
+ accessKeyID: AKIA4NPYKXO34R341XUX
+ secretAccessKey: "[secret]"
+ secretARN: arn:aws:secretsmanager:eu-central-1:123456578901:secret:prod-redshift-db-user
+ roleARN: arn:aws:iam::123456578901:role/awsCrossAccountProdRedshift-prod-app
+ queryDelay:
+ duration:
+ value: 31
+ unit: Second
diff --git a/manifest/v1alpha/direct/examples/splunk-observability.yaml b/manifest/v1alpha/direct/examples/splunk-observability.yaml
new file mode 100644
index 00000000..198ecf3d
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/splunk-observability.yaml
@@ -0,0 +1,16 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: splunk-observability
+ displayName: Splunk Observability Direct
+ project: default
+spec:
+ description: Example Splunk Observability Direct
+ releaseChannel: stable
+ splunkObservability:
+ realm: us1
+ accessToken: "[secret]"
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/splunk.yaml b/manifest/v1alpha/direct/examples/splunk.yaml
new file mode 100644
index 00000000..dbf8deee
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/splunk.yaml
@@ -0,0 +1,23 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: splunk
+ displayName: Splunk Direct
+ project: default
+spec:
+ description: Example Splunk Direct
+ releaseChannel: stable
+ splunk:
+ url: https://splunk.my-org.com/services
+ accessToken: "[secret]"
+ historicalDataRetrieval:
+ maxDuration:
+ value: 30
+ unit: Day
+ defaultDuration:
+ value: 15
+ unit: Day
+ queryDelay:
+ duration:
+ value: 6
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/sumo-logic.yaml b/manifest/v1alpha/direct/examples/sumo-logic.yaml
new file mode 100644
index 00000000..a3ea20f7
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/sumo-logic.yaml
@@ -0,0 +1,17 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: sumo-logic
+ displayName: Sumo Logic Direct
+ project: default
+spec:
+ description: Example Sumo Logic Direct
+ releaseChannel: stable
+ sumoLogic:
+ accessID: wzeulXAULylic8
+ accessKey: "[secret]"
+ url: https://service.sumologic.com
+ queryDelay:
+ duration:
+ value: 5
+ unit: Minute
diff --git a/manifest/v1alpha/direct/examples/thousand-eyes.yaml b/manifest/v1alpha/direct/examples/thousand-eyes.yaml
new file mode 100644
index 00000000..b9b5177b
--- /dev/null
+++ b/manifest/v1alpha/direct/examples/thousand-eyes.yaml
@@ -0,0 +1,15 @@
+apiVersion: n9/v1alpha
+kind: Direct
+metadata:
+ name: thousand-eyes
+ displayName: ThousandEyes Direct
+ project: default
+spec:
+ description: Example ThousandEyes Direct
+ releaseChannel: stable
+ thousandEyes:
+ oauthBearerToken: "[secret]"
+ queryDelay:
+ duration:
+ value: 2
+ unit: Minute
diff --git a/manifest/v1alpha/direct/validation.go b/manifest/v1alpha/direct/validation.go
index bd7b770e..f98dab2f 100644
--- a/manifest/v1alpha/direct/validation.go
+++ b/manifest/v1alpha/direct/validation.go
@@ -15,7 +15,7 @@ func validate(d Direct) *v1alpha.ObjectError {
return v1alpha.ValidateObject(validator, d, manifest.KindDirect)
}
-var validator = validation.New[Direct](
+var validator = validation.New(
validationV1Alpha.FieldRuleAPIVersion(func(d Direct) manifest.Version { return d.APIVersion }),
validationV1Alpha.FieldRuleKind(func(d Direct) manifest.Kind { return d.Kind }, manifest.KindDirect),
validationV1Alpha.FieldRuleMetadataName(func(d Direct) string { return d.Metadata.Name }),
@@ -27,7 +27,7 @@ var validator = validation.New[Direct](
Include(specValidation),
)
-var specValidation = validation.New[Spec](
+var specValidation = validation.New(
validation.For(validation.GetSelf[Spec]()).
Cascade(validation.CascadeModeStop).
Rules(exactlyOneDataSourceTypeValidationRule).
@@ -104,13 +104,13 @@ var specValidation = validation.New[Spec](
)
var (
- datadogValidation = validation.New[DatadogConfig](
+ datadogValidation = validation.New(
validation.For(func(d DatadogConfig) string { return d.Site }).
WithName("site").
Required().
Rules(v1alpha.DataDogSiteValidationRule()),
)
- newRelicValidation = validation.New[NewRelicConfig](
+ newRelicValidation = validation.New(
validation.For(func(n NewRelicConfig) int { return n.AccountID }).
WithName("accountId").
Required().
@@ -124,7 +124,7 @@ var (
).
Rules(validation.StringStartsWith("NRIQ-")),
)
- appDynamicsValidation = validation.New[AppDynamicsConfig](
+ appDynamicsValidation = validation.New(
urlPropertyRules(func(a AppDynamicsConfig) string { return a.URL }),
validation.For(func(a AppDynamicsConfig) string { return a.ClientName }).
WithName("clientName").
@@ -133,13 +133,13 @@ var (
WithName("accountName").
Required(),
)
- splunkObservabilityValidation = validation.New[SplunkObservabilityConfig](
+ splunkObservabilityValidation = validation.New(
validation.For(func(s SplunkObservabilityConfig) string { return s.Realm }).
WithName("realm").
Required(),
)
thousandEyesValidation = validation.New[ThousandEyesConfig]()
- bigQueryValidation = validation.New[BigQueryConfig](
+ bigQueryValidation = validation.New(
validation.For(func(b BigQueryConfig) string { return b.ServiceAccountKey }).
WithName("serviceAccountKey").
HideValue().
@@ -149,26 +149,26 @@ var (
).
Rules(validation.StringJSON()),
)
- splunkValidation = validation.New[SplunkConfig](
+ splunkValidation = validation.New(
urlPropertyRules(func(s SplunkConfig) string { return s.URL }),
)
cloudWatchValidation = validation.New[CloudWatchConfig]()
pingdomValidation = validation.New[PingdomConfig]()
- redshiftValidation = validation.New[RedshiftConfig](
+ redshiftValidation = validation.New(
validation.For(func(r RedshiftConfig) string { return r.SecretARN }).
WithName("secretARN").
Required(),
)
- sumoLogicValidation = validation.New[SumoLogicConfig](
+ sumoLogicValidation = validation.New(
urlPropertyRules(func(s SumoLogicConfig) string { return s.URL }),
)
- instanaValidation = validation.New[InstanaConfig](
+ instanaValidation = validation.New(
urlPropertyRules(func(i InstanaConfig) string { return i.URL }),
)
- influxDBValidation = validation.New[InfluxDBConfig](
+ influxDBValidation = validation.New(
urlPropertyRules(func(i InfluxDBConfig) string { return i.URL }),
)
- gcmValidation = validation.New[GCMConfig](
+ gcmValidation = validation.New(
validation.For(func(g GCMConfig) string { return g.ServiceAccountKey }).
WithName("serviceAccountKey").
HideValue().
@@ -178,7 +178,7 @@ var (
).
Rules(validation.StringJSON()),
)
- lightstepValidation = validation.New[LightstepConfig](
+ lightstepValidation = validation.New(
validation.For(func(l LightstepConfig) string { return l.Organization }).
WithName("organization").
Required(),
@@ -190,17 +190,17 @@ var (
OmitEmpty().
Rules(validation.URL()),
)
- dynatraceValidation = validation.New[DynatraceConfig](
+ dynatraceValidation = validation.New(
urlPropertyRules(func(d DynatraceConfig) string { return d.URL }),
)
- azureMonitorValidation = validation.New[AzureMonitorConfig](
+ azureMonitorValidation = validation.New(
validation.For(func(a AzureMonitorConfig) string { return a.TenantID }).
WithName("tenantId").
Required().
Rules(validation.StringUUID()),
)
honeycombValidation = validation.New[HoneycombConfig]()
- logicMonitorValidation = validation.New[LogicMonitorConfig](
+ logicMonitorValidation = validation.New(
validation.For(func(l LogicMonitorConfig) string { return l.Account }).
WithName("account").
Required().
diff --git a/manifest/v1alpha/labels.go b/manifest/v1alpha/labels.go
index 408d2fed..66410068 100644
--- a/manifest/v1alpha/labels.go
+++ b/manifest/v1alpha/labels.go
@@ -27,7 +27,7 @@ var labelsExamples string
var labelKeyRegexp = regexp.MustCompile(`^\p{Ll}([_\-0-9\p{Ll}]*[0-9\p{Ll}])?$`)
func LabelsValidationRules() validation.Validator[Labels] {
- return validation.New[Labels](
+ return validation.New(
validation.ForMap(validation.GetSelf[Labels]()).
RulesForKeys(
validation.StringLength(minLabelKeyLength, maxLabelKeyLength),
@@ -38,7 +38,7 @@ func LabelsValidationRules() validation.Validator[Labels] {
)
}
-var labelValuesValidation = validation.New[[]labelValue](
+var labelValuesValidation = validation.New(
validation.ForSlice(validation.GetSelf[[]labelValue]()).
Rules(validation.SliceUnique(validation.SelfHashFunc[labelValue]())).
RulesForEach(
diff --git a/manifest/v1alpha/labels_examples.yaml b/manifest/v1alpha/labels_examples.yaml
index 0b7ab52f..d5e5ecdc 100644
--- a/manifest/v1alpha/labels_examples.yaml
+++ b/manifest/v1alpha/labels_examples.yaml
@@ -1,12 +1,12 @@
-team:
- - green
- - sales
+area:
+- latency
+- slow-check
env:
- - prod
- - dev
+- prod
+- dev
region:
- - us
- - eu
-area:
- - latency
- - slow-check
\ No newline at end of file
+- us
+- eu
+team:
+- green
+- sales
diff --git a/manifest/v1alpha/metadata_annotations.go b/manifest/v1alpha/metadata_annotations.go
index bc1ad954..899befa6 100644
--- a/manifest/v1alpha/metadata_annotations.go
+++ b/manifest/v1alpha/metadata_annotations.go
@@ -28,7 +28,7 @@ var metadataAnnotationsExamples string
var annotationKeyRegexp = regexp.MustCompile(`^\p{Ll}([_\-0-9\p{Ll}]*[0-9\p{Ll}])?$`)
func MetadataAnnotationsValidationRules() validation.Validator[MetadataAnnotations] {
- return validation.New[MetadataAnnotations](
+ return validation.New(
validation.ForMap(validation.GetSelf[MetadataAnnotations]()).
RulesForKeys(
validation.StringLength(minAnnotationKeyLength, maxAnnotationKeyLength),
@@ -39,7 +39,7 @@ func MetadataAnnotationsValidationRules() validation.Validator[MetadataAnnotatio
)
}
-var annotationValueValidator = validation.New[annotationValue](
+var annotationValueValidator = validation.New(
validation.For(validation.GetSelf[string]()).
Rules(
validation.StringMaxLength(maxAnnotationValueLength),
diff --git a/manifest/v1alpha/metadata_annotations_examples.yaml b/manifest/v1alpha/metadata_annotations_examples.yaml
index 4a873e97..0e3bc64b 100644
--- a/manifest/v1alpha/metadata_annotations_examples.yaml
+++ b/manifest/v1alpha/metadata_annotations_examples.yaml
@@ -1,4 +1,4 @@
-team: sales
+area: latency
env: prod
region: us
-area: latency
\ No newline at end of file
+team: sales
diff --git a/manifest/v1alpha/project/example.yaml b/manifest/v1alpha/project/example.yaml
deleted file mode 100644
index 5e763e65..00000000
--- a/manifest/v1alpha/project/example.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: n9/v1alpha
-kind: Project
-metadata:
- name: my-project
- displayName: My Project
- labels:
- team: [ green, orange ]
- region: [ eu-central-1 ]
-spec:
- description: Example Project
diff --git a/manifest/v1alpha/project/examples.yaml b/manifest/v1alpha/project/examples.yaml
new file mode 100644
index 00000000..542e43c1
--- /dev/null
+++ b/manifest/v1alpha/project/examples.yaml
@@ -0,0 +1,24 @@
+apiVersion: n9/v1alpha
+kind: Project
+metadata:
+ name: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+spec:
+ description: Example Project
diff --git a/manifest/v1alpha/rolebinding/example.yaml b/manifest/v1alpha/rolebinding/example.yaml
deleted file mode 100644
index 9dac1c33..00000000
--- a/manifest/v1alpha/rolebinding/example.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-apiVersion: n9/v1alpha
-kind: RoleBinding
-metadata:
- name: my-binding
-spec:
- projectRef: default
- roleRef: project-editor
- user: some-user-id
diff --git a/manifest/v1alpha/rolebinding/examples.yaml b/manifest/v1alpha/rolebinding/examples.yaml
new file mode 100644
index 00000000..b6418d3c
--- /dev/null
+++ b/manifest/v1alpha/rolebinding/examples.yaml
@@ -0,0 +1,30 @@
+- apiVersion: n9/v1alpha
+ kind: RoleBinding
+ metadata:
+ name: default-project-binding
+ spec:
+ user: 00u2y4e4atkzaYkXP4x8
+ roleRef: project-viewer
+ projectRef: default
+- apiVersion: n9/v1alpha
+ kind: RoleBinding
+ metadata:
+ name: organization-binding-john-admin
+ spec:
+ user: 00u2y4e4atkzaYkXP4x8
+ roleRef: organization-admin
+- apiVersion: n9/v1alpha
+ kind: RoleBinding
+ metadata:
+ name: group-binding-admin
+ spec:
+ groupRef: group-Q72HorLyjjCc
+ roleRef: organization-admin
+- apiVersion: n9/v1alpha
+ kind: RoleBinding
+ metadata:
+ name: default-group-project-binding
+ spec:
+ groupRef: group-Q72HorLyjjCc
+ roleRef: project-viewer
+ projectRef: default
diff --git a/manifest/v1alpha/service/example.yaml b/manifest/v1alpha/service/example.yaml
deleted file mode 100644
index b76d02d9..00000000
--- a/manifest/v1alpha/service/example.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-apiVersion: n9/v1alpha
-kind: Service
-metadata:
- name: my-service
- displayName: My Service
- project: default
- labels:
- team: [ green, orange ]
- region: [ eu-central-1 ]
-spec:
- description: Example Service
diff --git a/manifest/v1alpha/service/examples.yaml b/manifest/v1alpha/service/examples.yaml
new file mode 100644
index 00000000..344f9c30
--- /dev/null
+++ b/manifest/v1alpha/service/examples.yaml
@@ -0,0 +1,25 @@
+apiVersion: n9/v1alpha
+kind: Service
+metadata:
+ name: prometheus
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+spec:
+ description: Example Service
diff --git a/manifest/v1alpha/slo/example.yaml b/manifest/v1alpha/slo/example.yaml
deleted file mode 100644
index bef05a2e..00000000
--- a/manifest/v1alpha/slo/example.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-apiVersion: n9/v1alpha
-kind: SLO
-metadata:
- name: my-slo
- displayName: My SLO
- project: default
- labels:
- team: [ green, orange ]
- region: [ eu-central-1 ]
-spec:
- description: Counts ratio between good and total number of http requests
- alertPolicies: [ ]
- attachments:
- - displayName: Grafana dashboard
- url: https://loki.my-org.dev/grafana/d/nd3S__Knz/pod-restarts?orgId=1&from=now-6h&to=now&viewPanel=6
- budgetingMethod: Occurrences
- indicator:
- metricSource:
- kind: Agent
- name: prometheus
- project: default
- objectives:
- - countMetrics:
- good:
- prometheus:
- promql: sum(rate(prometheus_http_requests_total{code=~"^2.*"}[1h]))
- incremental: false
- total:
- prometheus:
- promql: sum(rate(prometheus_http_requests_total[1h]))
- name: good
- displayName: Good
- target: 0.9
- value: 1
- service: prometheus
- timeWindows:
- - count: 1
- isRolling: true
- unit: Day
diff --git a/manifest/v1alpha/slo/examples/amazon-prometheus.yaml b/manifest/v1alpha/slo/examples/amazon-prometheus.yaml
new file mode 100644
index 00000000..ad5f876d
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/amazon-prometheus.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ amazonPrometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ amazonPrometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ amazonPrometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ amazonPrometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Amazon Prometheus SLO
+ indicator:
+ metricSource:
+ name: amazon-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ amazonPrometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/app-dynamics.yaml b/manifest/v1alpha/slo/examples/app-dynamics.yaml
new file mode 100644
index 00000000..317fdda1
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/app-dynamics.yaml
@@ -0,0 +1,800 @@
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Slow Requests
+ total:
+ appDynamics:
+ applicationName: api-server
+ metricPath: End User Experience|App|Normal Requests
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ appDynamics:
+ applicationName: api-server
+ metricPath: Overall Application Performance|Average Response Time (ms)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ appDynamics:
+ applicationName: api-server
+ metricPath: Overall Application Performance|Average Response Time (ms)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ appDynamics:
+ applicationName: api-server
+ metricPath: Overall Application Performance|Average Response Time (ms)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example AppDynamics SLO
+ indicator:
+ metricSource:
+ name: app-dynamics
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ appDynamics:
+ applicationName: api-server
+ metricPath: Overall Application Performance|Average Response Time (ms)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/azure-monitor.yaml b/manifest/v1alpha/slo/examples/azure-monitor.yaml
new file mode 100644
index 00000000..6c08a7bc
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/azure-monitor.yaml
@@ -0,0 +1,1836 @@
+# Metric type: bad over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode == 0 or ResultCode >= 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode == 0 or ResultCode >= 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode == 0 or ResultCode >= 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode == 0 or ResultCode >= 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http4xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http4xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http4xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http4xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode >= 200 and ResultCode < 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode >= 200 and ResultCode < 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode >= 200 and ResultCode < 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | where ResultCode >= 200 and ResultCode < 400
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ total:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "my-app"
+ | summarize n9_value = count() by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http2xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http2xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http2xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Http2xx
+ aggregation: Sum
+ total:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Requests
+ aggregation: Sum
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "api-server"
+ | summarize n9_value = avg(DurationMs) by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "api-server"
+ | summarize n9_value = avg(DurationMs) by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "api-server"
+ | summarize n9_value = avg(DurationMs) by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: logs
+ workspace:
+ subscriptionId: 00000000-0000-0000-0000-000000000000
+ resourceGroup: myResourceGroup
+ workspaceId: 11111111-1111-1111-1111-111111111111
+ kqlQuery: |-
+ AppRequests
+ | where AppRoleName == "api-server"
+ | summarize n9_value = avg(DurationMs) by bin(TimeGenerated, 15s)
+ | project n9_time = TimeGenerated, n9_value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Percentage CPU
+ aggregation: Avg
+ metricNamespace: azure.applicationinsights
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Percentage CPU
+ aggregation: Avg
+ metricNamespace: azure.applicationinsights
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Percentage CPU
+ aggregation: Avg
+ metricNamespace: azure.applicationinsights
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Monitor SLO
+ indicator:
+ metricSource:
+ name: azure-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azureMonitor:
+ dataType: metrics
+ resourceId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/api-server
+ metricName: Percentage CPU
+ aggregation: Avg
+ metricNamespace: azure.applicationinsights
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/azure-prometheus.yaml b/manifest/v1alpha/slo/examples/azure-prometheus.yaml
new file mode 100644
index 00000000..eb3ee78d
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/azure-prometheus.yaml
@@ -0,0 +1,792 @@
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="5xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="5xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="5xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="5xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="2xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="2xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="2xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{code="2xx"})
+ total:
+ azurePrometheus:
+ promql: sum(api_server_requests_total{})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azurePrometheus:
+ promql: |-
+ sum((rate(container_cpu_usage_seconds_total{container!="POD",container!=""}[30m])
+ - on (namespace,pod,container) group_left avg by (namespace,pod,container)(kube_pod_container_resource_requests{resource="cpu"}))
+ * -1 >0)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ azurePrometheus:
+ promql: |-
+ sum((rate(container_cpu_usage_seconds_total{container!="POD",container!=""}[30m])
+ - on (namespace,pod,container) group_left avg by (namespace,pod,container)(kube_pod_container_resource_requests{resource="cpu"}))
+ * -1 >0)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azurePrometheus:
+ promql: |-
+ sum((rate(container_cpu_usage_seconds_total{container!="POD",container!=""}[30m])
+ - on (namespace,pod,container) group_left avg by (namespace,pod,container)(kube_pod_container_resource_requests{resource="cpu"}))
+ * -1 >0)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Azure Prometheus SLO
+ indicator:
+ metricSource:
+ name: azure-prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ azurePrometheus:
+ promql: |-
+ sum((rate(container_cpu_usage_seconds_total{container!="POD",container!=""}[30m])
+ - on (namespace,pod,container) group_left avg by (namespace,pod,container)(kube_pod_container_resource_requests{resource="cpu"}))
+ * -1 >0)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/big-query.yaml b/manifest/v1alpha/slo/examples/big-query.yaml
new file mode 100644
index 00000000..4cf94912
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/big-query.yaml
@@ -0,0 +1,540 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE http_code = 200 AND created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ total:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE http_code = 200 AND created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ total:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE http_code = 200 AND created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ total:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE http_code = 200 AND created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ total:
+ bigQuery:
+ query: SELECT http_code AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)
+ projectId: api-server-256112
+ location: US
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ bigQuery:
+ query: SELECT response_time AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)`
+ projectId: api-server-256112
+ location: US
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ bigQuery:
+ query: SELECT response_time AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)`
+ projectId: api-server-256112
+ location: US
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ bigQuery:
+ query: SELECT response_time AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)`
+ projectId: api-server-256112
+ location: US
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example BigQuery SLO
+ indicator:
+ metricSource:
+ name: big-query
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ bigQuery:
+ query: SELECT response_time AS n9value, created AS n9date FROM `api-server-256112.metrics.http_response` WHERE created BETWEEN DATETIME(@n9date_from) AND DATETIME(@n9date_to)`
+ projectId: api-server-256112
+ location: US
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/cloud-watch.yaml b/manifest/v1alpha/slo/examples/cloud-watch.yaml
new file mode 100644
index 00000000..c9d3a984
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/cloud-watch.yaml
@@ -0,0 +1,2840 @@
+# Metric type: bad over total
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_5XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_5XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_5XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_5XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487218c2d40b52f4'",
+ "Period": 60
+ }
+ ]
+ total:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e2",
+ "Expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) WHERE InstanceId = 'i-0487518c3d40b12f9'",
+ "Period": 60
+ }
+ ]
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2"
+ total:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT MAX(CPUUtilization) FROM "AWS/EC2"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_2XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_2XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_2XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: HTTPCode_Target_2XX_Count
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ total:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/ApplicationELB
+ metricName: RequestCount
+ stat: SampleCount
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "m1 / m2",
+ "Period": 60
+ },
+ {
+ "Id": "m1",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionEstablishedCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ },
+ {
+ "Id": "m2",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionAttemptCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ }
+ ]
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: JSON
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "m1 / m2",
+ "Period": 60
+ },
+ {
+ "Id": "m1",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionEstablishedCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ },
+ {
+ "Id": "m2",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionAttemptCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ }
+ ]
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "m1 / m2",
+ "Period": 60
+ },
+ {
+ "Id": "m1",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionEstablishedCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ },
+ {
+ "Id": "m2",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionAttemptCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ }
+ ]
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: JSON
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ json: |-
+ [
+ {
+ "Id": "e1",
+ "Expression": "m1 / m2",
+ "Period": 60
+ },
+ {
+ "Id": "m1",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionEstablishedCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ },
+ {
+ "Id": "m2",
+ "MetricStat": {
+ "Metric": {
+ "Namespace": "AWS/NATGateway",
+ "MetricName": "ConnectionAttemptCount",
+ "Dimensions": [
+ {
+ "Name": "NatGatewayId",
+ "Value": "nat-016e2012a5fa8a151"
+ }
+ ]
+ },
+ "Period": 60,
+ "Stat": "SampleCount"
+ },
+ "ReturnData": false
+ }
+ ]
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2”
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: sql query
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2”
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2”
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: sql query
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ sql: SELECT AVG(CPUUtilization) FROM "AWS/EC2”
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/RDS
+ metricName: ReadLatency
+ stat: Average
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: standard configuration
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/RDS
+ metricName: ReadLatency
+ stat: Average
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/RDS
+ metricName: ReadLatency
+ stat: Average
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: standard configuration
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example CloudWatch SLO
+ indicator:
+ metricSource:
+ name: cloud-watch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ cloudWatch:
+ region: us-west-2
+ namespace: AWS/RDS
+ metricName: ReadLatency
+ stat: Average
+ dimensions:
+ - name: LoadBalancer
+ value: app/api-server
+ accountId: "123456789012"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/datadog.yaml b/manifest/v1alpha/slo/examples/datadog.yaml
new file mode 100644
index 00000000..c6914e38
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/datadog.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{http.status_class:2xx}.as_count()
+ total:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{*}.as_count()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{http.status_class:2xx}.as_count()
+ total:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{*}.as_count()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{http.status_class:2xx}.as_count()
+ total:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{*}.as_count()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{http.status_class:2xx}.as_count()
+ total:
+ datadog:
+ query: sum:trace.http.request.hits.by_http_status{*}.as_count()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ datadog:
+ query: avg:trace.http.request.duration{*}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ datadog:
+ query: avg:trace.http.request.duration{*}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ datadog:
+ query: avg:trace.http.request.duration{*}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Datadog SLO
+ indicator:
+ metricSource:
+ name: datadog
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ datadog:
+ query: avg:trace.http.request.duration{*}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/dynatrace.yaml b/manifest/v1alpha/slo/examples/dynatrace.yaml
new file mode 100644
index 00000000..424e9547
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/dynatrace.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:filter(and(or(eq("Status code",SC_2xx)))):splitBy():sort(value(auto,descending)):limit(20)
+ total:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:splitBy():sort(value(auto,descending)):limit(20)
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:filter(and(or(eq("Status code",SC_2xx)))):splitBy():sort(value(auto,descending)):limit(20)
+ total:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:splitBy():sort(value(auto,descending)):limit(20)
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:filter(and(or(eq("Status code",SC_2xx)))):splitBy():sort(value(auto,descending)):limit(20)
+ total:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:splitBy():sort(value(auto,descending)):limit(20)
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:filter(and(or(eq("Status code",SC_2xx)))):splitBy():sort(value(auto,descending)):limit(20)
+ total:
+ dynatrace:
+ metricSelector: builtin:synthetic.http.request.statusCode:splitBy():sort(value(auto,descending)):limit(20)
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ dynatrace:
+ metricSelector: builtin:service.response.server:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.equals(~"APIServer~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending)):limit(100)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ dynatrace:
+ metricSelector: builtin:service.response.server:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.equals(~"APIServer~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending)):limit(100)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ dynatrace:
+ metricSelector: builtin:service.response.server:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.equals(~"APIServer~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending)):limit(100)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Dynatrace SLO
+ indicator:
+ metricSource:
+ name: dynatrace
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ dynatrace:
+ metricSelector: builtin:service.response.server:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.equals(~"APIServer~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending)):limit(100)
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/elasticsearch.yaml b/manifest/v1alpha/slo/examples/elasticsearch.yaml
new file mode 100644
index 00000000..a6fd28d4
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/elasticsearch.yaml
@@ -0,0 +1,1100 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ "
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ total:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}"
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ "
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ total:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}"
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ "
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ total:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}"
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ "
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ total:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}"
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "value_count": {
+ "field": "transaction.result"
+ }
+ }
+ }
+ }
+ }
+ }
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "avg": {
+ "field": "transaction.duration.us"
+ }
+ }
+ }
+ }
+ }
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "avg": {
+ "field": "transaction.duration.us"
+ }
+ }
+ }
+ }
+ }
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "avg": {
+ "field": "transaction.duration.us"
+ }
+ }
+ }
+ }
+ }
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Elasticsearch SLO
+ indicator:
+ metricSource:
+ name: elasticsearch
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ elasticsearch:
+ index: apm-7.13.3-transaction
+ query: |-
+ {
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "service.name": "api-server"
+ }
+ },
+ {
+ "match": {
+ "transaction.result": "HTTP 2xx"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "{{.BeginTime}}",
+ "lte": "{{.EndTime}}"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "size": 0,
+ "aggs": {
+ "resolution": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "{{.Resolution}}",
+ "min_doc_count": 0,
+ "extended_bounds": {
+ "min": "{{.BeginTime}}",
+ "max": "{{.EndTime}}"
+ }
+ },
+ "aggs": {
+ "n9-val": {
+ "avg": {
+ "field": "transaction.duration.us"
+ }
+ }
+ }
+ }
+ }
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/generic.yaml b/manifest/v1alpha/slo/examples/generic.yaml
new file mode 100644
index 00000000..93611ac6
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/generic.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.good\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ total:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.total\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.good\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ total:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.total\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.good\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ total:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.total\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.good\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ total:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.requests.total\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.cpu.utilization\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.cpu.utilization\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.cpu.utilization\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Generic SLO
+ indicator:
+ metricSource:
+ name: generic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ generic:
+ query: "SINCE N9FROM UNTIL N9TO FROM a1: entities(aws:postgresql:123) FETCH a1.metrics(\"infra:database.cpu.utilization\", \"aws-cloudwatch\"){timestamp, value} LIMITS metrics.granularityDuration(PT1M)"
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/google-cloud-monitoring.yaml b/manifest/v1alpha/slo/examples/google-cloud-monitoring.yaml
new file mode 100644
index 00000000..72f6f96a
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/google-cloud-monitoring.yaml
@@ -0,0 +1,624 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ && (metric.response_code == '200')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ total:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ && (metric.response_code == '200')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ total:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ && (metric.response_code == '200')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ total:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ && (metric.response_code == '200')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ total:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_count'
+ | filter
+ (resource.service == 'monitoring.googleapis.com')
+ | align rate(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_count_aggregate: aggregate(value.request_count)]
+ projectId: my-project-id
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_latencies'
+ | filter (resource.service == 'monitoring.googleapis.com')
+ | align delta(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_latencies_mean: mean(value.request_latencies)]
+ projectId: my-project-id
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_latencies'
+ | filter (resource.service == 'monitoring.googleapis.com')
+ | align delta(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_latencies_mean: mean(value.request_latencies)]
+ projectId: my-project-id
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_latencies'
+ | filter (resource.service == 'monitoring.googleapis.com')
+ | align delta(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_latencies_mean: mean(value.request_latencies)]
+ projectId: my-project-id
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Google Cloud Monitoring SLO
+ indicator:
+ metricSource:
+ name: google-cloud-monitoring
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ gcm:
+ query: |-
+ fetch api-server
+ | metric 'serviceruntime.googleapis.com/api/request_latencies'
+ | filter (resource.service == 'monitoring.googleapis.com')
+ | align delta(1m)
+ | every 1m
+ | group_by [resource.service],
+ [value_request_latencies_mean: mean(value.request_latencies)]
+ projectId: my-project-id
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/grafana-loki.yaml b/manifest/v1alpha/slo/examples/grafana-loki.yaml
new file mode 100644
index 00000000..d7e91b5a
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/grafana-loki.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code >= 200 and http_status_code < 300)[1m]))
+ total:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code > 0)[1m]))
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code >= 200 and http_status_code < 300)[1m]))
+ total:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code > 0)[1m]))
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code >= 200 and http_status_code < 300)[1m]))
+ total:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code > 0)[1m]))
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code >= 200 and http_status_code < 300)[1m]))
+ total:
+ grafanaLoki:
+ logql: count(count_over_time(({component="api-server"} | json | line_format "{{.log}}" | json | http_status_code > 0)[1m]))
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ grafanaLoki:
+ logql: sum(sum_over_time({topic="cdc"} |= "kafka_consumergroup_lag" | logfmt | line_format "{{.kafka_consumergroup_lag}}" | unwrap kafka_consumergroup_lag [1m]))
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ grafanaLoki:
+ logql: sum(sum_over_time({topic="cdc"} |= "kafka_consumergroup_lag" | logfmt | line_format "{{.kafka_consumergroup_lag}}" | unwrap kafka_consumergroup_lag [1m]))
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ grafanaLoki:
+ logql: sum(sum_over_time({topic="cdc"} |= "kafka_consumergroup_lag" | logfmt | line_format "{{.kafka_consumergroup_lag}}" | unwrap kafka_consumergroup_lag [1m]))
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Grafana Loki SLO
+ indicator:
+ metricSource:
+ name: grafana-loki
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ grafanaLoki:
+ logql: sum(sum_over_time({topic="cdc"} |= "kafka_consumergroup_lag" | logfmt | line_format "{{.kafka_consumergroup_lag}}" | unwrap kafka_consumergroup_lag [1m]))
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/graphite.yaml b/manifest/v1alpha/slo/examples/graphite.yaml
new file mode 100644
index 00000000..2dad962f
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/graphite.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ graphite:
+ metricPath: stats_counts.response.200
+ total:
+ graphite:
+ metricPath: stats_counts.response.all
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ graphite:
+ metricPath: stats_counts.response.200
+ total:
+ graphite:
+ metricPath: stats_counts.response.all
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ graphite:
+ metricPath: stats_counts.response.200
+ total:
+ graphite:
+ metricPath: stats_counts.response.all
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ graphite:
+ metricPath: stats_counts.response.200
+ total:
+ graphite:
+ metricPath: stats_counts.response.all
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ graphite:
+ metricPath: carbon.agents.9b365cce.cpuUsage
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ graphite:
+ metricPath: carbon.agents.9b365cce.cpuUsage
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ graphite:
+ metricPath: carbon.agents.9b365cce.cpuUsage
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Graphite SLO
+ indicator:
+ metricSource:
+ name: graphite
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ graphite:
+ metricPath: carbon.agents.9b365cce.cpuUsage
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/honeycomb.yaml b/manifest/v1alpha/slo/examples/honeycomb.yaml
new file mode 100644
index 00000000..b3602448
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/honeycomb.yaml
@@ -0,0 +1,800 @@
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterBad
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterBad
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterBad
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterBad
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterGood
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterGood
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterGood
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ honeycomb:
+ calculation: SUM
+ attribute: counterGood
+ total:
+ honeycomb:
+ calculation: SUM
+ attribute: counterTotal
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ honeycomb:
+ calculation: AVG
+ attribute: requestsLatency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ honeycomb:
+ calculation: AVG
+ attribute: requestsLatency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ honeycomb:
+ calculation: AVG
+ attribute: requestsLatency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Honeycomb SLO
+ indicator:
+ metricSource:
+ name: honeycomb
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ honeycomb:
+ calculation: AVG
+ attribute: requestsLatency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/influx-d-b.yaml b/manifest/v1alpha/slo/examples/influx-d-b.yaml
new file mode 100644
index 00000000..523a5e6f
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/influx-d-b.yaml
@@ -0,0 +1,576 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ total:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ total:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ total:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ total:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example InfluxDB SLO
+ indicator:
+ metricSource:
+ name: influx-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ influxdb:
+ query: |-
+ from(bucket: "integrations")
+ |> range(start: time(v: params.n9time_start), stop: time(v: params.n9time_stop))
+ |> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
+ |> filter(fn: (r) => r["_measurement"] == "internal_write")
+ |> filter(fn: (r) => r["_field"] == "write_time_ns")
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/instana.yaml b/manifest/v1alpha/slo/examples/instana.yaml
new file mode 100644
index 00000000..ba41c8fe
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/instana.yaml
@@ -0,0 +1,1588 @@
+# Metric type: good over total
+# Metric variant: infrastructure query
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure query
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure query
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure query
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: error_requests_count
+ pluginId: zooKeeper
+ total:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: total_requests_count
+ pluginId: zooKeeper
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: application
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: application
+ application:
+ metricId: calls
+ aggregation: sum
+ groupBy:
+ tag: application.name
+ tagEntity: DESTINATION
+ apiQuery: |
+ {
+ "type": "EXPRESSION",
+ "logicalOperator": "AND",
+ "elements": [
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.cluster.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "n9-dev-tooling-cluster"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.container.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "data-node"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "call.type",
+ "operator": "EQUALS",
+ "entity": "NOT_APPLICABLE",
+ "value": "HTTP"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "endpoint.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "GET /"
+ }
+ ]
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: application
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: application
+ application:
+ metricId: calls
+ aggregation: sum
+ groupBy:
+ tag: application.name
+ tagEntity: DESTINATION
+ apiQuery: |
+ {
+ "type": "EXPRESSION",
+ "logicalOperator": "AND",
+ "elements": [
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.cluster.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "n9-dev-tooling-cluster"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.container.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "data-node"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "call.type",
+ "operator": "EQUALS",
+ "entity": "NOT_APPLICABLE",
+ "value": "HTTP"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "endpoint.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "GET /"
+ }
+ ]
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: application
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: application
+ application:
+ metricId: calls
+ aggregation: sum
+ groupBy:
+ tag: application.name
+ tagEntity: DESTINATION
+ apiQuery: |
+ {
+ "type": "EXPRESSION",
+ "logicalOperator": "AND",
+ "elements": [
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.cluster.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "n9-dev-tooling-cluster"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.container.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "data-node"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "call.type",
+ "operator": "EQUALS",
+ "entity": "NOT_APPLICABLE",
+ "value": "HTTP"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "endpoint.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "GET /"
+ }
+ ]
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: application
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: application
+ application:
+ metricId: calls
+ aggregation: sum
+ groupBy:
+ tag: application.name
+ tagEntity: DESTINATION
+ apiQuery: |
+ {
+ "type": "EXPRESSION",
+ "logicalOperator": "AND",
+ "elements": [
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.cluster.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "n9-dev-tooling-cluster"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "kubernetes.container.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "data-node"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "call.type",
+ "operator": "EQUALS",
+ "entity": "NOT_APPLICABLE",
+ "value": "HTTP"
+ },
+ {
+ "type": "TAG_FILTER",
+ "name": "endpoint.name",
+ "operator": "EQUALS",
+ "entity": "DESTINATION",
+ "value": "GET /"
+ }
+ ]
+ }
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure query
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure query
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure query
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure query
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: query
+ query: entity.selfType:zookeeper AND entity.label:replica.1
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: infrastructure snapshot id
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Instana SLO
+ indicator:
+ metricSource:
+ name: instana
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ instana:
+ metricType: infrastructure
+ infrastructure:
+ metricRetrievalMethod: snapshot
+ snapshotId: 00u2y4e4atkzaYkXP4x8
+ metricId: max_request_latency
+ pluginId: zooKeeper
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/lightstep.yaml b/manifest/v1alpha/slo/examples/lightstep.yaml
new file mode 100644
index 00000000..68a15bf8
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/lightstep.yaml
@@ -0,0 +1,1336 @@
+# Metric type: good over total
+# Metric variant: error
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: good
+ total:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: total
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: error
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: good
+ total:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: total
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: error
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: good
+ total:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: total
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: error
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: good
+ total:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: total
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ total:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], max
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ total:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], max
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ total:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], max
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: false
+ good:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ total:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], max
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: error
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: error_rate
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: error
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: error_rate
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: error
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: error_rate
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: error
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: error_rate
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: latency
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: latency
+ percentile: 95.0
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: latency
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: latency
+ percentile: 95.0
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: latency
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: latency
+ percentile: 95.0
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: latency
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ streamId: DzpxcSRh
+ typeOfData: latency
+ percentile: 95.0
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Lightstep SLO
+ indicator:
+ metricSource:
+ name: lightstep
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ lightstep:
+ typeOfData: metric
+ uql: metric cpu.utilization | rate | group_by [], mean
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/logic-monitor.yaml b/manifest/v1alpha/slo/examples/logic-monitor.yaml
new file mode 100644
index 00000000..91f69426
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/logic-monitor.yaml
@@ -0,0 +1,840 @@
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11437
+ line: CONNECTIONFAILURES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11437
+ line: CONNECTIONFAILURES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11437
+ line: CONNECTIONFAILURES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: bad over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11437
+ line: CONNECTIONFAILURES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11438
+ line: CONNECTIONSUCCESSES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11438
+ line: CONNECTIONSUCCESSES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11438
+ line: CONNECTIONSUCCESSES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11438
+ line: CONNECTIONSUCCESSES
+ total:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 11436
+ line: CONNECTIONSESTABLISHED
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 9978
+ line: TIMEMAX
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 9978
+ line: TIMEMAX
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 9978
+ line: TIMEMAX
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example LogicMonitor SLO
+ indicator:
+ metricSource:
+ name: logic-monitor
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ logicMonitor:
+ queryType: device_metrics
+ deviceDataSourceInstanceId: 933147615
+ graphId: 9978
+ line: TIMEMAX
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/new-relic.yaml b/manifest/v1alpha/slo/examples/new-relic.yaml
new file mode 100644
index 00000000..befe679a
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/new-relic.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES
+ total:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction TIMESERIES
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES
+ total:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction TIMESERIES
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES
+ total:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction TIMESERIES
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES
+ total:
+ newRelic:
+ nrql: SELECT count(*) FROM Transaction TIMESERIES
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ newRelic:
+ nrql: select average(duration) from transaction timeseries
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ newRelic:
+ nrql: select average(duration) from transaction timeseries
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ newRelic:
+ nrql: select average(duration) from transaction timeseries
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example New Relic SLO
+ indicator:
+ metricSource:
+ name: new-relic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ newRelic:
+ nrql: select average(duration) from transaction timeseries
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/open-t-s-d-b.yaml b/manifest/v1alpha/slo/examples/open-t-s-d-b.yaml
new file mode 100644
index 00000000..2c02a0b4
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/open-t-s-d-b.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{code=2xx}
+ total:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{type=http.status_code}
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{code=2xx}
+ total:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{type=http.status_code}
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{code=2xx}
+ total:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{type=http.status_code}
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{code=2xx}
+ total:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-count-zero:http.code{type=http.status_code}
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-avg-zero:transaction.duration{host=host.01}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-avg-zero:transaction.duration{host=host.01}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-avg-zero:transaction.duration{host=host.01}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example OpenTSDB SLO
+ indicator:
+ metricSource:
+ name: open-t-s-d-b
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ opentsdb:
+ query: start={{.BeginTime}}&end={{.EndTime}}&ms=true&m=none:{{.Resolution}}-avg-zero:transaction.duration{host=host.01}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/pingdom.yaml b/manifest/v1alpha/slo/examples/pingdom.yaml
new file mode 100644
index 00000000..878ada5f
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/pingdom.yaml
@@ -0,0 +1,824 @@
+# Metric type: good over total
+# Metric variant: transaction
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: transaction
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: transaction
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: transaction
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: transaction
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: uptime
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up,down
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: uptime
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up,down
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: uptime
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up,down
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: uptime
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ total:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up,down
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: uptime
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: uptime
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: uptime
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: uptime
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Pingdom SLO
+ indicator:
+ metricSource:
+ name: pingdom
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ pingdom:
+ checkId: "1234567"
+ checkType: uptime
+ status: up
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/prometheus.yaml b/manifest/v1alpha/slo/examples/prometheus.yaml
new file mode 100644
index 00000000..fd49e49a
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/prometheus.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ prometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ prometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ prometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ prometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ prometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ prometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ prometheus:
+ promql: sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
+ total:
+ prometheus:
+ promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ prometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ prometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ prometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Prometheus SLO
+ indicator:
+ metricSource:
+ name: prometheus
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ prometheus:
+ promql: api_server_requestMsec{host="*",job="nginx"}
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/redshift.yaml b/manifest/v1alpha/slo/examples/redshift.yaml
new file mode 100644
index 00000000..f6109ea5
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/redshift.yaml
@@ -0,0 +1,552 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE value = '200' AND timestamp BETWEEN :n9date_from AND :n9date_to
+ total:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE value = '200' AND timestamp BETWEEN :n9date_from AND :n9date_to
+ total:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE value = '200' AND timestamp BETWEEN :n9date_from AND :n9date_to
+ total:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE value = '200' AND timestamp BETWEEN :n9date_from AND :n9date_to
+ total:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM http_status_codes WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM sinusoid WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM sinusoid WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM sinusoid WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Redshift SLO
+ indicator:
+ metricSource:
+ name: redshift
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ redshift:
+ region: eu-central-1
+ clusterId: prod-cluster
+ databaseName: db
+ query: SELECT value as n9value, timestamp as n9date FROM sinusoid WHERE timestamp BETWEEN :n9date_from AND :n9date_to
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/splunk-observability.yaml b/manifest/v1alpha/slo/examples/splunk-observability.yaml
new file mode 100644
index 00000000..d53cd959
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/splunk-observability.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').stddev().publish()
+ total:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').stddev().publish()
+ total:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').stddev().publish()
+ total:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').stddev().publish()
+ total:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk Observability SLO
+ indicator:
+ metricSource:
+ name: splunk-observability
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ splunkObservability:
+ program: data('demo.trans.count', filter=filter('api_server'), rollup='rate').mean().publish()
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/splunk.yaml b/manifest/v1alpha/slo/examples/splunk.yaml
new file mode 100644
index 00000000..0ce8ca7d
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/splunk.yaml
@@ -0,0 +1,516 @@
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ total:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ total:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ total:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ total:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog | bucket _time span=1m | stats count as n9value by _time | rename _time as n9time | fields n9time n9value
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats avg(response_time) as n9value by _time | rename _time as n9time | fields n9time n9value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats avg(response_time) as n9value by _time | rename _time as n9time | fields n9time n9value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats avg(response_time) as n9value by _time | rename _time as n9time | fields n9time n9value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Splunk SLO
+ indicator:
+ metricSource:
+ name: splunk
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ splunk:
+ query: index=* source=udp:5072 sourcetype=syslog status<400 | bucket _time span=1m | stats avg(response_time) as n9value by _time | rename _time as n9time | fields n9time n9value
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/sumo-logic.yaml b/manifest/v1alpha/slo/examples/sumo-logic.yaml
new file mode 100644
index 00000000..198fa4be
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/sumo-logic.yaml
@@ -0,0 +1,1172 @@
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | if (log_level matches "error" ,0,1) as log_level_not_error
+ | sum(log_level_not_error) as n9_value by n9_time
+ | sort by n9_time asc
+ total:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | count(*) as n9_value by n9_time
+ | sort by n9_time asc
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | if (log_level matches "error" ,0,1) as log_level_not_error
+ | sum(log_level_not_error) as n9_value by n9_time
+ | sort by n9_time asc
+ total:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | count(*) as n9_value by n9_time
+ | sort by n9_time asc
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | if (log_level matches "error" ,0,1) as log_level_not_error
+ | sum(log_level_not_error) as n9_value by n9_time
+ | sort by n9_time asc
+ total:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | count(*) as n9_value by n9_time
+ | sort by n9_time asc
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | if (log_level matches "error" ,0,1) as log_level_not_error
+ | sum(log_level_not_error) as n9_value by n9_time
+ | sort by n9_time asc
+ total:
+ sumoLogic:
+ type: logs
+ query: |-
+ _collector="app-cluster" _source="logs"
+ | json "log"
+ | timeslice 15s as n9_time
+ | parse "level=* *" as (log_level, tail)
+ | count(*) as n9_value by n9_time
+ | sort by n9_time asc
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Used
+ quantization: 15s
+ rollup: Avg
+ total:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Total
+ quantization: 15s
+ rollup: Avg
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Used
+ quantization: 15s
+ rollup: Avg
+ total:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Total
+ quantization: 15s
+ rollup: Avg
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Used
+ quantization: 15s
+ rollup: Avg
+ total:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Total
+ quantization: 15s
+ rollup: Avg
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: good over total
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 1.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ countMetrics:
+ incremental: true
+ good:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Used
+ quantization: 15s
+ rollup: Avg
+ total:
+ sumoLogic:
+ type: metrics
+ query: metric=Mem_Total
+ quantization: 15s
+ rollup: Avg
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ sumoLogic:
+ type: logs
+ query: |-
+ _sourceCategory=uploads/nginx
+ | timeslice 1m as n9_time
+ | parse "HTTP/1.1" * * " as (status_code, size, tail)
+ | if (status_code matches "20" or status_code matches "30*",1,0) as resp_ok
+ | sum(resp_ok) as n9_value by n9_time
+ | sort by n9_time asc
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ sumoLogic:
+ type: logs
+ query: |-
+ _sourceCategory=uploads/nginx
+ | timeslice 1m as n9_time
+ | parse "HTTP/1.1" * * " as (status_code, size, tail)
+ | if (status_code matches "20" or status_code matches "30*",1,0) as resp_ok
+ | sum(resp_ok) as n9_value by n9_time
+ | sort by n9_time asc
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ sumoLogic:
+ type: logs
+ query: |-
+ _sourceCategory=uploads/nginx
+ | timeslice 1m as n9_time
+ | parse "HTTP/1.1" * * " as (status_code, size, tail)
+ | if (status_code matches "20" or status_code matches "30*",1,0) as resp_ok
+ | sum(resp_ok) as n9_value by n9_time
+ | sort by n9_time asc
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: logs
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ sumoLogic:
+ type: logs
+ query: |-
+ _sourceCategory=uploads/nginx
+ | timeslice 1m as n9_time
+ | parse "HTTP/1.1" * * " as (status_code, size, tail)
+ | if (status_code matches "20" or status_code matches "30*",1,0) as resp_ok
+ | sum(resp_ok) as n9_value by n9_time
+ | sort by n9_time asc
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ sumoLogic:
+ type: metrics
+ query: metric=CPU_Usage
+ quantization: 15s
+ rollup: Avg
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ sumoLogic:
+ type: metrics
+ query: metric=CPU_Usage
+ quantization: 15s
+ rollup: Avg
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ sumoLogic:
+ type: metrics
+ query: metric=CPU_Usage
+ quantization: 15s
+ rollup: Avg
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: metrics
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example Sumo Logic SLO
+ indicator:
+ metricSource:
+ name: sumo-logic
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ sumoLogic:
+ type: metrics
+ query: metric=CPU_Usage
+ quantization: 15s
+ rollup: Avg
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/examples/thousand-eyes.yaml b/manifest/v1alpha/slo/examples/thousand-eyes.yaml
new file mode 100644
index 00000000..c8fa2008
--- /dev/null
+++ b/manifest/v1alpha/slo/examples/thousand-eyes.yaml
@@ -0,0 +1,1820 @@
+# Metric type: threshold
+# Metric variant: DOM load
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-dom-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: DOM load
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-dom-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: DOM load
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-dom-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: DOM load
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-dom-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net latency
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-latency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net latency
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-latency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net latency
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-latency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net latency
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-latency
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net loss
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-loss
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net loss
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-loss
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net loss
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-loss
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: net loss
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: net-loss
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: response time
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-response-time
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: response time
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-response-time
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: response time
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-response-time
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: response time
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-response-time
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server availability
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-availability
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server availability
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-availability
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server availability
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-availability
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server availability
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-availability
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server throughput
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-throughput
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server throughput
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-throughput
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server throughput
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-throughput
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: server throughput
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: http-server-throughput
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: web page load
+# Budgeting method: Occurrences
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-page-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: web page load
+# Budgeting method: Occurrences
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Occurrences
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-page-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: web page load
+# Budgeting method: Timeslices
+# Time window type: Calendar
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-page-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Month
+ count: 1
+ isRolling: false
+ calendar:
+ startTime: 2022-12-01 00:00:00
+ timeZone: UTC
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
+# Metric type: threshold
+# Metric variant: web page load
+# Budgeting method: Timeslices
+# Time window type: Rolling
+- apiVersion: n9/v1alpha
+ kind: SLO
+ metadata:
+ name: api-server-slo
+ displayName: API Server SLO
+ project: default
+ labels:
+ area:
+ - latency
+ - slow-check
+ env:
+ - prod
+ - dev
+ region:
+ - us
+ - eu
+ team:
+ - green
+ - sales
+ annotations:
+ area: latency
+ env: prod
+ region: us
+ team: sales
+ spec:
+ description: Example ThousandEyes SLO
+ indicator:
+ metricSource:
+ name: thousand-eyes
+ project: default
+ kind: Direct
+ budgetingMethod: Timeslices
+ objectives:
+ - displayName: Good response (200)
+ value: 200.0
+ name: ok
+ target: 0.95
+ timeSliceTarget: 0.9
+ rawMetric:
+ query:
+ thousandEyes:
+ testID: 2280492
+ testType: web-page-load
+ op: lte
+ primary: true
+ service: api-server
+ timeWindows:
+ - unit: Hour
+ count: 1
+ isRolling: true
+ alertPolicies:
+ - fast-burn-5x-for-last-10m
+ attachments:
+ - url: https://docs.nobl9.com
+ displayName: Nobl9 Documentation
+ anomalyConfig:
+ noData:
+ alertMethods:
+ - name: slack-notification
+ project: default
diff --git a/manifest/v1alpha/slo/metrics_validation.go b/manifest/v1alpha/slo/metrics_validation.go
index cabbdb03..662d1a2f 100644
--- a/manifest/v1alpha/slo/metrics_validation.go
+++ b/manifest/v1alpha/slo/metrics_validation.go
@@ -184,6 +184,7 @@ var metricSpecValidation = validation.New[MetricSpec](
Include(azurePrometheusValidation),
)
+// When updating this list, make sure you also update the generated examples.
var badOverTotalEnabledSources = []v1alpha.DataSourceType{
v1alpha.CloudWatch,
v1alpha.AppDynamics,
diff --git a/manifest/v1alpha/slo/slo.go b/manifest/v1alpha/slo/slo.go
index 0e47569d..38e340e4 100644
--- a/manifest/v1alpha/slo/slo.go
+++ b/manifest/v1alpha/slo/slo.go
@@ -48,14 +48,18 @@ type Spec struct {
TimeWindows []TimeWindow `json:"timeWindows"`
AlertPolicies []string `json:"alertPolicies"`
Attachments []Attachment `json:"attachments,omitempty"`
- CreatedAt string `json:"createdAt,omitempty"`
- CreatedBy string `json:"createdBy,omitempty"`
+ // CreatedAt is the date of the [SLO] creation in RFC3339 format.
+ // Read-only field.
+ CreatedAt string `json:"createdAt,omitempty"`
+ // CreatedBy is the id of the user who first created the SLO.
+ // Read-only field.
+ CreatedBy string `json:"createdBy,omitempty"`
// Deprecated: this implementation of Composite wil be removed and replaced with new CompositeSpec
Composite *Composite `json:"composite,omitempty"`
AnomalyConfig *AnomalyConfig `json:"anomalyConfig,omitempty"`
}
-// Attachment represents user defined URL attached to SLO
+// Attachment represents user defined URL attached to SLO.
type Attachment struct {
URL string `json:"url"`
DisplayName *string `json:"displayName,omitempty"`
@@ -89,7 +93,8 @@ type Objective struct {
// Composite is not yet supported, applying it will have no effect
Composite *CompositeSpec `json:"composite,omitempty"`
Operator *string `json:"op,omitempty"`
- Primary *bool `json:"primary,omitempty"`
+ // Primary is used to highlight the main (primary) objective of the [SLO].
+ Primary *bool `json:"primary,omitempty"`
}
func (o Objective) GetBudgetTarget() float64 {
diff --git a/manifest/v1alpha/slo/validation.go b/manifest/v1alpha/slo/validation.go
index 1aba1f4e..1ce5b7cf 100644
--- a/manifest/v1alpha/slo/validation.go
+++ b/manifest/v1alpha/slo/validation.go
@@ -23,7 +23,7 @@ func validate(s SLO) *v1alpha.ObjectError {
return v1alpha.ValidateObject(validator, s, manifest.KindSLO)
}
-var validator = validation.New[SLO](
+var validator = validation.New(
validationV1Alpha.FieldRuleAPIVersion(func(s SLO) manifest.Version { return s.APIVersion }),
validationV1Alpha.FieldRuleKind(func(s SLO) manifest.Kind { return s.Kind }, manifest.KindSLO),
validation.For(func(s SLO) SLO { return s }).
@@ -38,7 +38,7 @@ var validator = validation.New[SLO](
Include(specValidation),
)
-var metadataValidation = validation.New[Metadata](
+var metadataValidation = validation.New(
validationV1Alpha.FieldRuleMetadataName(func(m Metadata) string { return m.Name }),
validationV1Alpha.FieldRuleMetadataDisplayName(func(m Metadata) string { return m.DisplayName }),
validationV1Alpha.FieldRuleMetadataProject(func(m Metadata) string { return m.Project }),
@@ -66,7 +66,7 @@ func getCompositeObjectiveComponents(s SLO) []CompositeObjective {
return make([]CompositeObjective, 0)
}
-var sloValidationComposite = validation.New[SLO](
+var sloValidationComposite = validation.New(
validation.For(validation.GetSelf[SLO]()).
Rules(
validation.NewSingleRule(func(s SLO) error {
@@ -118,7 +118,7 @@ var sloValidationComposite = validation.New[SLO](
validation.WhenDescription("at least one composite objective is defined"),
)
-var specValidation = validation.New[Spec](
+var specValidation = validation.New(
validation.For(validation.GetSelf[Spec]()).
Cascade(validation.CascadeModeStop).
Include(specMetricsValidation),
@@ -196,7 +196,7 @@ var specValidation = validation.New[Spec](
),
)
-var attachmentValidation = validation.New[Attachment](
+var attachmentValidation = validation.New(
validation.For(func(a Attachment) string { return a.URL }).
WithName("url").
Required().
@@ -206,14 +206,14 @@ var attachmentValidation = validation.New[Attachment](
Rules(validation.StringLength(0, 63)),
)
-var compositeValidation = validation.New[Composite](
+var compositeValidation = validation.New(
validation.ForPointer(func(c Composite) *float64 { return c.BudgetTarget }).
WithName("target").
Required().
Rules(validation.GreaterThan(0.0), validation.LessThan(1.0)),
validation.ForPointer(func(c Composite) *CompositeBurnRateCondition { return c.BurnRateCondition }).
WithName("burnRateCondition").
- Include(validation.New[CompositeBurnRateCondition](
+ Include(validation.New(
validation.For(func(b CompositeBurnRateCondition) float64 { return b.Value }).
WithName("value").
Rules(validation.GreaterThanOrEqualTo(0.0), validation.LessThanOrEqualTo(1000.0)),
@@ -251,7 +251,7 @@ var specCompositeValidationRule = validation.NewSingleRule(func(s Spec) error {
return nil
})
-var compositeObjectiveRule = validation.New[CompositeObjective](
+var compositeObjectiveRule = validation.New(
validation.For(func(c CompositeObjective) string { return c.Project }).
WithName("project").
Required().
@@ -270,23 +270,23 @@ var compositeObjectiveRule = validation.New[CompositeObjective](
validation.For(func(c CompositeObjective) WhenDelayed { return c.WhenDelayed }).
WithName("whenDelayed").
Required().
- Rules(validation.OneOf[WhenDelayed](
+ Rules(validation.OneOf(
WhenDelayedCountAsGood,
WhenDelayedCountAsBad,
WhenDelayedIgnore,
)),
)
-var anomalyConfigValidation = validation.New[AnomalyConfig](
+var anomalyConfigValidation = validation.New(
validation.ForPointer(func(a AnomalyConfig) *AnomalyConfigNoData { return a.NoData }).
WithName("noData").
- Include(validation.New[AnomalyConfigNoData](
+ Include(validation.New(
validation.ForSlice(func(a AnomalyConfigNoData) []AnomalyConfigAlertMethod { return a.AlertMethods }).
WithName("alertMethods").
Cascade(validation.CascadeModeStop).
Rules(validation.SliceMinLength[[]AnomalyConfigAlertMethod](1)).
Rules(validation.SliceUnique(validation.SelfHashFunc[AnomalyConfigAlertMethod]())).
- IncludeForEach(validation.New[AnomalyConfigAlertMethod](
+ IncludeForEach(validation.New(
validation.For(func(a AnomalyConfigAlertMethod) string { return a.Name }).
WithName("name").
Required().
@@ -298,10 +298,10 @@ var anomalyConfigValidation = validation.New[AnomalyConfig](
)),
)
-var indicatorValidation = validation.New[Indicator](
+var indicatorValidation = validation.New(
validation.For(func(i Indicator) MetricSourceSpec { return i.MetricSource }).
WithName("metricSource").
- Include(validation.New[MetricSourceSpec](
+ Include(validation.New(
validation.For(func(m MetricSourceSpec) string { return m.Name }).
WithName("name").
Required().
@@ -320,7 +320,7 @@ var indicatorValidation = validation.New[Indicator](
Include(metricSpecValidation),
)
-var objectiveValidation = validation.New[Objective](
+var objectiveValidation = validation.New(
validation.For(validation.GetSelf[Objective]()).
Include(rawMetricObjectiveValidation),
validation.For(func(o Objective) ObjectiveBase { return o.ObjectiveBase }).
@@ -340,7 +340,7 @@ var objectiveValidation = validation.New[Objective](
Include(rawMetricsValidation),
)
-var rawMetricObjectiveValidation = validation.New[Objective](
+var rawMetricObjectiveValidation = validation.New(
validation.ForPointer(func(o Objective) *float64 { return o.ObjectiveBase.Value }).
WithName("value").
Required(),
@@ -354,7 +354,7 @@ var rawMetricObjectiveValidation = validation.New[Objective](
validation.WhenDescription("rawMetric is defined"),
)
-var objectiveBaseValidation = validation.New[ObjectiveBase](
+var objectiveBaseValidation = validation.New(
validation.For(func(o ObjectiveBase) string { return o.Name }).
WithName("name").
OmitEmpty().
@@ -372,7 +372,7 @@ func arePointerValuesEqual[T comparable](p1, p2 *T) bool {
return *p1 == *p2
}
-var specValidationNonComposite = validation.New[Spec](
+var specValidationNonComposite = validation.New(
validation.ForPointer(func(s Spec) *Indicator { return s.Indicator }).
WithName("indicator").
Required().
@@ -382,7 +382,7 @@ var specValidationNonComposite = validation.New[Spec](
validation.WhenDescription("none of the objectives is of composite type"),
)
-var specValidationComposite = validation.New[Spec](
+var specValidationComposite = validation.New(
validation.ForPointer(func(s Spec) *Indicator { return s.Indicator }).
WithName("indicator").
Rules(
@@ -401,12 +401,12 @@ var specValidationComposite = validation.New[Spec](
WithName("objectives").
Rules(validation.SliceLength[[]Objective](1, 1).
WithMessage("this SLO contains a composite objective. No more objectives can be added to it")).
- IncludeForEach(validation.New[Objective](
+ IncludeForEach(validation.New(
validation.For(func(o Objective) ObjectiveBase { return o.ObjectiveBase }).
Include(objectiveBaseValidation),
validation.ForPointer(func(o Objective) *CompositeSpec { return o.Composite }).
WithName("composite").
- Include(validation.New[CompositeSpec](
+ Include(validation.New(
validation.For(func(c CompositeSpec) string { return c.MaxDelay }).
WithName("maxDelay").
Required(),
diff --git a/manifest/v1alpha/usergroup/example.yaml b/manifest/v1alpha/usergroup/examples.yaml
similarity index 100%
rename from manifest/v1alpha/usergroup/example.yaml
rename to manifest/v1alpha/usergroup/examples.yaml
diff --git a/manifest/version.go b/manifest/version.go
index 3659ccdc..11dba139 100644
--- a/manifest/version.go
+++ b/manifest/version.go
@@ -1,7 +1,15 @@
package manifest
+import "strings"
+
//go:generate ../bin/go-enum --names --values --marshal
// Version represents the specific version of the manifest.
// ENUM(v1alpha = n9/v1alpha)
type Version string
+
+// VersionString returns the second element of the Version.
+// For example, given "n9/v1alpha", it returns "v1alpha".
+func (v Version) VersionString() string {
+ return strings.TrimPrefix(v.String(), "n9/")
+}
From 75d84726e7cc1ef69c5b6f5a25e71766857185ea Mon Sep 17 00:00:00 2001
From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com>
Date: Mon, 8 Jul 2024 12:18:22 +0200
Subject: [PATCH 09/13] chore: Add Alert Method e2e tests (#481)
Extends end-to-end tests with `v1alpha.AlertMethod` coverage.
It utilizes generated examples to easily test application of different
Alert Method variants.
---
manifest/object.go | 3 +-
tests/examples_test.go | 76 +++++++++++++++++
tests/helpers_test.go | 31 ++++---
tests/v1alpha_alertmethod_test.go | 130 ++++++++++++++++++++++++++++++
tests/v1alpha_project_test.go | 47 ++++++-----
tests/v1alpha_service_test.go | 61 ++++++++------
6 files changed, 286 insertions(+), 62 deletions(-)
create mode 100644 tests/examples_test.go
create mode 100644 tests/v1alpha_alertmethod_test.go
diff --git a/manifest/object.go b/manifest/object.go
index 04c8a156..10cf96ce 100644
--- a/manifest/object.go
+++ b/manifest/object.go
@@ -42,8 +42,7 @@ type ProjectScopedObject interface {
func FilterByKind[T Object](objects []Object) []T {
var filtered []T
for i := range objects {
- v, ok := objects[i].(T)
- if ok {
+ if v, ok := objects[i].(T); ok {
filtered = append(filtered, v)
}
}
diff --git a/tests/examples_test.go b/tests/examples_test.go
new file mode 100644
index 00000000..afd01793
--- /dev/null
+++ b/tests/examples_test.go
@@ -0,0 +1,76 @@
+//go:build e2e_test
+
+package tests
+
+import (
+ "encoding/json"
+ "log"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ v1alphaExamples "github.com/nobl9/nobl9-go/internal/manifest/v1alpha/examples"
+ "github.com/nobl9/nobl9-go/manifest"
+)
+
+type exampleWrapper struct {
+ v1alphaExamples.Example
+ rawObject []byte
+}
+
+var examplesRegistry = func() map[manifest.Kind][]exampleWrapper {
+ kindToExamples := map[manifest.Kind][]v1alphaExamples.Example{
+ manifest.KindProject: v1alphaExamples.Project(),
+ manifest.KindService: v1alphaExamples.Service(),
+ manifest.KindAlertMethod: v1alphaExamples.AlertMethod(),
+ manifest.KindSLO: v1alphaExamples.SLO(),
+ manifest.KindAgent: v1alphaExamples.Agent(),
+ manifest.KindDirect: v1alphaExamples.Direct(),
+ manifest.KindAlertPolicy: v1alphaExamples.AlertPolicy(),
+ manifest.KindAlertSilence: v1alphaExamples.AlertSilence(),
+ manifest.KindAnnotation: v1alphaExamples.Annotation(),
+ manifest.KindBudgetAdjustment: v1alphaExamples.BudgetAdjustment(),
+ manifest.KindDataExport: v1alphaExamples.DataExport(),
+ manifest.KindRoleBinding: v1alphaExamples.RoleBinding(),
+ }
+ wrapped := make(map[manifest.Kind][]exampleWrapper, len(kindToExamples))
+ for kind, examples := range kindToExamples {
+ wrapped[kind] = make([]exampleWrapper, 0, len(examples))
+ for _, example := range examples {
+ object := example.GetObject()
+ rawObject, err := json.Marshal(object)
+ if err != nil {
+ log.Panicf("failed to marshal example %T object: %v", object, err)
+ }
+ wrapped[kind] = append(wrapped[kind], exampleWrapper{
+ Example: example,
+ rawObject: rawObject,
+ })
+ }
+ }
+ return wrapped
+}()
+
+func getExample[T any](t *testing.T, kind manifest.Kind, variant, subVariant string) *T {
+ t.Helper()
+ examples, ok := examplesRegistry[kind]
+ if !ok {
+ require.True(t, ok, "%s kind not found in registry", kind)
+ }
+ decode := func(rawObject []byte) *T {
+ var object T
+ if err := json.Unmarshal(rawObject, &object); err != nil {
+ log.Panicf("failed to unmarshal example %T object: %v", object, err)
+ }
+ return &object
+ }
+ if variant == "" && subVariant == "" {
+ return decode(examples[0].rawObject)
+ }
+ for _, example := range examples {
+ if example.GetVariant() == variant && (subVariant == "" || example.GetSubVariant() == subVariant) {
+ return decode(example.rawObject)
+ }
+ }
+ return nil
+}
diff --git a/tests/helpers_test.go b/tests/helpers_test.go
index a6edcf00..9d33495e 100644
--- a/tests/helpers_test.go
+++ b/tests/helpers_test.go
@@ -4,6 +4,7 @@ package tests
import (
"context"
+ "encoding/json"
"fmt"
"regexp"
"strconv"
@@ -15,7 +16,6 @@ import (
"github.com/nobl9/nobl9-go/manifest"
"github.com/nobl9/nobl9-go/manifest/v1alpha"
- v1alphaProject "github.com/nobl9/nobl9-go/manifest/v1alpha/project"
)
const objectDescription = "Object generated by e2e SDK tests"
@@ -52,7 +52,7 @@ func assertSubset[T manifest.Object](t *testing.T, actual, expected []T, f objec
}
}
if !found {
- t.Errorf("expected object %s not found in the actual list", expected[i].GetName())
+ t.Errorf("expected %T %s not found in the actual list", expected[i], expected[i].GetName())
}
}
}
@@ -77,20 +77,6 @@ func v1Delete[T manifest.Object](t *testing.T, ctx context.Context, inputs []T)
require.NoError(t, err)
}
-func generateV1alphaProject(t *testing.T) v1alphaProject.Project {
- t.Helper()
- return v1alphaProject.New(
- v1alphaProject.Metadata{
- Name: generateName(),
- Labels: annotateLabels(t, v1alpha.Labels{}),
- Annotations: commonAnnotations,
- },
- v1alphaProject.Spec{
- Description: objectDescription,
- },
- )
-}
-
// generateName generates a unique name for the test object.
func generateName() string {
return fmt.Sprintf("sdk-e2e-%d-%d", objectsCounter.Add(1), testStartTime.UnixNano())
@@ -101,8 +87,21 @@ func generateName() string {
// It also adds unique test identifier label to the provided labels so that we can reliably retrieve objects created withing a given test without .
func annotateLabels(t *testing.T, labels v1alpha.Labels) v1alpha.Labels {
t.Helper()
+ if labels == nil {
+ labels = make(v1alpha.Labels, 3)
+ }
labels["origin"] = []string{"sdk-e2e-test"}
labels[uniqueTestIdentifierLabel.Key] = []string{uniqueTestIdentifierLabel.Value}
labels["sdk-test-name"] = []string{t.Name()}
return labels
}
+
+// deepCopyObject creates a deep copy of the provided object using JSON encoding and decoding.
+func deepCopyObject[T any](t *testing.T, object T) T {
+ t.Helper()
+ data, err := json.Marshal(object)
+ require.NoError(t, err)
+ var copied T
+ require.NoError(t, json.Unmarshal(data, &copied))
+ return copied
+}
diff --git a/tests/v1alpha_alertmethod_test.go b/tests/v1alpha_alertmethod_test.go
new file mode 100644
index 00000000..d2e79e9d
--- /dev/null
+++ b/tests/v1alpha_alertmethod_test.go
@@ -0,0 +1,130 @@
+//go:build e2e_test
+
+package tests
+
+import (
+ "context"
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAlertMethod "github.com/nobl9/nobl9-go/manifest/v1alpha/alertmethod"
+ "github.com/nobl9/nobl9-go/sdk"
+ objectsV1 "github.com/nobl9/nobl9-go/sdk/endpoints/objects/v1"
+)
+
+func Test_Objects_V1_V1alpha_AlertMethod(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+ project := generateV1alphaProject(t)
+ alertMethodTypes := v1alpha.AlertMethodTypeValues()
+ allObjects := make([]manifest.Object, 0, len(alertMethodTypes)+1)
+ allObjects = append(allObjects, project)
+
+ for i, typ := range v1alpha.AlertMethodTypeValues() {
+ method := newV1alphaAlertMethod(t,
+ typ,
+ v1alphaAlertMethod.Metadata{
+ Name: generateName(),
+ DisplayName: fmt.Sprintf("Alert Method %d", i),
+ Project: project.GetName(),
+ },
+ )
+ if i == 0 {
+ method.Metadata.Project = defaultProject
+ }
+ allObjects = append(allObjects, method)
+ }
+
+ v1Apply(t, ctx, allObjects)
+ t.Cleanup(func() { v1Delete(t, ctx, allObjects) })
+ inputs := manifest.FilterByKind[v1alphaAlertMethod.AlertMethod](allObjects)
+
+ filterTests := map[string]struct {
+ request objectsV1.GetAlertMethodsRequest
+ expected []v1alphaAlertMethod.AlertMethod
+ returnsAll bool
+ }{
+ "all": {
+ request: objectsV1.GetAlertMethodsRequest{Project: sdk.ProjectsWildcard},
+ expected: manifest.FilterByKind[v1alphaAlertMethod.AlertMethod](allObjects),
+ returnsAll: true,
+ },
+ "default project": {
+ request: objectsV1.GetAlertMethodsRequest{},
+ expected: []v1alphaAlertMethod.AlertMethod{inputs[0]},
+ returnsAll: true,
+ },
+ "filter by project": {
+ request: objectsV1.GetAlertMethodsRequest{
+ Project: project.GetName(),
+ },
+ expected: inputs[1:],
+ },
+ "filter by name": {
+ request: objectsV1.GetAlertMethodsRequest{
+ Project: project.GetName(),
+ Names: []string{inputs[3].Metadata.Name},
+ },
+ expected: []v1alphaAlertMethod.AlertMethod{inputs[3]},
+ },
+ }
+ for name, test := range filterTests {
+ t.Run(name, func(t *testing.T) {
+ t.Parallel()
+ actual, err := client.Objects().V1().GetV1alphaAlertMethods(ctx, test.request)
+ require.NoError(t, err)
+ if !test.returnsAll {
+ require.Len(t, actual, len(test.expected))
+ }
+ assertSubset(t, actual, test.expected, assertV1alphaAlertMethodsAreEqual)
+ })
+ }
+}
+
+func newV1alphaAlertMethod(
+ t *testing.T,
+ typ v1alpha.AlertMethodType,
+ metadata v1alphaAlertMethod.Metadata,
+) v1alphaAlertMethod.AlertMethod {
+ t.Helper()
+ variant := getExample[v1alphaAlertMethod.AlertMethod](t, manifest.KindAlertMethod, typ.String(), "")
+ variant.Spec.Description = objectDescription
+ return v1alphaAlertMethod.New(metadata, variant.Spec)
+}
+
+func assertV1alphaAlertMethodsAreEqual(t *testing.T, expected, actual v1alphaAlertMethod.AlertMethod) {
+ t.Helper()
+ expected = deepCopyObject(t, expected)
+ actual.Status = nil
+ typ, err := expected.Spec.GetType()
+ require.NoError(t, err)
+ switch typ {
+ case v1alpha.AlertMethodTypeDiscord:
+ expected.Spec.Discord.URL = "[hidden]"
+ case v1alpha.AlertMethodTypeJira:
+ expected.Spec.Jira.APIToken = "[hidden]"
+ case v1alpha.AlertMethodTypeOpsgenie:
+ expected.Spec.Opsgenie.Auth = "[hidden]"
+ case v1alpha.AlertMethodTypePagerDuty:
+ expected.Spec.PagerDuty.IntegrationKey = "[hidden]"
+ case v1alpha.AlertMethodTypeServiceNow:
+ expected.Spec.ServiceNow.Password = "[hidden]"
+ case v1alpha.AlertMethodTypeSlack:
+ expected.Spec.Slack.URL = "[hidden]"
+ case v1alpha.AlertMethodTypeTeams:
+ expected.Spec.Teams.URL = "[hidden]"
+ case v1alpha.AlertMethodTypeWebhook:
+ expected.Spec.Webhook.URL = "[hidden]"
+ for i, header := range expected.Spec.Webhook.Headers {
+ if header.IsSecret {
+ expected.Spec.Webhook.Headers[i].Value = "[hidden]"
+ }
+ }
+ }
+ assert.Equal(t, expected, actual)
+}
diff --git a/tests/v1alpha_project_test.go b/tests/v1alpha_project_test.go
index 2735be7d..f6d384d5 100644
--- a/tests/v1alpha_project_test.go
+++ b/tests/v1alpha_project_test.go
@@ -18,34 +18,25 @@ func Test_Objects_V1_V1alpha_Project(t *testing.T) {
t.Parallel()
ctx := context.Background()
inputs := []v1alphaProject.Project{
- v1alphaProject.New(
+ newV1alphaProject(t,
v1alphaProject.Metadata{
Name: generateName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"green"}}),
- Annotations: commonAnnotations,
- },
- v1alphaProject.Spec{
- Description: objectDescription,
+ DisplayName: "Project 1",
+ Labels: v1alpha.Labels{"team": []string{"green"}},
},
),
- v1alphaProject.New(
+ newV1alphaProject(t,
v1alphaProject.Metadata{
Name: generateName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
- Annotations: commonAnnotations,
- },
- v1alphaProject.Spec{
- Description: objectDescription,
+ DisplayName: "Project 2",
+ Labels: v1alpha.Labels{"team": []string{"orange"}},
},
),
- v1alphaProject.New(
+ newV1alphaProject(t,
v1alphaProject.Metadata{
Name: generateName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
- Annotations: commonAnnotations,
- },
- v1alphaProject.Spec{
- Description: objectDescription,
+ DisplayName: "Project 3",
+ Labels: v1alpha.Labels{"team": []string{"orange"}},
},
),
}
@@ -91,13 +82,29 @@ func Test_Objects_V1_V1alpha_Project(t *testing.T) {
if !test.returnsAll {
require.Len(t, actual, len(test.expected))
}
- assertSubset(t, actual, test.expected, assertProjectsAreEqual)
+ assertSubset(t, actual, test.expected, assertV1alphaProjectsAreEqual)
})
}
}
-func assertProjectsAreEqual(t *testing.T, expected, actual v1alphaProject.Project) {
+func newV1alphaProject(
+ t *testing.T,
+ metadata v1alphaProject.Metadata,
+) v1alphaProject.Project {
+ t.Helper()
+ annotateLabels(t, metadata.Labels)
+ metadata.Annotations = commonAnnotations
+ return v1alphaProject.New(metadata, v1alphaProject.Spec{Description: objectDescription})
+}
+
+func generateV1alphaProject(t *testing.T) v1alphaProject.Project {
+ t.Helper()
+ return newV1alphaProject(t, v1alphaProject.Metadata{Name: generateName()})
+}
+
+func assertV1alphaProjectsAreEqual(t *testing.T, expected, actual v1alphaProject.Project) {
t.Helper()
+ expected = deepCopyObject(t, expected)
assert.Regexp(t, timeRFC3339Regexp, actual.Spec.CreatedAt)
assert.Regexp(t, userIDRegexp, actual.Spec.CreatedBy)
actual.Spec.CreatedAt = ""
diff --git a/tests/v1alpha_service_test.go b/tests/v1alpha_service_test.go
index 93d02f36..af7cf634 100644
--- a/tests/v1alpha_service_test.go
+++ b/tests/v1alpha_service_test.go
@@ -12,6 +12,7 @@ import (
"github.com/nobl9/nobl9-go/manifest"
"github.com/nobl9/nobl9-go/manifest/v1alpha"
v1alphaService "github.com/nobl9/nobl9-go/manifest/v1alpha/service"
+ "github.com/nobl9/nobl9-go/sdk"
objectsV1 "github.com/nobl9/nobl9-go/sdk/endpoints/objects/v1"
)
@@ -19,50 +20,41 @@ func Test_Objects_V1_V1alpha_Service(t *testing.T) {
t.Parallel()
ctx := context.Background()
project := generateV1alphaProject(t)
+ project.Metadata.DisplayName = "Project 1"
allObjects := []manifest.Object{
project,
- v1alphaService.New(
+ newV1alphaService(t,
v1alphaService.Metadata{
Name: generateName(),
+ DisplayName: "Service 1",
Project: defaultProject,
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
+ Labels: v1alpha.Labels{"team": []string{"orange"}},
Annotations: commonAnnotations,
},
- v1alphaService.Spec{
- Description: objectDescription,
- },
),
- v1alphaService.New(
+ newV1alphaService(t,
v1alphaService.Metadata{
Name: generateName(),
+ DisplayName: "Service 2",
Project: project.GetName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
- Annotations: commonAnnotations,
- },
- v1alphaService.Spec{
- Description: objectDescription,
+ Labels: v1alpha.Labels{"team": []string{"orange"}},
},
),
- v1alphaService.New(
+ newV1alphaService(t,
v1alphaService.Metadata{
Name: generateName(),
+ DisplayName: "Service 3",
Project: project.GetName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"green"}}),
+ Labels: v1alpha.Labels{"team": []string{"green"}},
Annotations: commonAnnotations,
},
- v1alphaService.Spec{
- Description: objectDescription,
- },
),
- v1alphaService.New(
+ newV1alphaService(t,
v1alphaService.Metadata{
Name: generateName(),
+ DisplayName: "Service 4",
Project: project.GetName(),
- Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
- Annotations: commonAnnotations,
- },
- v1alphaService.Spec{
- Description: objectDescription,
+ Labels: v1alpha.Labels{"team": []string{"orange"}},
},
),
}
@@ -76,6 +68,11 @@ func Test_Objects_V1_V1alpha_Service(t *testing.T) {
expected []v1alphaService.Service
returnsAll bool
}{
+ "all": {
+ request: objectsV1.GetServicesRequest{Project: sdk.ProjectsWildcard},
+ expected: manifest.FilterByKind[v1alphaService.Service](allObjects),
+ returnsAll: true,
+ },
"default project": {
request: objectsV1.GetServicesRequest{},
expected: []v1alphaService.Service{inputs[0]},
@@ -118,13 +115,29 @@ func Test_Objects_V1_V1alpha_Service(t *testing.T) {
if !test.returnsAll {
require.Len(t, actual, len(test.expected))
}
- assertSubset(t, actual, test.expected, assertServicesAreEqual)
+ assertSubset(t, actual, test.expected, assertV1alphaServicesAreEqual)
})
}
}
-func assertServicesAreEqual(t *testing.T, expected, actual v1alphaService.Service) {
+func newV1alphaService(
+ t *testing.T,
+ metadata v1alphaService.Metadata,
+) v1alphaService.Service {
+ t.Helper()
+ annotateLabels(t, metadata.Labels)
+ metadata.Annotations = commonAnnotations
+ return v1alphaService.New(metadata, v1alphaService.Spec{Description: objectDescription})
+}
+
+func generateV1alphaService(t *testing.T) v1alphaService.Service {
+ t.Helper()
+ return newV1alphaService(t, v1alphaService.Metadata{Name: generateName()})
+}
+
+func assertV1alphaServicesAreEqual(t *testing.T, expected, actual v1alphaService.Service) {
t.Helper()
+ expected = deepCopyObject(t, expected)
assert.NotNil(t, actual.Status)
actual.Status = nil
assert.Equal(t, expected, actual)
From 1a0e281e13a32b9882f28a09761532abbdb86d23 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 8 Jul 2024 22:22:22 +0000
Subject: [PATCH 10/13] chore: Update module github.com/aws/aws-sdk-go to
v1.54.16 (#487)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/aws/aws-sdk-go](https://togithub.com/aws/aws-sdk-go) |
`v1.54.15` -> `v1.54.16` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2faws%2faws-sdk-go/v1.54.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2faws%2faws-sdk-go/v1.54.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2faws%2faws-sdk-go/v1.54.15/v1.54.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2faws%2faws-sdk-go/v1.54.15/v1.54.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
aws/aws-sdk-go (github.com/aws/aws-sdk-go)
###
[`v1.54.16`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15416-2024-07-08)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.15...v1.54.16)
\===
##### Service Client Updates
- `service/codedeploy`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/devicefarm`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/dms`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/elasticbeanstalk`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/email`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/es`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/firehose`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/gamelift`: Updates service API
- Add v2 smoke tests and smithy smokeTests trait for SDK testing.
- `service/qapps`: Updates service API, documentation, waiters,
paginators, and examples
- `service/route53resolver`: Updates service API
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
go.mod | 3 ++-
go.sum | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 93837f14..8e540c53 100644
--- a/go.mod
+++ b/go.mod
@@ -6,8 +6,9 @@ require (
github.com/BurntSushi/toml v1.4.0
github.com/MicahParks/jwkset v0.5.18
github.com/MicahParks/keyfunc/v3 v3.3.3
- github.com/aws/aws-sdk-go v1.54.15
+ github.com/aws/aws-sdk-go v1.54.16
github.com/bmatcuk/doublestar/v4 v4.6.1
+ github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/nobl9/go-yaml v1.0.1
diff --git a/go.sum b/go.sum
index 045d479b..a8f3152d 100644
--- a/go.sum
+++ b/go.sum
@@ -4,8 +4,8 @@ github.com/MicahParks/jwkset v0.5.18 h1:WLdyMngF7rCrnstQxA7mpRoxeaWqGzPM/0z40PJU
github.com/MicahParks/jwkset v0.5.18/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB8jtEmY=
github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48=
-github.com/aws/aws-sdk-go v1.54.15 h1:ErgCEVbzuSfuZl9nR+g8FFnzjgeJ/AqAGOEWn6tgAHo=
-github.com/aws/aws-sdk-go v1.54.15/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.54.16 h1:+B9zGaVwOUU6AO9Sy99VjTMDPthWx10HjB08hjaBHIc=
+github.com/aws/aws-sdk-go v1.54.16/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -19,6 +19,8 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
+github.com/goccy/go-yaml v1.11.3 h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I=
+github.com/goccy/go-yaml v1.11.3/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
From 8338531306bd632c3cdd218e5fb8c33a126c3323 Mon Sep 17 00:00:00 2001
From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com>
Date: Tue, 9 Jul 2024 11:34:05 +0200
Subject: [PATCH 11/13] chore: Add v1alpha RoleBinding e2e tests (#486)
## Motivation
Extends e2e tests coverage for `v1alpha` `RoleBinding`.
---
internal/cmd/examplegen/main.go | 17 ++-
manifest/v1alpha/alertsilence/examples.yaml | 32 +++--
manifest/v1alpha/dataexport/examples.yaml | 2 +
manifest/v1alpha/rolebinding/examples.yaml | 20 +--
tests/helpers_test.go | 12 ++
tests/v1alpha_alertmethod_test.go | 2 +-
tests/v1alpha_rolebinding_test.go | 134 ++++++++++++++++++++
tests/v1alpha_service_test.go | 2 +-
8 files changed, 188 insertions(+), 33 deletions(-)
create mode 100644 tests/v1alpha_rolebinding_test.go
diff --git a/internal/cmd/examplegen/main.go b/internal/cmd/examplegen/main.go
index db621c1a..68e78897 100644
--- a/internal/cmd/examplegen/main.go
+++ b/internal/cmd/examplegen/main.go
@@ -80,18 +80,17 @@ func getV1alphaExamplesConfigs() []examplesGeneratorConfig {
object.GetKind().ToLower(),
)
grouped := groupBy(examples, func(e v1alphaExamples.Example) string { return e.GetVariant() })
- // If we don't have any variants, we can write all examples into examples.yaml file.
- if len(grouped) == 1 {
- configs = append(configs, examplesGeneratorConfig{
- Examples: examples,
- Path: filepath.Join(basePath, "examples.yaml"),
- })
- continue
- }
for variant, examples := range grouped {
+ var path string
+ if len(grouped) == 1 {
+ // If we don't have any variants, we can write all examples into examples.yaml file.
+ path = filepath.Join(basePath, "examples.yaml")
+ } else {
+ path = filepath.Join(basePath, "examples", strings.ReplaceAll(strings.ToLower(variant), " ", "-")+".yaml")
+ }
config := examplesGeneratorConfig{
Examples: examples,
- Path: filepath.Join(basePath, "examples", strings.ReplaceAll(strings.ToLower(variant), " ", "-")+".yaml"),
+ Path: path,
Comments: make(yaml.CommentMap),
}
if len(examples) == 1 {
diff --git a/manifest/v1alpha/alertsilence/examples.yaml b/manifest/v1alpha/alertsilence/examples.yaml
index ae867eee..7598d43a 100644
--- a/manifest/v1alpha/alertsilence/examples.yaml
+++ b/manifest/v1alpha/alertsilence/examples.yaml
@@ -1,54 +1,58 @@
+# duration
- apiVersion: n9/v1alpha
kind: AlertSilence
metadata:
- name: scheduled-maintenance-2024-05-01
+ name: incident-70
project: default
spec:
- description: Scheduled maintenance alerts silence
+ description: Alerts silenced for the duration of the active incident 70
slo: api-server-latency
alertPolicy:
name: fast-burn
project: default
period:
- startTime: 2024-05-01T12:00:00Z
- endTime: 2024-05-01T14:00:00Z
+ duration: 4h
+# end time
- apiVersion: n9/v1alpha
kind: AlertSilence
metadata:
- name: scheduled-maintenance-2024-05-02
+ name: incident-71
project: default
spec:
- description: Scheduled maintenance alerts silence
+ description: Alerts silenced until incident 71 is resolved
slo: api-server-latency
alertPolicy:
name: fast-burn
project: default
period:
- startTime: 2024-05-02T12:00:00Z
- duration: 2h
+ endTime: 2024-05-01T20:00:00Z
+# start and end time
- apiVersion: n9/v1alpha
kind: AlertSilence
metadata:
- name: incident-70
+ name: scheduled-maintenance-2024-05-01
project: default
spec:
- description: Alerts silenced for the duration of the active incident 70
+ description: Scheduled maintenance alerts silence
slo: api-server-latency
alertPolicy:
name: fast-burn
project: default
period:
- duration: 4h
+ startTime: 2024-05-01T12:00:00Z
+ endTime: 2024-05-01T14:00:00Z
+# start time and duration
- apiVersion: n9/v1alpha
kind: AlertSilence
metadata:
- name: incident-71
+ name: scheduled-maintenance-2024-05-02
project: default
spec:
- description: Alerts silenced until incident 71 is resolved
+ description: Scheduled maintenance alerts silence
slo: api-server-latency
alertPolicy:
name: fast-burn
project: default
period:
- endTime: 2024-05-01T20:00:00Z
+ startTime: 2024-05-02T12:00:00Z
+ duration: 2h
diff --git a/manifest/v1alpha/dataexport/examples.yaml b/manifest/v1alpha/dataexport/examples.yaml
index 9f5deb11..0a47508b 100644
--- a/manifest/v1alpha/dataexport/examples.yaml
+++ b/manifest/v1alpha/dataexport/examples.yaml
@@ -1,3 +1,4 @@
+# gcs
- apiVersion: n9/v1alpha
kind: DataExport
metadata:
@@ -9,6 +10,7 @@
spec:
bucketName: prod-data-export-bucket
status: null
+# s3
- apiVersion: n9/v1alpha
kind: DataExport
metadata:
diff --git a/manifest/v1alpha/rolebinding/examples.yaml b/manifest/v1alpha/rolebinding/examples.yaml
index b6418d3c..a467875e 100644
--- a/manifest/v1alpha/rolebinding/examples.yaml
+++ b/manifest/v1alpha/rolebinding/examples.yaml
@@ -1,11 +1,4 @@
-- apiVersion: n9/v1alpha
- kind: RoleBinding
- metadata:
- name: default-project-binding
- spec:
- user: 00u2y4e4atkzaYkXP4x8
- roleRef: project-viewer
- projectRef: default
+# organization binding
- apiVersion: n9/v1alpha
kind: RoleBinding
metadata:
@@ -13,6 +6,7 @@
spec:
user: 00u2y4e4atkzaYkXP4x8
roleRef: organization-admin
+# organization group binding
- apiVersion: n9/v1alpha
kind: RoleBinding
metadata:
@@ -20,6 +14,16 @@
spec:
groupRef: group-Q72HorLyjjCc
roleRef: organization-admin
+# project binding
+- apiVersion: n9/v1alpha
+ kind: RoleBinding
+ metadata:
+ name: default-project-binding
+ spec:
+ user: 00u2y4e4atkzaYkXP4x8
+ roleRef: project-viewer
+ projectRef: default
+# project group binding
- apiVersion: n9/v1alpha
kind: RoleBinding
metadata:
diff --git a/tests/helpers_test.go b/tests/helpers_test.go
index 9d33495e..fd880208 100644
--- a/tests/helpers_test.go
+++ b/tests/helpers_test.go
@@ -105,3 +105,15 @@ func deepCopyObject[T any](t *testing.T, object T) T {
require.NoError(t, json.Unmarshal(data, &copied))
return copied
}
+
+func filterSlice[T any](s []T, filter func(T) bool) []T {
+ result := make([]T, 0, len(s))
+ for i := range s {
+ if filter(s[i]) {
+ result = append(result, s[i])
+ }
+ }
+ return result
+}
+
+func ptr[T any](v T) *T { return &v }
diff --git a/tests/v1alpha_alertmethod_test.go b/tests/v1alpha_alertmethod_test.go
index d2e79e9d..8126ea4b 100644
--- a/tests/v1alpha_alertmethod_test.go
+++ b/tests/v1alpha_alertmethod_test.go
@@ -51,7 +51,7 @@ func Test_Objects_V1_V1alpha_AlertMethod(t *testing.T) {
}{
"all": {
request: objectsV1.GetAlertMethodsRequest{Project: sdk.ProjectsWildcard},
- expected: manifest.FilterByKind[v1alphaAlertMethod.AlertMethod](allObjects),
+ expected: inputs,
returnsAll: true,
},
"default project": {
diff --git a/tests/v1alpha_rolebinding_test.go b/tests/v1alpha_rolebinding_test.go
new file mode 100644
index 00000000..90477413
--- /dev/null
+++ b/tests/v1alpha_rolebinding_test.go
@@ -0,0 +1,134 @@
+//go:build e2e_test
+
+package tests
+
+import (
+ "context"
+ "strings"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "github.com/nobl9/nobl9-go/manifest"
+ v1alphaRoleBinding "github.com/nobl9/nobl9-go/manifest/v1alpha/rolebinding"
+ "github.com/nobl9/nobl9-go/sdk"
+ objectsV1 "github.com/nobl9/nobl9-go/sdk/endpoints/objects/v1"
+)
+
+func Test_Objects_V1_V1alpha_RoleBinding(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ project := generateV1alphaProject(t)
+ v1Apply(t, ctx, []manifest.Object{project})
+ implicitBindings, err := client.Objects().V1().GetV1alphaRoleBindings(ctx,
+ objectsV1.GetRoleBindingsRequest{Project: project.GetName()})
+ require.NoError(t, err)
+ require.Len(t, implicitBindings, 1)
+ implicitProjectBinding := implicitBindings[0]
+
+ inputs := []v1alphaRoleBinding.RoleBinding{
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ User: ptr(generateName()),
+ RoleRef: "organization-blank",
+ },
+ ),
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ GroupRef: ptr(generateName()),
+ RoleRef: "organization-blank",
+ },
+ ),
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ User: ptr(generateName()),
+ RoleRef: "project-viewer",
+ ProjectRef: project.GetName(),
+ },
+ ),
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ GroupRef: ptr(generateName()),
+ RoleRef: "project-viewer",
+ ProjectRef: project.GetName(),
+ },
+ ),
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ User: ptr(generateName()),
+ RoleRef: "project-viewer",
+ ProjectRef: defaultProject,
+ },
+ ),
+ v1alphaRoleBinding.New(
+ v1alphaRoleBinding.Metadata{Name: generateName()},
+ v1alphaRoleBinding.Spec{
+ GroupRef: ptr(generateName()),
+ RoleRef: "project-viewer",
+ ProjectRef: defaultProject,
+ },
+ ),
+ }
+
+ v1Apply(t, ctx, inputs)
+ t.Cleanup(func() {
+ // Organization role bindings cannot be deleted.
+ filterOrganizationBindings := func(r v1alphaRoleBinding.RoleBinding) bool {
+ return !strings.HasPrefix(r.Spec.RoleRef, "organization-")
+ }
+ v1Delete(t, ctx, filterSlice(inputs, filterOrganizationBindings))
+ })
+
+ filterTests := map[string]struct {
+ request objectsV1.GetRoleBindingsRequest
+ expected []v1alphaRoleBinding.RoleBinding
+ returnsAll bool
+ }{
+ "all": {
+ request: objectsV1.GetRoleBindingsRequest{Project: sdk.ProjectsWildcard},
+ expected: inputs,
+ returnsAll: true,
+ },
+ "default project": {
+ request: objectsV1.GetRoleBindingsRequest{},
+ expected: []v1alphaRoleBinding.RoleBinding{inputs[4], inputs[5]},
+ returnsAll: true,
+ },
+ "filter by project": {
+ request: objectsV1.GetRoleBindingsRequest{
+ Project: project.GetName(),
+ },
+ expected: []v1alphaRoleBinding.RoleBinding{implicitProjectBinding, inputs[2], inputs[3]},
+ },
+ "filter by name": {
+ request: objectsV1.GetRoleBindingsRequest{
+ Project: project.GetName(),
+ Names: []string{inputs[2].Metadata.Name},
+ },
+ expected: []v1alphaRoleBinding.RoleBinding{inputs[2]},
+ },
+ }
+ for name, test := range filterTests {
+ t.Run(name, func(t *testing.T) {
+ t.Parallel()
+ actual, err := client.Objects().V1().GetV1alphaRoleBindings(ctx, test.request)
+ require.NoError(t, err)
+ if !test.returnsAll {
+ require.Len(t, actual, len(test.expected))
+ }
+ assertSubset(t, actual, test.expected, assertV1alphaRoleBindingsAreEqual)
+ })
+ }
+}
+
+func assertV1alphaRoleBindingsAreEqual(t *testing.T, expected, actual v1alphaRoleBinding.RoleBinding) {
+ t.Helper()
+ assert.Equal(t, expected, actual)
+}
diff --git a/tests/v1alpha_service_test.go b/tests/v1alpha_service_test.go
index af7cf634..0f77661c 100644
--- a/tests/v1alpha_service_test.go
+++ b/tests/v1alpha_service_test.go
@@ -70,7 +70,7 @@ func Test_Objects_V1_V1alpha_Service(t *testing.T) {
}{
"all": {
request: objectsV1.GetServicesRequest{Project: sdk.ProjectsWildcard},
- expected: manifest.FilterByKind[v1alphaService.Service](allObjects),
+ expected: inputs,
returnsAll: true,
},
"default project": {
From 8794a87f8185a90b54ba3ec166f6463ac22d678c Mon Sep 17 00:00:00 2001
From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com>
Date: Tue, 9 Jul 2024 13:55:48 +0200
Subject: [PATCH 12/13] chore: Add Alert Method e2e tests (#488)
Adds v1alpha `AlertMethod` e2e test cases.
---
tests/v1alpha_alertpolicy_test.go | 150 ++++++++++++++++++++++++++++++
tests/v1alpha_project_test.go | 2 +-
tests/v1alpha_service_test.go | 2 +-
3 files changed, 152 insertions(+), 2 deletions(-)
create mode 100644 tests/v1alpha_alertpolicy_test.go
diff --git a/tests/v1alpha_alertpolicy_test.go b/tests/v1alpha_alertpolicy_test.go
new file mode 100644
index 00000000..3c5c7146
--- /dev/null
+++ b/tests/v1alpha_alertpolicy_test.go
@@ -0,0 +1,150 @@
+//go:build e2e_test
+
+package tests
+
+import (
+ "context"
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ v1alphaExamples "github.com/nobl9/nobl9-go/internal/manifest/v1alpha/examples"
+ "github.com/nobl9/nobl9-go/manifest"
+ "github.com/nobl9/nobl9-go/manifest/v1alpha"
+ v1alphaAlertMethod "github.com/nobl9/nobl9-go/manifest/v1alpha/alertmethod"
+ v1alphaAlertPolicy "github.com/nobl9/nobl9-go/manifest/v1alpha/alertpolicy"
+ "github.com/nobl9/nobl9-go/sdk"
+ objectsV1 "github.com/nobl9/nobl9-go/sdk/endpoints/objects/v1"
+)
+
+func Test_Objects_V1_V1alpha_AlertPolicy(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+ project := generateV1alphaProject(t)
+ alertMethod := newV1alphaAlertMethod(t, v1alpha.AlertMethodTypeSlack, v1alphaAlertMethod.Metadata{
+ Name: generateName(),
+ DisplayName: "Alert Method",
+ Project: project.GetName(),
+ })
+ examples := v1alphaExamples.AlertPolicy()
+ allObjects := make([]manifest.Object, 0, len(examples)+2)
+ allObjects = append(allObjects, project)
+ allObjects = append(allObjects, alertMethod)
+
+ for i, example := range examples {
+ policy := newV1alphaAlertPolicy(t,
+ v1alphaAlertPolicy.Metadata{
+ Name: generateName(),
+ DisplayName: fmt.Sprintf("Alert Policy %d", i),
+ Project: project.GetName(),
+ },
+ example.GetVariant(),
+ example.GetSubVariant(),
+ )
+ policy.Spec.AlertMethods = []v1alphaAlertPolicy.AlertMethodRef{
+ {
+ Metadata: v1alphaAlertPolicy.AlertMethodRefMetadata{
+ Name: alertMethod.Metadata.Name,
+ Project: alertMethod.Metadata.Project,
+ },
+ },
+ }
+ for i := range policy.Spec.Conditions {
+ if policy.Spec.Conditions[i].AlertingWindow == "" && policy.Spec.Conditions[i].LastsForDuration == "" {
+ policy.Spec.Conditions[i].LastsForDuration = "0m"
+ }
+ }
+ switch i {
+ case 0:
+ policy.Metadata.Project = defaultProject
+ case 1:
+ policy.Metadata.Labels["team"] = []string{"green"}
+ case 2:
+ policy.Metadata.Labels["team"] = []string{"orange"}
+ case 3:
+ policy.Metadata.Labels["team"] = []string{"orange"}
+ }
+ allObjects = append(allObjects, policy)
+ }
+
+ v1Apply(t, ctx, allObjects)
+ t.Cleanup(func() { v1Delete(t, ctx, allObjects) })
+ inputs := manifest.FilterByKind[v1alphaAlertPolicy.AlertPolicy](allObjects)
+
+ filterTests := map[string]struct {
+ request objectsV1.GetAlertPolicyRequest
+ expected []v1alphaAlertPolicy.AlertPolicy
+ returnsAll bool
+ }{
+ "all": {
+ request: objectsV1.GetAlertPolicyRequest{Project: sdk.ProjectsWildcard},
+ expected: manifest.FilterByKind[v1alphaAlertPolicy.AlertPolicy](allObjects),
+ returnsAll: true,
+ },
+ "default project": {
+ request: objectsV1.GetAlertPolicyRequest{},
+ expected: []v1alphaAlertPolicy.AlertPolicy{inputs[0]},
+ returnsAll: true,
+ },
+ "filter by project": {
+ request: objectsV1.GetAlertPolicyRequest{
+ Project: project.GetName(),
+ },
+ expected: inputs[1:],
+ },
+ "filter by name": {
+ request: objectsV1.GetAlertPolicyRequest{
+ Project: project.GetName(),
+ Names: []string{inputs[4].Metadata.Name},
+ },
+ expected: []v1alphaAlertPolicy.AlertPolicy{inputs[4]},
+ },
+ "filter by label": {
+ request: objectsV1.GetAlertPolicyRequest{
+ Project: project.GetName(),
+ Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"green"}}),
+ },
+ expected: []v1alphaAlertPolicy.AlertPolicy{inputs[1]},
+ },
+ "filter by label and name": {
+ request: objectsV1.GetAlertPolicyRequest{
+ Project: project.GetName(),
+ Names: []string{inputs[3].Metadata.Name},
+ Labels: annotateLabels(t, v1alpha.Labels{"team": []string{"orange"}}),
+ },
+ expected: []v1alphaAlertPolicy.AlertPolicy{inputs[3]},
+ },
+ }
+ for name, test := range filterTests {
+ t.Run(name, func(t *testing.T) {
+ t.Parallel()
+ actual, err := client.Objects().V1().GetV1alphaAlertPolicies(ctx, test.request)
+ require.NoError(t, err)
+ if !test.returnsAll {
+ require.Len(t, actual, len(test.expected))
+ }
+ assertSubset(t, actual, test.expected, assertV1alphaAlertPoliciesAreEqual)
+ })
+ }
+}
+
+func newV1alphaAlertPolicy(
+ t *testing.T,
+ metadata v1alphaAlertPolicy.Metadata,
+ variant,
+ subVariant string,
+) v1alphaAlertPolicy.AlertPolicy {
+ t.Helper()
+ metadata.Labels = annotateLabels(t, metadata.Labels)
+ metadata.Annotations = commonAnnotations
+ ap := getExample[v1alphaAlertPolicy.AlertPolicy](t, manifest.KindAlertPolicy, variant, subVariant)
+ ap.Spec.Description = objectDescription
+ return v1alphaAlertPolicy.New(metadata, ap.Spec)
+}
+
+func assertV1alphaAlertPoliciesAreEqual(t *testing.T, expected, actual v1alphaAlertPolicy.AlertPolicy) {
+ t.Helper()
+ assert.Equal(t, expected, actual)
+}
diff --git a/tests/v1alpha_project_test.go b/tests/v1alpha_project_test.go
index f6d384d5..1004c50d 100644
--- a/tests/v1alpha_project_test.go
+++ b/tests/v1alpha_project_test.go
@@ -92,7 +92,7 @@ func newV1alphaProject(
metadata v1alphaProject.Metadata,
) v1alphaProject.Project {
t.Helper()
- annotateLabels(t, metadata.Labels)
+ metadata.Labels = annotateLabels(t, metadata.Labels)
metadata.Annotations = commonAnnotations
return v1alphaProject.New(metadata, v1alphaProject.Spec{Description: objectDescription})
}
diff --git a/tests/v1alpha_service_test.go b/tests/v1alpha_service_test.go
index 0f77661c..048b763d 100644
--- a/tests/v1alpha_service_test.go
+++ b/tests/v1alpha_service_test.go
@@ -125,7 +125,7 @@ func newV1alphaService(
metadata v1alphaService.Metadata,
) v1alphaService.Service {
t.Helper()
- annotateLabels(t, metadata.Labels)
+ metadata.Labels = annotateLabels(t, metadata.Labels)
metadata.Annotations = commonAnnotations
return v1alphaService.New(metadata, v1alphaService.Spec{Description: objectDescription})
}
From 1a7c326ae0329d6db0483b2432be4f6f80ef01d5 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 9 Jul 2024 23:28:32 +0000
Subject: [PATCH 13/13] chore: Update module github.com/aws/aws-sdk-go to
v1.54.17 (#489)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/aws/aws-sdk-go](https://togithub.com/aws/aws-sdk-go) |
`v1.54.16` -> `v1.54.17` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2faws%2faws-sdk-go/v1.54.17?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2faws%2faws-sdk-go/v1.54.17?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2faws%2faws-sdk-go/v1.54.16/v1.54.17?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2faws%2faws-sdk-go/v1.54.16/v1.54.17?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
aws/aws-sdk-go (github.com/aws/aws-sdk-go)
###
[`v1.54.17`](https://togithub.com/aws/aws-sdk-go/blob/HEAD/CHANGELOG.md#Release-v15417-2024-07-09)
[Compare
Source](https://togithub.com/aws/aws-sdk-go/compare/v1.54.16...v1.54.17)
\===
##### Service Client Updates
- `service/datazone`: Updates service API
- `service/fsx`: Updates service API and documentation
- `service/opensearch`: Updates service API and documentation
- `service/sagemaker`: Updates service API, documentation, and
paginators
- This release 1/ enables optimization jobs that allows customers to
perform Ahead-of-time compilation and quantization. 2/ allows customers
to control access to Amazon Q integration in SageMaker Studio. 3/
enables AdditionalModelDataSources for CreateModel action.
---
### Configuration
📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am
every weekday,every weekend" (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/nobl9/nobl9-go).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 8e540c53..6f3843f2 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v1.4.0
github.com/MicahParks/jwkset v0.5.18
github.com/MicahParks/keyfunc/v3 v3.3.3
- github.com/aws/aws-sdk-go v1.54.16
+ github.com/aws/aws-sdk-go v1.54.17
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/goccy/go-yaml v1.11.3
github.com/golang-jwt/jwt/v5 v5.2.1
diff --git a/go.sum b/go.sum
index a8f3152d..1403ae9b 100644
--- a/go.sum
+++ b/go.sum
@@ -4,8 +4,8 @@ github.com/MicahParks/jwkset v0.5.18 h1:WLdyMngF7rCrnstQxA7mpRoxeaWqGzPM/0z40PJU
github.com/MicahParks/jwkset v0.5.18/go.mod h1:q8ptTGn/Z9c4MwbcfeCDssADeVQb3Pk7PnVxrvi+2QY=
github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB8jtEmY=
github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48=
-github.com/aws/aws-sdk-go v1.54.16 h1:+B9zGaVwOUU6AO9Sy99VjTMDPthWx10HjB08hjaBHIc=
-github.com/aws/aws-sdk-go v1.54.16/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.54.17 h1:ZV/qwcCIhMHgsJ6iXXPVYI0s1MdLT+5LW28ClzCUPeI=
+github.com/aws/aws-sdk-go v1.54.17/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=