openebs / monitoring

OpenEBS Monitoring add-on. A set of Grafana, Prometheus, and alert manager plugins.
Apache License 2.0
31 stars 20 forks source link

Add openebs-mixin #39

Closed rajaSahil closed 3 years ago

rajaSahil commented 3 years ago

Signed-off-by: Sahil Raja sahilraja242@gmail.com

Reviewer Notes

What this PR does?

openebs-mixin

openebs monitoring using jsonnet

Directory structure:

openebs/monitoring/jsonnet
├── addons # openebs-monitoring addon
│   ├── dashboard-cm.libsonnet # dashboard configmap to include openebs-* dashboard json files from openebs-mixin
│   ├── podMonitors.libsonnet # podMonitor to be created for different cas types
│   ├── prometheusRules.libsonnet # create prometheusRule object which includes alert rules defined in openebs-mixin
│   └── serviceMonitors.libsonnet # serviceMonitor to be created for different cas types
├── buildscripts # scripts and code required to build the project
│   ├── build.sh # script to generate manifests
│   ├── go.mod
│   ├── go.sum
│   └── tools.go
├── config.libsonnet # configuration to be used for openebs monitoing
├── jsonnetfile.json # direct dependencies
├── jsonnetfile.lock.json # all dependencies with exact version
├── lib # contains code that is used in different places
│   └── utils.libsonnet # code which is used to create openebs-monitoring addons
├── main.jsonnet # entrypoint of code
├── Makefile
├── manifests # generated yamls
│   ├── openebs-addons # openebs-monitoring addons yaml
│   │   ├── openebs-*.yaml
│   ├── setup # kube-prometheus crds, rbac and prometheus-operator yaml
│   │   ├── ...
│   ├── ... # kube-prometheus components yaml
└── openebs-mixin # openebs-mixin for dashboards and alert rules
    ├── build.sh
    ├── config.libsonnet # configuration that is used while writing dashboards and alert rules
    ├── dashboards
    │   ├── cstor-overview.json
    │   ├── cstor-pool.json
    │   ├── cstor-volume.json
    │   ├── cstor-volume-replica.json
    │   ├── dashboards.libsonnet # to import all the dashboard json
    │   ├── jiva-volume.json
    │   └── localpv-workload.json
    ├── jsonnetfile.json # direct dependencies
    ├── lib
    │   ├── dashboards.jsonnet
    │   └── rules.jsonnet
    ├── Makefile
    ├── mixin.libsonnet # openebs-mixin that imports all the dashboards and alert rules
    └── rules # contains alert rules for different cas types
        ├── cstor-pool-rules.libsonnet
        ├── cstor-rules.libsonnet
        ├── cstor-volume-rules.libsonnet
        ├── jiva-rules.libsonnet
        ├── jiva-volume-rules.libsonnet
        ├── rules.libsonnet
        └── volume-rules.libsonnet

Note:

Refer to this document for more insight into openebs-mixin and openebs-monitoring using jsonnet: