Skip to content

Commit

Permalink
feat: Add new Thousandeyes test type - API transaction time (#629)
Browse files Browse the repository at this point in the history
## Motivation

New test type in Thousandeyes

## Summary

Added test type name

## Related changes

https://github.com/nobl9/nobl9-go/pull/624/files

## Testing

No testing needed.

## Release Notes

Added API Test type for Thousandeyes integration.
  • Loading branch information
marcinlawnik authored Jan 21, 2025
1 parent bf8b69b commit 41cae06
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/manifest/v1alpha/examples/slo.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var customMetricExamples = map[v1alpha.DataSourceType]map[metricVariant][]metric
metricSubVariantThousandEyesNetLoss,
metricSubVariantThousandEyesDOMLoad,
metricSubVariantThousandEyesTransactionTime,
metricSubVariantThousandEyesAPITransactionTime,
metricSubVariantThousandEyesServerAvailability,
metricSubVariantThousandEyesServerThroughput,
},
Expand Down
6 changes: 6 additions & 0 deletions internal/manifest/v1alpha/examples/slo_variants.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const (
metricSubVariantThousandEyesNetLoss metricVariant = "net loss"
metricSubVariantThousandEyesDOMLoad metricVariant = "DOM load"
metricSubVariantThousandEyesTransactionTime metricVariant = "transaction time"
metricSubVariantThousandEyesAPITransactionTime metricVariant = "API transaction time"
metricSubVariantThousandEyesServerAvailability metricVariant = "server availability"
metricSubVariantThousandEyesServerThroughput metricVariant = "server throughput"
// CloudWatch.
Expand Down Expand Up @@ -440,6 +441,11 @@ func (s sloExample) generateMetricVariant(slo v1alphaSLO.SLO) v1alphaSLO.SLO {
TestID: ptr[int64](2280492),
TestType: ptr(v1alphaSLO.ThousandEyesWebTransactionTime),
}))
case metricVariantThreshold + metricSubVariantThousandEyesAPITransactionTime:
return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
TestID: ptr[int64](2280492),
TestType: ptr(v1alphaSLO.ThousandEyesAPITransactionTime),
}))
case metricVariantThreshold + metricSubVariantThousandEyesServerAvailability:
return setThresholdMetric(slo, newMetricSpec(v1alphaSLO.ThousandEyesMetric{
TestID: ptr[int64](2280492),
Expand Down
260 changes: 260 additions & 0 deletions manifest/v1alpha/slo/examples/thousand-eyes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,264 @@
# Metric type: threshold
# Metric variant: API transaction 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: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 200.0
name: ok
target: 0.95
rawMetric:
query:
thousandEyes:
testID: 2280492
testType: api-transaction-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: API transaction 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: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 200.0
name: ok
target: 0.95
rawMetric:
query:
thousandEyes:
testID: 2280492
testType: api-transaction-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: API transaction 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: Agent
budgetingMethod: Timeslices
objectives:
- displayName: Good response (200)
value: 200.0
name: ok
target: 0.95
timeSliceTarget: 0.9
rawMetric:
query:
thousandEyes:
testID: 2280492
testType: api-transaction-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: API transaction 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: Agent
budgetingMethod: Timeslices
objectives:
- displayName: Good response (200)
value: 200.0
name: ok
target: 0.95
timeSliceTarget: 0.9
rawMetric:
query:
thousandEyes:
testID: 2280492
testType: api-transaction-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: DOM load
# Budgeting method: Occurrences
# Time window type: Calendar
Expand Down
2 changes: 2 additions & 0 deletions manifest/v1alpha/slo/metrics_thousand_eyes.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
ThousandEyesWebPageLoad = "web-page-load"
ThousandEyesWebDOMLoad = "web-dom-load"
ThousandEyesWebTransactionTime = "web-transaction-time"
ThousandEyesAPITransactionTime = "api-transaction-time"
ThousandEyesHTTPResponseTime = "http-response-time"
ThousandEyesServerAvailability = "http-server-availability"
ThousandEyesServerThroughput = "http-server-throughput"
Expand All @@ -43,6 +44,7 @@ var supportedThousandEyesTestTypes = []string{
ThousandEyesWebPageLoad,
ThousandEyesWebDOMLoad,
ThousandEyesWebTransactionTime,
ThousandEyesAPITransactionTime,
ThousandEyesHTTPResponseTime,
ThousandEyesServerAvailability,
ThousandEyesServerThroughput,
Expand Down

0 comments on commit 41cae06

Please sign in to comment.