diff --git a/.github/workflows/kubernetes_test.yaml b/.github/workflows/kubernetes_test.yaml index 1e0843cff0..ce34caa6c2 100644 --- a/.github/workflows/kubernetes_test.yaml +++ b/.github/workflows/kubernetes_test.yaml @@ -5,12 +5,11 @@ on: paths: - ".github/workflows/kubernetes_test.yaml" - "tests/**" - - "tests_deployment/**" - - "tests_e2e/**" - "scripts/**" - "src/**" - "pyproject.toml" - "pytest.ini" + - ".cirun.yml" push: branches: - main @@ -19,12 +18,11 @@ on: paths: - ".github/workflows/kubernetes_test.yaml" - "tests/**" - - "tests_deployment/**" - - "tests_e2e/**" - "scripts/**" - "src/**" - "pyproject.toml" - "pytest.ini" + - ".cirun.yml" workflow_call: inputs: pr_number: @@ -148,14 +146,14 @@ jobs: env: CYPRESS_BASE_URL: https://github-actions.nebari.dev/ with: - working-directory: tests_e2e + working-directory: tests/tests_e2e - name: Playwright Tests env: KEYCLOAK_USERNAME: ${{ env.CYPRESS_EXAMPLE_USER_NAME }} KEYCLOAK_PASSWORD: ${{ env.CYPRESS_EXAMPLE_USER_PASSWORD }} NEBARI_FULL_URL: https://github-actions.nebari.dev/ - working-directory: tests_e2e/playwright + working-directory: tests/tests_e2e/playwright run: | # create environment file envsubst < .env.tpl > .env @@ -168,15 +166,15 @@ jobs: with: name: e2e-cypress path: | - ./tests_e2e/cypress/screenshots/ - ./tests_e2e/cypress/videos/ - ./tests_e2e/playwright/videos/ + ./tests/tests_e2e/cypress/screenshots/ + ./tests/tests_e2e/cypress/videos/ + ./tests/tests_e2e/playwright/videos/ - name: Deployment Pytests run: | export KEYCLOAK_USERNAME=${CYPRESS_EXAMPLE_USER_NAME} export KEYCLOAK_PASSWORD=${CYPRESS_EXAMPLE_USER_PASSWORD} - pytest tests_deployment/ -v -s + pytest tests/tests_deployment/ -v -s - name: JupyterHub Notebook Tests timeout-minutes: 2 @@ -191,7 +189,7 @@ jobs: --validate --no-verify-ssl \ --kernel python3 \ --stop-server \ - --notebook tests_deployment/assets/notebook/simple.ipynb \ + --notebook tests/tests_deployment/assets/notebook/simple.ipynb \ ### CLEANUP AFTER TESTS - name: Cleanup nebari deployment diff --git a/docs/source/images/argo-workflows-user-tab.png b/docs/source/images/argo-workflows-user-tab.png deleted file mode 100644 index ac2a5df13c..0000000000 Binary files a/docs/source/images/argo-workflows-user-tab.png and /dev/null differ diff --git a/docs/source/user_guide/argo_workflows.md b/docs/source/user_guide/argo_workflows.md deleted file mode 100644 index a5c3da996c..0000000000 --- a/docs/source/user_guide/argo_workflows.md +++ /dev/null @@ -1,32 +0,0 @@ -# Argo Workflows - -Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. Argo -workflows comes enabled by default with Nebari deployments. - -## Accessing Argo Server - -If Argo Workflows is enabled, users can access argo workflows server at: `your-nebari-domain.com/argo`. Log in via -Keycloak with your usual credentials. - -## Submitting a Workflow via Argo Server - -You can submit a workflow by clicking "SUBMIT NEW WORKFLOW" on the landing page assuming you have the appropriate -permissions. - -![Argo Server Landing Page](../images/argo-server-landing-page.png) - -## Submitting a workflow via Argo CLI - -You can submit or manage workflows via the Argo CLI. The Argo CLI can be downloaded from the -[Argo Releases](https://github.com/argoproj/argo-workflows/releases) page. After downloading the CLI, you can get your -token from the Argo Server UI by clicking on the user tab in the bottom left corner and then clicking "Copy To -Clipboard". You'll need to make a few edits to access to what was copied for Argo CLI to work correctly. The base href -should be `ARGO_BASE_HREF=/argo` in the default nebari installation and you need to set the namespace where Argo was -deployed (dev by default) `ARGO_NAMESPACE=dev`. After setting those variables and the others copied from the Argo Server -UI, you can check that things are working by running `argo list`. - -![Argo Workflows User Tab](../images/argo-workflows-user-tab.png) - -## Additional Argo Workflows Resources - -Refer to the [Argo documentation](https://argoproj.github.io/argo-workflows/) for further details on Argo Workflows. diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/cluster_information.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/cluster_information.json deleted file mode 100644 index d6730a7755..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/cluster_information.json +++ /dev/null @@ -1,978 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "iteration": 1681232789057, - "links": [], - "liveNow": false, - "panels": [ - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 2, - "panels": [], - "showTitle": true, - "title": "Cluster Stats", - "titleSize": "h6", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "description": "Count of running users, grouped by namespace\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 3, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "# Sum up all running user pods by namespace\nsum(\n # Grab a list of all running pods.\n # The group aggregator always returns \"1\" for the number of times each\n # unique label appears in the time series. This is desirable for this\n # use case because we're merely identifying running pods by name,\n # not how many times they might be running.\n group(\n kube_pod_status_phase{phase=\"Running\"}\n ) by (pod)\n * on (pod) group_right() group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\"}\n ) by (namespace, pod)\n) by (namespace)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{namespace}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Running Users", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of total memory in the cluster currently requested by to non-placeholder pods.\n\nIf autoscaling is efficient, this should be a fairly constant, high number (>70%).\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 11 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # Get individual container memory requests\n kube_pod_container_resource_requests{resource=\"memory\"}\n # Add node pool name as label\n * on(node) group_left(label_cloud_google_com_gke_nodepool)\n # group aggregator ensures that node names are unique per\n # pool.\n group(\n kube_node_labels\n ) by (node, label_cloud_google_com_gke_nodepool)\n # Ignore containers from pods that aren't currently running or scheduled\n # FIXME: This isn't the best metric here, evaluate what is.\n and on (pod) kube_pod_status_scheduled{condition='true'}\n # Ignore user and node placeholder pods\n and on (pod) kube_pod_labels{label_component!~'user-placeholder|node-placeholder'}\n) by (label_cloud_google_com_gke_nodepool)\n/\nsum(\n # Total allocatable memory on a node\n kube_node_status_allocatable{resource=\"memory\"}\n # Add nodepool name as label\n * on(node) group_left(label_cloud_google_com_gke_nodepool)\n # group aggregator ensures that node names are unique per\n # pool.\n group(\n kube_node_labels\n ) by (node, label_cloud_google_com_gke_nodepool)\n) by (label_cloud_google_com_gke_nodepool)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{label_cloud_google_com_gke_nodepool}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Memory commitment %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of total CPU in the cluster currently requested by to non-placeholder pods.\n\nJupyterHub users mostly are capped by memory, so this is not super useful.\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 11 - }, - "hiddenSeries": false, - "id": 5, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # Get individual container memory requests\n kube_pod_container_resource_requests{resource=\"cpu\"}\n # Add node pool name as label\n * on(node) group_left(label_cloud_google_com_gke_nodepool)\n # group aggregator ensures that node names are unique per\n # pool.\n group(\n kube_node_labels\n ) by (node, label_cloud_google_com_gke_nodepool)\n # Ignore containers from pods that aren't currently running or scheduled\n # FIXME: This isn't the best metric here, evaluate what is.\n and on (pod) kube_pod_status_scheduled{condition='true'}\n # Ignore user and node placeholder pods\n and on (pod) kube_pod_labels{label_component!~'user-placeholder|node-placeholder'}\n) by (label_cloud_google_com_gke_nodepool)\n/\nsum(\n # Total allocatable CPU on a node\n kube_node_status_allocatable{resource=\"cpu\"}\n # Add nodepool name as label\n * on(node) group_left(label_cloud_google_com_gke_nodepool)\n # group aggregator ensures that node names are unique per\n # pool.\n group(\n kube_node_labels\n ) by (node, label_cloud_google_com_gke_nodepool)\n) by (label_cloud_google_com_gke_nodepool)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{label_cloud_google_com_gke_nodepool}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "CPU commitment %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 21 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "# sum up all nodes by nodepool\nsum(\n # kube_pod_labels comes from\n # https://github.com/kubernetes/kube-state-metrics, and there is a particular\n # label (kubernetes_node) that lists the node on which the kube-state-metrics pod\n # s running! So that's totally irrelevant to these queries, but when a nodepool\n # is rotated it caused there to exist two metrics with the same node value (which\n # we care about) but different kubernetes_node values (because kube-state-metrics\n # was running in a different node, even though we don't care about that). This\n # group really just drops all labels except the two we care about to\n # avoid messing things up.\n group(\n kube_node_labels\n ) by (node, label_cloud_google_com_gke_nodepool)\n) by (label_cloud_google_com_gke_nodepool)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{label_cloud_google_com_gke_nodepool}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Node Count", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "description": "Pods in states other than 'Running'.\n\nIn a functional clusters, pods should not be in non-Running states for long.\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 21 - }, - "hiddenSeries": false, - "id": 7, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "hideZero": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(kube_pod_status_phase{phase!=\"Running\"}) by (phase)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{phase}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Non Running Pods", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 31 - }, - "id": 8, - "panels": [], - "showTitle": true, - "title": "Node Stats", - "titleSize": "h6", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of available CPUs currently in use\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 32 - }, - "id": 9, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(node_cpu_seconds_total{mode!=\"idle\"}[5m])) by (node)\n/\nsum(kube_node_status_capacity{resource=\"cpu\"}) by (node)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ node }}", - "refId": "A" - } - ], - "thresholds": [], - "title": "Node CPU Utilization %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of available Memory currently in use\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 32 - }, - "id": 10, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "1 - (\n sum (\n # Memory that can be allocated to processes when they need\n node_memory_MemFree_bytes + # Unused bytes\n node_memory_Cached_bytes + # Shared memory + temporary disk cache\n node_memory_Buffers_bytes # Very temporary buffer memory cache for disk i/o\n ) by (node)\n /\n sum(node_memory_MemTotal_bytes) by (node)\n)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{node}}", - "refId": "A" - } - ], - "thresholds": [], - "title": "Node Memory Utilization %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of each node guaranteed to pods on it\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 42 - }, - "id": 11, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # Get individual container CPU limits\n kube_pod_container_resource_requests{resource=\"cpu\"}\n # Ignore containers from pods that aren't currently running or scheduled\n # FIXME: This isn't the best metric here, evaluate what is.\n and on (pod) kube_pod_status_scheduled{condition='true'}\n # Ignore user and node placeholder pods\n and on (pod) kube_pod_labels{label_component!~'user-placeholder|node-placeholder'}\n) by (node)\n/\nsum(\n # Get individual container CPU requests\n kube_node_status_allocatable{resource=\"cpu\"}\n) by (node)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{node}}", - "refId": "A" - } - ], - "thresholds": [], - "title": "Node CPU Commit %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "% of each node guaranteed to pods on it\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 42 - }, - "id": 12, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # Get individual container memory limits\n kube_pod_container_resource_requests{resource=\"memory\"}\n # Ignore containers from pods that aren't currently running or scheduled\n # FIXME: This isn't the best metric here, evaluate what is.\n and on (pod) kube_pod_status_scheduled{condition='true'}\n # Ignore user and node placeholder pods\n and on (pod) kube_pod_labels{label_component!~'user-placeholder|node-placeholder'}\n) by (node)\n/\nsum(\n # Get individual container memory requests\n kube_node_status_allocatable{resource=\"memory\"}\n) by (node)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{node}}", - "refId": "A" - } - ], - "thresholds": [], - "title": "Node Memory Commit %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "description": "Number of Out of Memory (OOM) kills in a given node.\n\nWhen users use up more memory than they are allowed, the notebook kernel they\nwere running usually gets killed and restarted. This graph shows the number of times\nthat happens on any given node, and helps validate that a notebook kernel restart was\ninfact caused by an OOM\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 52 - }, - "id": 13, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "hideZero": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "# We use [2m] here, as node_exporter usually scrapes things at 1min intervals\n# And oom kills are distinct events, so we want to see 'how many have just happened',\n# rather than average over time.\nincrease(node_vmstat_oom_kill[2m])\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ node }}", - "refId": "A" - } - ], - "thresholds": [], - "title": "Out of Memory kill count", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ] - } - ], - "refresh": "5s", - "schemaVersion": 34, - "style": "dark", - "tags": [ - "jupyterhub", - "kubernetes" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 1, - "includeAll": false, - "multi": false, - "name": "PROMETHEUS_DS", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "browser", - "title": "Cluster Information", - "uid": "-whBDuL4k", - "version": 1, - "weekStart": "" -} diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/conda_store.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/conda_store.json deleted file mode 100644 index 724b130bc0..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/conda_store.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "description": "", - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 6, - "panels": [], - "title": "Environments", - "type": "row" - }, - { - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 1 - }, - "id": 18, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_queued", - "interval": "", - "legendFormat": "conda_store_build_queued", - "refId": "Queued" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_building", - "hide": false, - "instant": false, - "interval": "", - "legendFormat": "conda_store_build_building", - "refId": "Building" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_completed", - "hide": false, - "instant": false, - "interval": "", - "legendFormat": "conda_store_build_completed", - "refId": "Completed" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_failed", - "hide": false, - "interval": "", - "legendFormat": "conda_store_build_failed", - "refId": "Failed" - } - ], - "title": "Builds", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 0, - "y": 8 - }, - "id": 8, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_environments", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Environments", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 3, - "y": 8 - }, - "id": 10, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_queued", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Queued", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 6, - "y": 8 - }, - "id": 12, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_building", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Buliding", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 9, - "y": 8 - }, - "id": 14, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_completed", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Completed", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 12, - "y": 8 - }, - "id": 16, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_build_failed", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Failed", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 11 - }, - "id": 4, - "panels": [], - "title": "Storage", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 0.8 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 0, - "y": 12 - }, - "id": 2, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_disk_usage / conda_store_disk_total", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Disk Usage", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "decgbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 7, - "x": 8, - "y": 12 - }, - "id": 20, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_disk_total / (2.0^30)", - "instant": false, - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Total Storage", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decgbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 7, - "x": 15, - "y": 12 - }, - "id": 22, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "conda_store_disk_usage / (2^30)", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Disk Used", - "type": "stat" - } - ], - "refresh": "5s", - "schemaVersion": 34, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Conda-Store", - "uid": "7lHPaT1nz", - "version": 1, - "weekStart": "" -} diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/jupyterhub_dashboard.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/jupyterhub_dashboard.json deleted file mode 100644 index 0bbcfad3d1..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/jupyterhub_dashboard.json +++ /dev/null @@ -1,1350 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "iteration": 1681169262003, - "links": [], - "liveNow": false, - "panels": [ - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 2, - "panels": [], - "showTitle": true, - "title": "Hub usage stats", - "titleSize": "h6", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 3, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n group(\n kube_pod_status_phase{phase=\"Running\"}\n ) by (label_component, pod, namespace)\n * on (namespace, pod) group_right() \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (namespace)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{namespace}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Currently Active Users", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 12 - }, - "id": 7, - "panels": [], - "showTitle": true, - "title": "User Resource Utilization stats", - "titleSize": "h6", - "type": "row" - }, - { - "cards": {}, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateViridis", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 13 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 8, - "legend": { - "show": false - }, - "reverseYBuckets": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "(\n time()\n - (\n kube_pod_created{job='kube-state-metrics'}\n * on (namespace, pod) group_left()\n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n )\n)\n", - "format": "time_series", - "interval": "600s", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "User active age distribution", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketSize": "600s", - "yAxis": { - "format": "s", - "logBase": 1, - "min": 0, - "show": true - }, - "yBucketBound": "auto" - }, - { - "cards": {}, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateViridis", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 13 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 9, - "legend": { - "show": false - }, - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(\n # exclude name=\"\" because the same container can be reported\n # with both no name and `name=k8s_...`,\n # in which case sum() by (pod) reports double the actual metric\n irate(container_cpu_usage_seconds_total{name!=\"\"}[5m])\n * on (namespace, pod) group_left(container) \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (pod)\n", - "format": "time_series", - "interval": "600s", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "User CPU usage distribution", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketSize": "600s", - "yAxis": { - "format": "percentunit", - "logBase": 1, - "min": 0, - "show": true - }, - "yBucketBound": "auto" - }, - { - "cards": {}, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateViridis", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 23 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 10, - "legend": { - "show": false - }, - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(\n # exclude name=\"\" because the same container can be reported\n # with both no name and `name=k8s_...`,\n # in which case sum() by (pod) reports double the actual metric\n container_memory_working_set_bytes{name!=\"\"}\n * on (namespace, pod) group_left(container) \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (pod)\n", - "format": "time_series", - "interval": "600s", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "User memory usage distribution", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketSize": "600s", - "yAxis": { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - }, - "yBucketBound": "auto" - }, - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 33 - }, - "id": 11, - "panels": [], - "showTitle": true, - "title": "Hub Diagnostics", - "titleSize": "h6", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 34 - }, - "hiddenSeries": false, - "id": 12, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 2, - "points": true, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "histogram_quantile(0.99, sum(rate(jupyterhub_server_spawn_duration_seconds_bucket{}[5m])) by (le))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "99th percentile", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "histogram_quantile(0.5, sum(rate(jupyterhub_server_spawn_duration_seconds_bucket{}[5m])) by (le))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "50th percentile", - "refId": "B" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Server Start Times", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "Attempts by users to start servers that failed.\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 34 - }, - "hiddenSeries": false, - "id": 13, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "hideZero": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(increase(jupyterhub_server_spawn_duration_seconds_count{status!=\"success\"}[2m])) by (status)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{status}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Server Start Failures", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 44 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "histogram_quantile(\n 0.99,\n sum(\n rate(\n jupyterhub_request_duration_seconds_bucket{\n # Ignore SpawnProgressAPIHandler, as it is a EventSource stream\n # and keeps long lived connections open\n handler!=\"jupyterhub.apihandlers.users.SpawnProgressAPIHandler\"\n }[5m]\n )\n ) by (le))\n", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "99th percentile", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "histogram_quantile(\n 0.50,\n sum(\n rate(\n jupyterhub_request_duration_seconds_bucket{\n app=\"jupyterhub\",\n namespace=~\"$hub\",\n # Ignore SpawnProgressAPIHandler, as it is a EventSource stream\n # and keeps long lived connections open\n handler!=\"jupyterhub.apihandlers.users.SpawnProgressAPIHandler\"\n }[5m]\n )\n ) by (le))\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "50th percentile", - "refId": "B" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Hub response latency", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 12, - "w": 12, - "x": 12, - "y": 44 - }, - "hiddenSeries": false, - "id": 15, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # exclude name=\"\" because the same container can be reported\n# with both no name and `name=k8s_...`,\n# in which case sum() reports double the actual metric\nirate(container_cpu_usage_seconds_total{name!=\"\"}[5m])\n\n * on (namespace, pod) group_left(container, label_component) \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component!=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (label_component)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ label_component }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "All JupyterHub Components CPU", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 1, - "format": "percentunit", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 12, - "w": 12, - "x": 0, - "y": 54 - }, - "hiddenSeries": false, - "id": 16, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # exclude name=\"\" because the same container can be reported\n# with both no name and `name=k8s_...`,\n# in which case sum() reports double the actual metric\ncontainer_memory_working_set_bytes{name!=\"\"}\n\n * on (namespace, pod) group_left(container, label_component) \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component!=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (label_component)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ label_component }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "All JupyterHub Components Memory (Working Set)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "description": "% of disk space left in the disk storing the JupyterHub sqlite database. If goes to 0, the hub will fail.\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 56 - }, - "hiddenSeries": false, - "id": 17, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "# Free bytes available on the hub db PVC\nsum(kubelet_volume_stats_available_bytes{persistentvolumeclaim=\"hub-db-dir\", namespace=~\"$hub\"}) by (namespace) /\n# Total number of bytes available on the hub db PVC\nsum(kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=\"hub-db-dir\", namespace=~\"$hub\"}) by (namespace)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ $hub }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Hub DB Disk Space Availability %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "description": "Pods in a non-running state in the hub's namespace.\n\nPods stuck in non-running states often indicate an error condition\n", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 66 - }, - "hiddenSeries": false, - "id": 18, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n kube_pod_status_phase{phase!=\"Running\", namespace=~\"$hub\"}\n) by (phase)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{phase}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Non Running Pods", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "decimals": 0, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 66 - }, - "hiddenSeries": false, - "id": 19, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n # kube_pod_info.node identifies the pod node,\n # while kube_pod_labels.node is the metrics exporter's node\n kube_pod_info{node!=\"\"}\n * on (namespace, pod) group_left() \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (node)\n", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{ node }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Users per node", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - }, - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapse": false, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 76 - }, - "id": 21, - "panels": [], - "showTitle": true, - "title": "Anomalous user pods", - "titleSize": "h6", - "type": "row" - }, - { - "columns": [], - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "description": "User pods that have been running for a long time (>8h).\n\nThis often indicates problems with the idle culler\n", - "fontSize": "100%", - "gridPos": { - "h": 12, - "w": 12, - "x": 0, - "y": 77 - }, - "id": 22, - "links": [], - "showHeader": true, - "sort": { - "col": 2, - "desc": true - }, - "styles": [ - { - "alias": "Age", - "align": "auto", - "pattern": "Value", - "type": "number", - "unit": "s" - }, - { - "alias": "Time", - "align": "auto", - "pattern": "Time", - "type": "hidden" - } - ], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": false, - "expr": "(\n time() - (kube_pod_created * on (namespace, pod) group_left\n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace))\n) > (60 * 60 * 8) # 8 hours is our threshold\n", - "format": "time_series", - "instant": true, - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{namespace}}/{{pod}}", - "refId": "A" - } - ], - "title": "Very old user pods", - "transform": "timeseries_to_rows", - "type": "table-old" - }, - { - "columns": [], - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "description": "User pods using a lot of CPU\n\nThis could indicate a runaway process consuming resources\nunnecessarily.\n", - "fontSize": "100%", - "gridPos": { - "h": 12, - "w": 12, - "x": 12, - "y": 77 - }, - "id": 23, - "links": [], - "showHeader": true, - "sort": { - "col": 2, - "desc": true - }, - "styles": [ - { - "alias": "CPU usage", - "align": "auto", - "pattern": "Value", - "type": "number", - "unit": "percentunit" - }, - { - "alias": "Time", - "align": "auto", - "pattern": "Time", - "type": "hidden" - } - ], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": false, - "expr": "max( # Ideally we just want 'current' value, so max will do\n irate(container_cpu_usage_seconds_total[5m])\n * on (namespace, pod) group_left() \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (namespace, pod) > 0.5\n", - "format": "time_series", - "instant": true, - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{namespace}}/{{pod}}", - "refId": "A" - } - ], - "title": "User Pods with high CPU usage (>0.5)", - "transform": "timeseries_to_rows", - "type": "table-old" - }, - { - "columns": [], - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "description": "User pods getting close to their memory limit\n\nOnce they hit their memory limit, user kernels will start dying.\n", - "fontSize": "100%", - "gridPos": { - "h": 12, - "w": 12, - "x": 0, - "y": 89 - }, - "id": 24, - "links": [], - "showHeader": true, - "sort": { - "col": 2, - "desc": true - }, - "styles": [ - { - "alias": "% of mem limit consumed", - "align": "auto", - "pattern": "Value", - "type": "number", - "unit": "percentunit" - }, - { - "alias": "Time", - "align": "auto", - "pattern": "Time", - "type": "hidden" - } - ], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": false, - "expr": "max( # Ideally we just want 'current', but max will do. This metric is a gauge, so sum is inappropriate\n container_memory_working_set_bytes\n * on (namespace, pod) group_left() \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (namespace, pod)\n/\nsum(\n kube_pod_container_resource_limits{resource=\"memory\"}\n * on (namespace, pod) group_left() \n group(\n kube_pod_labels{label_app=\"jupyterhub\", label_component=\"singleuser-server\", namespace=~\"$hub\"}\n ) by (pod, namespace)\n) by (namespace, pod)\n> 0.8\n", - "format": "time_series", - "instant": true, - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{namespace}}/{{pod}}", - "refId": "A" - } - ], - "title": "User pods with high memory usage (>80% of limit)", - "transform": "timeseries_to_rows", - "type": "table-old" - } - ], - "refresh": "5s", - "schemaVersion": 34, - "style": "dark", - "tags": [ - "jupyterhub" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 1, - "includeAll": false, - "multi": false, - "name": "PROMETHEUS_DS", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": { - "selected": true, - "text": [ - "dev" - ], - "value": [ - "dev" - ] - }, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "hub", - "options": [], - "query": { - "query": "label_values(kube_service_labels{service=\"hub\"}, namespace)", - "refId": "Prometheus-hub-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "browser", - "title": "JupyterHub Dashboard", - "uid": "hub-dashboard", - "version": 1, - "weekStart": "" -} diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/keycloak.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/keycloak.json deleted file mode 100644 index 41fea2ad23..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/keycloak.json +++ /dev/null @@ -1,2165 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - }, - { - "datasource": "-- Grafana --", - "enable": true, - "iconColor": "rgba(0, 211, 255, 1)", - "iconSize": 0, - "lineColor": "", - "name": "Annotations & Alerts", - "query": "", - "showLine": false, - "tagsField": "", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "textField": "", - "type": "dashboard" - } - ] - }, - "description": "An updated version of dashboard Keycloak metrics exported with Keycloak Metrics SPI\n\nhttps://github.com/aerogear/keycloak-metrics-spi", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 14607, - "graphTooltip": 1, - "iteration": 1642196323079, - "links": [], - "liveNow": false, - "panels": [ - { - "CustomPanel": { - "datasource": "$Datasource", - "description": "Memory currently being used by Keycloak.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": {}, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "#EAB839", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 0 - }, - "hideTimeOverride": false, - "id": 5, - "links": [], - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "7.2.0", - "targets": [ - { - "expr": "sum(jvm_memory_bytes_used{instance=\"$instance\", area=\"heap\"})*100/sum(jvm_memory_bytes_max{instance=\"$instance\", area=\"heap\"})\n", - "format": "time_series", - "hide": false, - "instant": false, - "intervalFactor": 1, - "legendFormat": "", - "refId": "B" - } - ], - "title": "Current Memory HEAP", - "type": "gauge" - }, - "datasource": { - "uid": "$Datasource" - }, - "editable": false, - "error": false, - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 0 - }, - "hideTimeOverride": false, - "id": 5, - "isNew": false, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "span": 0, - "targets": [ - { - "expr": "sum(jvm_memory_bytes_used{pod=\"$instance\", area=\"heap\"})*100/sum(jvm_memory_bytes_max{pod=\"$instance\", area=\"heap\"})", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Current Memory HEAP", - "type": "gauge" - }, - { - "CustomPanel": { - "datasource": "$Datasource", - "description": "Memory currently being used by Keycloak.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": {}, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "#EAB839", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 6, - "y": 0 - }, - "hideTimeOverride": false, - "id": 23, - "links": [], - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "7.2.0", - "targets": [ - { - "expr": "sum(jvm_memory_bytes_used{instance=\"$instance\", area=\"nonheap\"})*100/sum(jvm_memory_bytes_max{instance=\"$instance\", area=\"nonheap\"})", - "format": "time_series", - "hide": false, - "instant": false, - "intervalFactor": 1, - "legendFormat": "", - "refId": "B" - } - ], - "title": "Current Memory nonHEAP", - "type": "gauge" - }, - "datasource": { - "uid": "$Datasource" - }, - "editable": false, - "error": false, - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 6, - "y": 0 - }, - "hideTimeOverride": false, - "id": 23, - "isNew": false, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "span": 0, - "targets": [ - { - "expr": "sum(jvm_memory_bytes_used{pod=\"$instance\", area=\"nonheap\"})*100/sum(jvm_memory_bytes_max{pod=\"$instance\", area=\"nonheap\"})", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Current Memory nonHEAP", - "type": "gauge" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 0 - }, - "hideTimeOverride": false, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum(jvm_memory_bytes_max{pod=\"$instance\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "A" - }, - { - "expr": "sum(jvm_memory_bytes_committed{pod=\"$instance\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Comitted", - "refId": "C" - }, - { - "expr": "sum(jvm_memory_bytes_used{pod=\"$instance\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Used", - "refId": "B" - } - ], - "title": "Memory Usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [], - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 7 - }, - "hideTimeOverride": true, - "id": 16, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum by (realm)(increase(keycloak_logins[24h]))", - "interval": "", - "legendFormat": "{{realm}}", - "refId": "A" - } - ], - "title": "Logins Per REALM for past 24h", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [], - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 6, - "y": 7 - }, - "id": 44, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "7.2.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum by (realm)(increase(keycloak_registrations[24h]))", - "interval": "", - "legendFormat": "{{realm}}", - "refId": "A" - } - ], - "title": "Registrations Per REALM for past 24h", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [], - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 7 - }, - "hideTimeOverride": true, - "id": 20, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum by (client_id)(increase(keycloak_logins[24h]))", - "interval": "", - "legendFormat": "{{client_id}}", - "refId": "A" - } - ], - "title": "Logins Per CLIENT for past 24h", - "type": "piechart" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [], - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 18, - "y": 7 - }, - "hideTimeOverride": true, - "id": 17, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "expr": "sum by (client_id)(increase(keycloak_registrations[24h]))", - "interval": "", - "legendFormat": "{{client_id}}", - "refId": "A" - } - ], - "title": "Registrations Per CLIENT for past 24h", - "type": "piechart" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 6, - "y": 14 - }, - "id": 46, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (code)(increase(keycloak_response_errors[30m]))", - "interval": "", - "legendFormat": "{{code}}", - "refId": "A" - } - ], - "title": "4xx and 5xx Responses", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 22 - }, - "hideTimeOverride": false, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum by (realm)(increase(keycloak_logins[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{realm}}", - "refId": "A" - } - ], - "title": "Logins per REALM", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 22 - }, - "hideTimeOverride": false, - "id": 7, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (error) (increase(keycloak_failed_login_attempts{provider=\"keycloak\",realm=\"$realm\"}[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{$realm }} {{error}}", - "refId": "A" - }, - { - "expr": "sum by (realm) (increase(keycloak_failed_login_attempts{provider=\"keycloak\",realm=\"dialog-test\"} [30m]))", - "interval": "", - "legendFormat": "{{sum by $realm}}", - "refId": "B" - } - ], - "title": "Login Errors on realm $realm", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 30 - }, - "hideTimeOverride": false, - "id": 18, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (client_id)(increase(keycloak_logins{realm=\"$realm\",provider=\"keycloak\"}[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{client_id}}", - "refId": "A" - } - ], - "title": "Logins per CLIENT on realm $realm", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 30 - }, - "hideTimeOverride": false, - "id": 21, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (realm) (increase(keycloak_registrations_errors{provider=\"keycloak\",realm=\"$realm\"} [30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "Sum by {{realm}}", - "refId": "A" - }, - { - "expr": "sum by (error) (increase(keycloak_registrations_errors{provider=\"keycloak\",realm=\"$realm\"} [30m]))", - "interval": "", - "legendFormat": "{{error}}", - "refId": "B" - } - ], - "title": "Registration Errors on realm $realm", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 38 - }, - "hideTimeOverride": false, - "id": 33, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (realm)(increase(keycloak_registrations[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{realm}}", - "refId": "A" - } - ], - "title": "Registrations per REALM", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 38 - }, - "hideTimeOverride": false, - "id": 19, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (error) (increase(keycloak_failed_login_attempts{provider=\"keycloak\",realm=\"$realm\",client_id=\"$ClientId\"}[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{error}}", - "refId": "A" - } - ], - "title": "Login Errors for $ClientId", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 46 - }, - "hideTimeOverride": false, - "id": 22, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (client_id)(increase(keycloak_registrations{realm=\"$realm\",provider=\"keycloak\"}[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{client_id}}", - "refId": "A" - }, - { - "expr": "sum by (realm)(increase(keycloak_registrations{provider=\"keycloak\",realm=\"$realm\"} [30m]))", - "interval": "", - "legendFormat": "Sum by {{realm}}", - "refId": "B" - } - ], - "title": "Registrations per CLIENT on Realm $realm", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 46 - }, - "hideTimeOverride": false, - "id": 34, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum by (error) (increase(keycloak_registrations_errors{provider=\"keycloak\",realm=\"$realm\",client_id=\"$ClientId\"}[30m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{error}}", - "refId": "A" - } - ], - "title": "Registration Errors for $ClientId", - "type": "timeseries" - }, - { - "cards": {}, - "color": { - "cardColor": "#73BF69", - "colorScale": "sqrt", - "colorScheme": "interpolateGreens", - "exponent": 0.4, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 54 - }, - "heatmap": {}, - "hideTimeOverride": false, - "hideZeroBuckets": true, - "highlightCards": true, - "id": 35, - "legend": { - "show": true - }, - "pluginVersion": "7.2.0", - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(increase(keycloak_request_duration_bucket{method=\"GET\"}[30m])) by (le)", - "format": "heatmap", - "interval": "", - "intervalFactor": 4, - "legendFormat": "{{ le }}", - "refId": "A" - } - ], - "title": "Request duration method = \"GET\" Heatmap", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "yAxis": { - "format": "ms", - "logBase": 1, - "show": true - }, - "yBucketBound": "auto" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "red", - "value": 80 - }, - { - "color": "#EAB839", - "value": 90 - }, - { - "color": "green", - "value": 98 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 54 - }, - "hideTimeOverride": false, - "id": 39, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum(rate(keycloak_request_duration_bucket{method=\"GET\", le=\"100.0\"}[30m])) / sum(rate(keycloak_request_duration_count{method=\"GET\"}[30m])) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Percentage of requests \"GET\" method was served in 100ms or below", - "type": "gauge" - }, - { - "cards": {}, - "color": { - "cardColor": "#73BF69", - "colorScale": "sqrt", - "colorScheme": "interpolateGreens", - "exponent": 0.4, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 62 - }, - "heatmap": {}, - "hideTimeOverride": false, - "hideZeroBuckets": true, - "highlightCards": true, - "id": 36, - "legend": { - "show": true - }, - "pluginVersion": "7.2.0", - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(increase(keycloak_request_duration_bucket{method=\"POST\"}[30m])) by (le)", - "format": "heatmap", - "interval": "", - "intervalFactor": 4, - "legendFormat": "{{ le }}", - "refId": "A" - } - ], - "title": "Request duration method = \"POST\" Heatmap", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "yAxis": { - "format": "ms", - "logBase": 1, - "show": true - }, - "yBucketBound": "auto" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "red", - "value": 80 - }, - { - "color": "#EAB839", - "value": 90 - }, - { - "color": "green", - "value": 98 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 62 - }, - "hideTimeOverride": false, - "id": 40, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum(rate(keycloak_request_duration_bucket{method=\"POST\", le=\"100.0\"}[30m])) / sum(rate(keycloak_request_duration_count{method=\"POST\"}[30m])) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Percentage of requests \"POST\" method was served in 100ms or below", - "type": "gauge" - }, - { - "cards": {}, - "color": { - "cardColor": "#73BF69", - "colorScale": "sqrt", - "colorScheme": "interpolateGreens", - "exponent": 0.4, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 70 - }, - "heatmap": {}, - "hideTimeOverride": false, - "hideZeroBuckets": true, - "highlightCards": true, - "id": 37, - "legend": { - "show": true - }, - "pluginVersion": "7.2.0", - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(increase(keycloak_request_duration_bucket{method=\"HEAD\"}[30m])) by (le)", - "format": "heatmap", - "interval": "", - "intervalFactor": 4, - "legendFormat": "{{ le }}", - "refId": "A" - } - ], - "title": "Request duration method = \"HEAD\" Heatmap", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "yAxis": { - "format": "ms", - "logBase": 1, - "show": true - }, - "yBucketBound": "auto" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "red", - "value": 80 - }, - { - "color": "#EAB839", - "value": 90 - }, - { - "color": "green", - "value": 98 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 70 - }, - "hideTimeOverride": false, - "id": 41, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum(rate(keycloak_request_duration_bucket{method=\"HEAD\", le=\"100.0\"}[30m])) / sum(rate(keycloak_request_duration_count{method=\"HEAD\"}[30m])) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Percentage of requests \"HEAD\" method was served in 100ms or below", - "type": "gauge" - }, - { - "cards": {}, - "color": { - "cardColor": "#73BF69", - "colorScale": "sqrt", - "colorScheme": "interpolateGreens", - "exponent": 0.4, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 78 - }, - "heatmap": {}, - "hideTimeOverride": false, - "hideZeroBuckets": true, - "highlightCards": true, - "id": 38, - "legend": { - "show": true - }, - "pluginVersion": "7.2.0", - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum(increase(keycloak_request_duration_bucket{method=\"PUT\"}[30m])) by (le)", - "format": "heatmap", - "interval": "", - "intervalFactor": 4, - "legendFormat": "{{ le }}", - "refId": "A" - } - ], - "title": "Request duration method = \"PUT\" Heatmap", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "yAxis": { - "format": "ms", - "logBase": 1, - "show": true - }, - "yBucketBound": "auto" - }, - { - "datasource": { - "uid": "$Datasource" - }, - "description": "", - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "red", - "value": 80 - }, - { - "color": "#EAB839", - "value": 90 - }, - { - "color": "green", - "value": 98 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 78 - }, - "hideTimeOverride": false, - "id": 42, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "expr": "sum(rate(keycloak_request_duration_bucket{method=\"PUT\", le=\"100.0\"}[30m])) / sum(rate(keycloak_request_duration_count{method=\"PUT\"}[30m])) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Percentage of requests \"PUT\" method was served in 100ms or below", - "type": "gauge" - } - ], - "refresh": false, - "schemaVersion": 34, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "multi": false, - "name": "Datasource", - "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "allFormat": "", - "allValue": "", - "current": { - "selected": false, - "text": "None", - "value": "" - }, - "datasource": { - "uid": "$Datasource" - }, - "definition": "label_values(keycloak_logins,pod)", - "hide": 0, - "includeAll": false, - "label": "Instance", - "multi": false, - "multiFormat": "", - "name": "instance", - "options": [], - "query": { - "query": "label_values(keycloak_logins,pod)", - "refId": "Prometheus-instance-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allFormat": "", - "allValue": "", - "current": { - "selected": true, - "text": "master", - "value": "master" - }, - "datasource": { - "uid": "$Datasource" - }, - "definition": "", - "hide": 0, - "includeAll": false, - "label": "Realm", - "multi": false, - "multiFormat": "", - "name": "realm", - "options": [], - "query": { - "query": "label_values(keycloak_logins{provider=\"keycloak\"},realm)", - "refId": "Prometheus-realm-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allFormat": "", - "allValue": "", - "current": { - "selected": false, - "text": "admin-cli", - "value": "admin-cli" - }, - "datasource": { - "uid": "$Datasource" - }, - "definition": "", - "hide": 0, - "includeAll": false, - "label": "ClientId", - "multi": false, - "multiFormat": "", - "name": "ClientId", - "options": [], - "query": { - "query": "label_values(keycloak_logins{provider=\"keycloak\",realm=\"$realm\"},client_id)", - "refId": "Prometheus-ClientId-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-30d", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Keycloak Metrics Dashboard", - "uid": "keycloak-dashboard", - "version": 2, - "weekStart": "" -} diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/traefik.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/traefik.json deleted file mode 100644 index 503b48af7c..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/traefik.json +++ /dev/null @@ -1,1254 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "description": "Traefik Metrics Overview", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 13165, - "graphTooltip": 1, - "iteration": 1681240333933, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 21, - "panels": [], - "title": "General", - "type": "row" - }, - { - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "rgb(31, 120, 193)", - "mode": "fixed" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 0, - "y": 1 - }, - "id": 13, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "count(kube_pod_status_ready{namespace=\"$namespace\",condition=\"true\",pod=~\"nebari-traefik-ingress-.*\", job=\"kube-state-metrics\"})", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Running instances", - "type": "stat" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 21, - "x": 3, - "y": 1 - }, - "hiddenSeries": false, - "id": 29, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "histogram_quantile(0.$percentiles, sum(rate(traefik_entrypoint_request_duration_seconds_bucket{code=~\"2..\"}[5m])) by (instance, le))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ instance }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Per instance latency $percentiles th perc over 5 min", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "logBase": 1, - "min": "0", - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 17, - "panels": [], - "title": "Entrypoints", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$Prometheus" - }, - "fill": 7, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 9 - }, - "hiddenSeries": false, - "id": 19, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(traefik_entrypoint_open_connections) by (method)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ method }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Open Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "logBase": 1, - "min": "0", - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$Prometheus" - }, - "decimals": 2, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 9 - }, - "hiddenSeries": false, - "id": 22, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "(sum(rate(traefik_entrypoint_request_duration_seconds_bucket{le=\"0.1\",code=\"200\"}[5m])) by (job) + sum(rate(traefik_entrypoint_request_duration_seconds_bucket{le=\"0.3\",code=\"200\"}[5m])) by (job)) / 2 / sum(rate(traefik_entrypoint_request_duration_seconds_count{code=\"200\"}[5m])) by (job)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Code 200", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Apdex score (over 5 min)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "decimals": 2, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 16 - }, - "hiddenSeries": false, - "id": 3, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(rate(traefik_entrypoint_requests_total[1m])) by (entrypoint)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{ entrypoint }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Requests/min per entrypoint", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "decimals": 2, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 24, - "panels": [], - "title": "Services", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$Prometheus" - }, - "decimals": 0, - "fill": 7, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 27 - }, - "hiddenSeries": false, - "id": 25, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(traefik_service_open_connections) by (method)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ method }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Open Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 27 - }, - "hiddenSeries": false, - "id": 26, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "(sum(rate(traefik_service_request_duration_seconds_bucket{le=\"0.1\",code=\"200\"}[5m])) by (job) + sum(rate(traefik_service_request_duration_seconds_bucket{le=\"0.3\",code=\"200\"}[5m])) by (job)) / 2 / sum(rate(traefik_service_request_duration_seconds_count{code=\"200\"}[5m])) by (job)", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "200", - "refId": "A" - }, - { - "exemplar": true, - "expr": "traefik_service_request_duration_seconds_bucket{le=\"0.1\",code=\"200\"}", - "hide": false, - "interval": "", - "legendFormat": "", - "refId": "B" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Apdex score (over 5 min)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "short", - "logBase": 1, - "min": "0", - "show": true - }, - { - "format": "short", - "logBase": 1, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "decimals": 2, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 34 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "avg", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(rate(traefik_service_requests_total[1m])) by (service)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{ service }}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Requests/min per service", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "decimals": 2, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 44 - }, - "id": 15, - "panels": [], - "title": "HTTP Codes stats", - "type": "row" - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$Prometheus" - }, - "decimals": 0, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 45 - }, - "hiddenSeries": false, - "id": 5, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": false, - "hideZero": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": true, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "count(rate(traefik_service_requests_total{code=~\"[2|3|4|5]..\"}[5m])) by (method, code)", - "format": "time_series", - "interval": "1", - "intervalFactor": 2, - "legendFormat": "{{method}} : {{code}}", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Status method/codes over 5min", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "short", - "logBase": 1, - "min": "0", - "show": true - }, - { - "decimals": 2, - "format": "short", - "logBase": 1, - "min": "0", - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 54 - }, - "id": 35, - "panels": [], - "title": "Pods resources", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 55 - }, - "hiddenSeries": false, - "id": 31, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(container_memory_usage_bytes{namespace=\"$namespace\",pod=~\".*traefik.*\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Memory used", - "refId": "A" - }, - { - "exemplar": true, - "expr": "sum(kube_pod_container_resource_requests_memory_bytes{namespace=\"$namespace\",pod=~\".*traefik.*\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Requested memory", - "refId": "B" - }, - { - "exemplar": true, - "expr": "sum(kube_pod_container_resource_limits_memory_bytes{namespace=\"$namespace\",pod=~\".*traefik.*\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Limit memory usage", - "refId": "C" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Traefik memory usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$Prometheus" - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 55 - }, - "hiddenSeries": false, - "id": 33, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\",pod=~\".*traefik.*\"}[2m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Cpu used", - "refId": "A" - }, - { - "exemplar": true, - "expr": "sum(kube_pod_container_resource_requests_cpu_cores{namespace=\"$namespace\",pod=\".*traefik.*\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Requested cpu", - "refId": "B" - }, - { - "exemplar": true, - "expr": "sum(kube_pod_container_resource_limits_cpu_cores{namespace=\"$namespace\",pod=\".*traefik.*\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "Limit cpu usage", - "refId": "C" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Traefik CPU usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - } - ], - "refresh": "10s", - "schemaVersion": 34, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "label": "Datasource", - "multi": false, - "name": "Prometheus", - "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": { - "selected": true, - "text": "dev", - "value": "dev" - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "definition": "label_values(kube_pod_container_info{pod=~\".*traefik.*\"}, namespace)", - "hide": 0, - "includeAll": false, - "label": "Namespace", - "multi": false, - "name": "namespace", - "options": [], - "query": { - "query": "label_values(kube_pod_container_info{pod=~\".*traefik.*\"}, namespace)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": { - "selected": true, - "text": "95", - "value": "95" - }, - "hide": 0, - "includeAll": false, - "label": "Percentiles", - "multi": false, - "name": "percentiles", - "options": [ - { - "selected": true, - "text": "95", - "value": "95" - }, - { - "selected": false, - "text": "99", - "value": "99" - } - ], - "query": "95,99", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Traefik", - "uid": "2p6nlgS7z", - "version": 1, - "weekStart": "" -} diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/usage_report.json b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/usage_report.json deleted file mode 100644 index 6bef780268..0000000000 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/monitoring/dashboards/Main/usage_report.json +++ /dev/null @@ -1,296 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "iteration": 1681169345054, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "displayMode": "gradient", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "kube_pod_labels{\n label_app=\"jupyterhub\",\n label_component=\"singleuser-server\",\n namespace=~\"$hub\",\n job=\"kube-state-metrics\"\n}\n* on (namespace, pod) group_left()\nsum(\n container_memory_working_set_bytes{\n namespace=~\"$hub\",\n container=\"notebook\",\n name!=\"\",\n }\n) by (namespace, pod)\n", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{label_hub_jupyter_org_username}} ({{namespace}})", - "refId": "A" - } - ], - "title": "User pod memory usage", - "type": "bargauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 3, - "options": { - "displayMode": "gradient", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(\n kube_pod_labels{\n namespace=~\"$hub\",\n label_app_kubernetes_io_component=\"dask-worker\",\n }\n * on (namespace, pod) group_left()\n sum(\n container_memory_working_set_bytes{\n namespace=~\"$hub\",\n container=\"dask-worker\",\n name!=\"\",\n }\n ) by (namespace, pod)\n) by (label_gateway_dask_org_cluster)\n", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{label_hub_jupyter_org_username}}-{{label_gateway_dask_org_cluster}}", - "refId": "A" - } - ], - "title": "Dask-gateway worker pod memory usage", - "type": "bargauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "$PROMETHEUS_DS" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 4, - "options": { - "displayMode": "gradient", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(\n kube_pod_labels{\n namespace=~\"$hub\",\n label_app_kubernetes_io_component=\"dask-scheduler\",\n }\n * on (namespace, pod) group_left()\n sum(\n container_memory_working_set_bytes{\n namespace=~\"$hub\",\n container=\"dask-scheduler\",\n name!=\"\",\n }\n ) by (namespace, pod)\n) by (label_gateway_dask_org_cluster)\n", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{label_hub_jupyter_org_username}}-{{label_gateway_dask_org_cluster}}", - "refId": "A" - } - ], - "title": "Dask-gateway scheduler pod memory usage", - "type": "bargauge" - } - ], - "refresh": "5s", - "schemaVersion": 34, - "style": "dark", - "tags": [ - "jupyterhub", - "dask" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 1, - "includeAll": false, - "multi": false, - "name": "PROMETHEUS_DS", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": { - "selected": false, - "text": "dev", - "value": "dev" - }, - "datasource": { - "uid": "$PROMETHEUS_DS" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "multi": false, - "name": "hub", - "options": [], - "query": { - "query": "label_values(kube_service_labels{service=\"hub\"}, namespace)", - "refId": "Prometheus-hub-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "browser", - "title": "Usage Report", - "uid": "usage-report", - "version": 1, - "weekStart": "" -} diff --git a/tests/conftest.py b/tests/conftest.py index cbcef549f1..9a98c74d1d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,92 +1 @@ -from functools import partial -from unittest.mock import Mock - -import pytest - -from _nebari.initialize import render_config - -INIT_INPUTS = [ - # project, namespace, domain, cloud_provider, ci_provider, auth_provider - ("pytestdo", "dev", "do.nebari.dev", "do", "github-actions", "github"), - ("pytestaws", "dev", "aws.nebari.dev", "aws", "github-actions", "github"), - ("pytestgcp", "dev", "gcp.nebari.dev", "gcp", "github-actions", "github"), - ("pytestazure", "dev", "azure.nebari.dev", "azure", "github-actions", "github"), -] - -NEBARI_CONFIG_FN = "nebari-config.yaml" -PRESERVED_DIR = "preserved_dir" -DEFAULT_GH_REPO = "github.com/test/test" -DEFAULT_TERRAFORM_STATE = "remote" - - -# use this partial function for all tests that need to call `render_config` -render_config_partial = partial( - render_config, - repository=DEFAULT_GH_REPO, - repository_auto_provision=False, - auth_auto_provision=False, - terraform_state=DEFAULT_TERRAFORM_STATE, - disable_prompt=True, -) - - -@pytest.fixture(params=INIT_INPUTS) -def setup_fixture(request, monkeypatch, tmp_path): - """This fixture helps simplify writing tests by: - - parametrizing the different cloud provider inputs in a single place - - creating a tmp directory (and file) for the `nebari-config.yaml` to be save to - - monkeypatching functions that call out to external APIs. - """ - render_config_inputs = request.param - ( - project, - namespace, - domain, - cloud_provider, - ci_provider, - auth_provider, - ) = render_config_inputs - - def _mock_kubernetes_versions(grab_latest_version=False): - # template for all `kubernetes_versions` calls - # monkeypatched to avoid making outbound API calls in CI - k8s_versions = ["1.18", "1.19", "1.20"] - m = Mock() - m.return_value = k8s_versions - if grab_latest_version: - m.return_value = k8s_versions[-1] - return m - - if cloud_provider == "aws": - monkeypatch.setattr( - "_nebari.utils.amazon_web_services.kubernetes_versions", - _mock_kubernetes_versions(), - ) - elif cloud_provider == "azure": - monkeypatch.setattr( - "_nebari.utils.azure_cloud.kubernetes_versions", - _mock_kubernetes_versions(), - ) - elif cloud_provider == "do": - monkeypatch.setattr( - "_nebari.utils.digital_ocean.kubernetes_versions", - _mock_kubernetes_versions(), - ) - elif cloud_provider == "gcp": - monkeypatch.setattr( - "_nebari.utils.google_cloud.kubernetes_versions", - _mock_kubernetes_versions(), - ) - - output_directory = tmp_path / f"{cloud_provider}_output_dir" - output_directory.mkdir() - nebari_config_loc = output_directory / NEBARI_CONFIG_FN - - # data that should NOT be deleted when `nebari render` is called - # see test_render.py::test_remove_existing_renders - preserved_directory = output_directory / PRESERVED_DIR - preserved_directory.mkdir() - preserved_filename = preserved_directory / "file.txt" - preserved_filename.write_text("This is a test...") - - yield (nebari_config_loc, render_config_inputs) +pytest_plugins = ["tests.common.playwright_fixtures"]