Skip to content

Commit

Permalink
Add dashboard for alerts in MongoDB
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Dec 5, 2023
1 parent 23204b2 commit b126ab1
Show file tree
Hide file tree
Showing 8 changed files with 2,031 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apis/alerts/v1alpha1/mongodb_alerts_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type MongodbAlerts struct {
type MongodbAlertsSpec struct {
api.Metadata `json:"metadata,omitempty"`
Form MongodbAlertsSpecForm `json:"form"`
Grafana Grafana `json:"grafana"`
}

type MongodbAlertsSpecForm struct {
Expand Down Expand Up @@ -87,6 +88,14 @@ type MongoDBDatabaseAlertRules struct {
MongodbRecurrentMemoryPageFaults IntValAlert `json:"mongodbRecurrentMemoryPageFaults"`
}

type Grafana struct {
Enabled bool `json:"enabled"`
Version string `json:"version"`
JobName string `json:"jobName"`
URL string `json:"url"`
ApiKey string `json:"apikey"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// MongodbAlertsList is a list of MongodbAlertss
Expand Down
17 changes: 17 additions & 0 deletions apis/alerts/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions charts/mongodb-alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ The following table lists the configurable parameters of the `mongodb-alerts` ch
| form.alert.groups.schemaManager.rules.schemaExpired.enabled | | <code>true</code> |
| form.alert.groups.schemaManager.rules.schemaExpired.duration | | <code>"0m"</code> |
| form.alert.groups.schemaManager.rules.schemaExpired.severity | | <code>warning</code> |
| grafana.enabled | | <code>false</code> |
| grafana.version | | <code>8.2.3</code> |
| grafana.jobName | | <code>kubedb-databases</code> |
| grafana.url | | <code>""</code> |
| grafana.apikey | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
1 change: 1 addition & 0 deletions charts/mongodb-alerts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Alert Enabled
{{- end -}}
{{- if (and $sev (le $sev $result) $enabled) -}}{{ (mustLast .) }}{{- end -}}
{{- end }}

Loading

0 comments on commit b126ab1

Please sign in to comment.