Skip to content

Commit

Permalink
feat: support multiple providers
Browse files Browse the repository at this point in the history
  • Loading branch information
karlderkaefer committed Jan 21, 2024
1 parent eaf216e commit 1e26926
Show file tree
Hide file tree
Showing 15 changed files with 414 additions and 118 deletions.
5 changes: 4 additions & 1 deletion api/v1alpha1/endpointmonitor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type EndpointMonitorSpec struct {
// +optional
PingdomConfig *PingdomConfig `json:"pingdomConfig,omitempty"`

// Configuration for Pingdom Monitor Provider
// Configuration for Pingdom Transaction Monitor Provider
// +optional
PingdomTransactionConfig *PingdomTransactionConfig `json:"pingdomTransactionConfig,omitempty"`

Expand Down Expand Up @@ -305,17 +305,20 @@ type PingdomTransactionConfig struct {

// TMS test intervals in minutes. Allowed intervals: 5,10,20,60,720,1440. The interval you're allowed to set may vary depending on your current plan.
// +optional
// +kubebuilder:validation:Enum=5;10;20;60;720;1440
Interval int `json:"interval,omitempty"`

// Name of the region where the check is executed. Supported regions: us-east, us-west, eu, au
// +optional
// +kubebuilder:validation:Enum=us-east;us-west;eu;au
Region string `json:"region,omitempty"`

// Send notification when down X times
SendNotificationWhenDown int64 `json:"send_notification_when_down,omitempty"`

// Check importance- how important are the alerts when the check fails. Allowed values: low, high
// +optional
// +kubebuilder:validation:Enum=low;high
SeverityLevel string `json:"severity_level,omitempty"`

// steps to be executed as part of the check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spec:
type: boolean
type: object
pingdomTransactionConfig:
description: Configuration for Pingdom Monitor Provider
description: Configuration for Pingdom Transaction Monitor Provider
properties:
alertContacts:
description: '`-` separated contact id''s (e.g. "1234567_8_9-9876543_2_1")'
Expand All @@ -148,13 +148,25 @@ spec:
description: 'TMS test intervals in minutes. Allowed intervals:
5,10,20,60,720,1440. The interval you''re allowed to set may
vary depending on your current plan.'
enum:
- 5
- 10
- 20
- 60
- 720
- 1440
type: integer
paused:
description: 'Check status: active or inactive'
type: boolean
region:
description: 'Name of the region where the check is executed.
Supported regions: us-east, us-west, eu, au'
enum:
- us-east
- us-west
- eu
- au
type: string
send_notification_when_down:
description: Send notification when down X times
Expand All @@ -163,6 +175,9 @@ spec:
severity_level:
description: 'Check importance- how important are the alerts when
the check fails. Allowed values: low, high'
enum:
- low
- high
type: string
steps:
description: steps to be executed as part of the check
Expand Down
16 changes: 16 additions & 0 deletions docs/pingdom-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,19 @@ spec:
teamAlertContacts: "1234567_8_9-9876543_2_1,1234567_8_9-9876543_2_2"
postDataEnvVar: "monitor-user"
```
## Transaction Check
**Example:**
```yaml
apiVersion: endpointmonitor.stakater.com/v1alpha1
kind: EndpointMonitor
metadata:
name: pingdom-transaction-check
spec:
pingdomTransactionConfig:
tags:
- "testing"
- "manual"
``````
5 changes: 5 additions & 0 deletions examples/configs/test-config-pingdom-transaction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
providers:
- name: PingdomTransaction
apiURL: https://api.pingdom.com/api/3.1
apiToken: <API_TOKEN>
enableMonitorDeletion: true
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/go-logr/logr v1.2.0
github.com/grafana/synthetic-monitoring-agent v0.18.2
github.com/grafana/synthetic-monitoring-api-go-client v0.7.0
github.com/karlderkaefer/pingdom-golang-client v1.0.0
github.com/karlderkaefer/pingdom-golang-client v1.0.1-0.20240119151402-5a612ee09e11
github.com/kelseyhightower/envconfig v1.4.0
github.com/openshift/api v0.0.0-20200526144822-34f54f12813a
github.com/patrickmn/go-cache v2.1.0+incompatible
Expand Down Expand Up @@ -47,11 +47,13 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deepmap/oapi-codegen/v2 v2.0.0 // indirect
github.com/dimchansky/utfbom v1.1.0 // indirect
github.com/emicklei/go-restful v2.16.0+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/getkin/kin-openapi v0.118.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
Expand All @@ -67,14 +69,17 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
Expand All @@ -87,13 +92,15 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.14.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
Expand Down
Loading

0 comments on commit 1e26926

Please sign in to comment.