diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..d5c7146 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,233 @@ +name: E2E + +on: + workflow_dispatch: + schedule: + # Run everyday day at 9:00 AM + - cron: '0 9 * * *' + pull_request: + paths-ignore: + - 'scripts/**' + - '*.md' + push: + branches: + - 'release/*"' + - 'main' + - 'master' + +env: + GOARCH: amd64 + CGO_ENABLED: 0 + SETUP_GO_VERSION: '^1.19' + HOST_NAME: telemetry-test # for `start` script + CLUSTER_NAME: telemetry-test + TOKEN: ${{ secrets.TOKEN }} + REPO: telemetry-stats + REPO_URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + REPOSITORY: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + TELEMETRY_REPO: https://github.com/rancher/telemetry + TELEMETRY_BRANCH: ${{ vars.TELEMETRY_BRANCH || 'release' }} + +jobs: + single-cluster: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + path: telemetry-stats + + - name: Get latest tag for telemetry + uses: actions/github-script@v6 + id: latest_tag + if: ${{ env.TELEMETRY_BRANCH == 'release' }} + with: + script: | + const { data } = await github.rest.repos.getLatestRelease({ + owner: 'rancher', + repo: 'telemetry' + }) + return data.tag_name; + + - name: Replace TELEMETRY_BRANCH with latest tag + if: ${{ env.TELEMETRY_BRANCH == 'release' }} + run: | + export ACTUAL_TELEMETRY_BRANCH=${{ steps.latest_tag.outputs.result }} + echo "ACTUAL_TELEMETRY_BRANCH=${ACTUAL_TELEMETRY_BRANCH}" >> $GITHUB_ENV + + - name: Set ACTUAL_TELEMETRY_BRANCH to the value of TELEMETRY_BRANCH if still unset + if: ${{ env.TELEMETRY_BRANCH != 'release' }} + run: | + echo "ACTUAL_TELEMETRY_BRANCH=${TELEMETRY_BRANCH}" >> $GITHUB_ENV + + - name: Print TELEMETRY_BRANCH and ACTUAL_TELEMETRY_BRANCH + run: | + echo "TELEMETRY_BRANCH=${TELEMETRY_BRANCH}" + echo "ACTUAL_TELEMETRY_BRANCH=${ACTUAL_TELEMETRY_BRANCH}" + + - uses: actions/checkout@v3 + with: + repository: rancher/telemetry + path: telemetry + ref: ${{ env.ACTUAL_TELEMETRY_BRANCH }} + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.SETUP_GO_VERSION }} + + - name: Compile & containerize Telemetry + if: ${{ env.TELEMETRY_BRANCH != 'release' }} + run: | + set -x + + # Compile using dapper + cd telemetry + curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper + chmod +x /usr/local/bin/dapper + dapper + + # Build container image + export image_name="rancher/telemetry:${ACTUAL_TELEMETRY_BRANCH}" + + docker build \ + --network=host \ + -f package/Dockerfile \ + -t ${image_name} \ + . + + # Make name of resulting image available to other steps + echo "TELEMETRY_IMAGE=${image_name}" >> $GITHUB_ENV + + - name: Set remote container image for Telemetry release branch + if: ${{ env.TELEMETRY_BRANCH == 'release' }} + run: | + export image_name="rancher/telemetry:${ACTUAL_TELEMETRY_BRANCH}-amd64" + echo "TELEMETRY_IMAGE=${image_name}" >> $GITHUB_ENV + + - name: Compile & containerize Telemetry Stats + run: | + cd telemetry-stats + set +x + docker build \ + --network=host \ + --build-arg VERSION=dev \ + --build-arg upstream= \ + -t rancherlabs/rancher-telemetry-stats:dev \ + . + + - name: Provision k3d Cluster + uses: AbsaOSS/k3d-action@v2 + with: + cluster-name: ${{ env.CLUSTER_NAME }} + args: >- + --api-port 6443 + --network "nw01" + + - name: Upload Telemetry Docker image + if: ${{ env.TELEMETRY_BRANCH != 'release' }} + run: | + set -x + k3d image import -c ${{ env.CLUSTER_NAME }} rancher/telemetry:${ACTUAL_TELEMETRY_BRANCH} + + - name: Upload Telemetry Stats Docker image + run: | + k3d image import -c ${{ env.CLUSTER_NAME }} rancherlabs/rancher-telemetry-stats:dev + + - name: Install Rancher + run: | + set -ex + + echo "working directory: $(pwd)" + echo "files in working directory: $(find)" + + pip install httpie + cd telemetry-stats/e2e + source ./start + install-rancher + + # Verify + for i in {0..20}; do + ip=$( + kubectl get -A ingress -o json | + jq -r '.items[0].status.loadBalancer.ingress[0].ip' + ) + + if [[ "${ip}" == "null" ]]; then + sleep 1 + continue + fi + + if http --check-status --verify=no GET "https://${ip}" Host:${HOST_NAME} ; then + >&2 echo "Rancher installation successfully verified" + exit 0 + fi + + sleep 1 + done + + >&2 echo "Rancher installation test failed" + exit 1 + + - name: Configure Rancher + run: | + cd telemetry-stats/e2e && \ + source ./start && \ + CLUSTER_IP=$(get-cluster-ip) && \ + init-base "admin" + + - name: Install PostgreSQL + run: | + cd telemetry-stats/e2e && source ./start && install-postgres-13.2 + + - name: Install Telemetry Server from $TELEMETRY_BRANCH branch + run: | + set -x + cd telemetry-stats/e2e && source ./start && install-telemetry-server + + - name: Install Telemetry Client from $TELEMETRY_BRANCH branch + run: | + set -x + cd telemetry-stats/e2e && source ./start && install-telemetry-client + + - name: Install InfluxDB + run: | + cd telemetry-stats/e2e && source ./start && install-influx + + - name: Install Telemetry Stats + run: | + cd telemetry-stats/e2e && source ./start && \ + install-telemetry-stats-dev + + - name: Test installation + run: | + set -x + ns="${ns:-telemetry}" + cd telemetry-stats/e2e + kubectl -n "${ns}" apply --wait -k manifests/tests + + kubectl -n telemetry wait \ + --for=condition=complete \ + --timeout=300s \ + job/test-telemetry-server + + kubectl -n telemetry wait \ + --for=condition=complete \ + --timeout=300s \ + job/test-influxdb + + - name: Collect logs + if: failure() + run: | + bash telemetry-stats/e2e/kubectl-dump telemetry + + - name: Upload logs + uses: actions/upload-artifact@v3 + if: ${{ failure() && github.action }} + with: + name: gha-telemetry-dev-e2e-logs-${{ github.sha }}-${{ github.run_id }} + path: | + kubectl-dump-* + retention-days: 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c09bb9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +src/rancher-telemetry-stats +act-* diff --git a/Dockerfile b/Dockerfile index f652077..5afe92c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,23 @@ ARG GO_IMAGE=registry.suse.com/bci/golang:1.17 FROM ${GO_IMAGE} AS build +SHELL ["/bin/bash", "-c"] ARG upstream=https://github.com/rancherlabs/rancher-telemetry-stats.git ARG version WORKDIR /src - ENV NAME=rancher-telemetry-stats RUN zypper install -y tar wget gzip -RUN git clone --depth=1 --branch=${version} ${upstream} . + +# Conditionally clone the upstream repo or copy the local source, depending on +# whether the upstream is a git repo or a local directory. +ADD . /src-local +RUN if [[ "${upstream}" =~ "http" ]]; then \ + git clone --depth=1 --branch=${version} ${upstream} . ; \ + else \ + cp -r /src-local/* . ; \ + fi + +RUN echo DEBUG $(pwd) RUN cd src/ && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -v -a -tags netgo -o release/${NAME} RUN gzip -d src/GeoLite2-City.mmdb.gz diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 0000000..08a2ec1 --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,64 @@ +# E2E Tests + +This directory contains end-to-end tests for the project. These tests are +intended to be run in a Github Actions workflow if a Pull Request on Github is +created. You can run them locally, but you will need to set up a few things +first. And it's a bit more flaky. + +The tests will create a Kubernetes cluster using [k3d](https://k3d.io/). k3d +uses Docker and [k3s](https://k3s.io/) to create a lightweight Kubernetes +cluster for testing. + +The current amount of tests is very limited. For Telemetry, it merely tests if +the Telemetry client has successfully sent data to the Telemetry Server, which +stores the data in PostgreSQL. The test verifies that the data is there and can +be retrieved using Telemetry Server. For Telemetry Stats, the test verifies that +the data has been successfully stored in InfluxDB. The test retrieves the data +directly from InfluxDB. + +## Configuration + +### Telemetry branch to be used for testing + +The tests are configured via environment variables. They can be configured on +Github specifically for +[Actions](https://docs.github.com/en/actions/learn-github-actions/variables). +The following variables can be configured: + +- `TELEMETRY_BRANCH`: The branch to use for the test of Telemetry (not Telemetry + Stats). This can be any branch, tag, or commit hash. It defaults to `release`. + `release` is a special value that will result in the latest released container + image being downloaded and used for testing. Any other value will be taken as + a Git reference (branch, tag or reference) and the source code will be cloned, + built and a container image will be created and uploaded to the Kubernetes + cluster, so that the images will be available for use. + +# Running Tests Locally + +## Requirements + +- [act](https://github.com/nektos/act) +- [Docker](https://www.docker.com/) + +## Configuration + +A Personal Access token (PAT) from Github is required to run the tests locally. + +## Usage + +```console +act --env TELEMETRY_BRANCH=master --secret-file .env +``` + +Where `master` is the branch you want to test. You can also set it to "release" +to test an already released version, for which only the container image will be +downloaded but not built. In all other cases, the source code will be cloned, +built and a corresponding container image is being created and uploaded to the +Kubernetes cluster. + +The `--secret-file` option is required to pass the PAT to act. The file should +contain the following: + +```console +GITHUB_TOKEN=your-pat-here +``` diff --git a/e2e/kubectl-dump b/e2e/kubectl-dump new file mode 100755 index 0000000..bbe4fab --- /dev/null +++ b/e2e/kubectl-dump @@ -0,0 +1,85 @@ +#!/bin/bash + +set -x + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +NAMESPACE="$1" +DATE=$(date '+%Y-%m-%d_%H-%M-%S') +DUMP_DIR="kubectl-dump-${NAMESPACE}-${DATE}" +OUTPUT_FORMAT="${K8S_DEBUG_OUTPUT_FORMAT:-yaml}" + +mkdir -p "${DUMP_DIR}" + +declare -a resources=("pods" "services" "deployments" "replicasets" "configmaps" "secrets") + +function dump_resource() { + local resource="$1" + local objects="$(kubectl get "${resource}" \ + --namespace="${NAMESPACE}" \ + -o jsonpath='{.items[*].metadata.name}')" + + echo "Dumping ${resource}..." + echo "==============================" + kubectl get "${resource}" --namespace="${NAMESPACE}" | \ + tee "${DUMP_DIR}/${resource}.get.txt" + + for object in ${objects}; do + # Describe the resource in txt format and print it + echo "Dumping ${resource} '${object}'..." + echo "==============================" + kubectl describe "${resource}" "${object}" \ + --namespace="${NAMESPACE}" | tee \ + "${DUMP_DIR}/${resource}.${object}.describe.txt" + + # Describe the resource in the specified output format and save it + kubectl get "${resource}" "${object}" \ + --namespace="${NAMESPACE}" \ + -o "${OUTPUT_FORMAT}" > \ + "${DUMP_DIR}/${resource}.${object}.describe.${OUTPUT_FORMAT}" + done +} + +function collect_logs() { + local resource="$1" + local objects="$(kubectl get "${resource}" \ + --namespace="${NAMESPACE}" \ + -o jsonpath='{.items[*].metadata.name}')" + + echo "Collecting logs from ${resource}..." + echo "==============================" + for object in ${objects}; do + LOG_DIR="${DUMP_DIR}/logs/${object}" + mkdir -p "${LOG_DIR}" + CONTAINERS=$( + kubectl get "${resource}" "${object}" \ + --namespace="${NAMESPACE}" \ + -o jsonpath='{.spec.containers[*].name}' + ) + for CONTAINER in ${CONTAINERS}; do + kubectl logs --namespace="${NAMESPACE}" "${object}" -c "${CONTAINER}" | \ + tee "${LOG_DIR}/${CONTAINER}.log" + done + done +} + + +function main() { + echo "Retrieving information about Kubernetes resources in namespace '${NAMESPACE}'..." + for resource in "${resources[@]}"; do + dump_resource "${resource}" + done + + echo "Collecting logs from all pods in namespace '${NAMESPACE}'..." + collect_logs "pods" + + echo "All information collected and saved to '${DUMP_DIR}'." +} + +# If script is sourced, don't call main +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main +fi diff --git a/e2e/manifests/grafana/README.md b/e2e/manifests/grafana/README.md new file mode 100644 index 0000000..fa3cace --- /dev/null +++ b/e2e/manifests/grafana/README.md @@ -0,0 +1,20 @@ +# Grafana + +This folder uses a `kustomization.yaml` file to generate a config map from the +files in the `telemetry` subfolder. + +The resulting config map is too large to be applied client-side, where a +`metadata.annotations` field is added that contains the previous content of the +config map. It simply exceeds the 262144 max bytes it may have. + +Instead of the usual apply operating, use the server-side apply mechanism: +`kubectl apply --server-side`, which moves the logic of determining changes in +the manifest to the server and hence also doesn't create a +`last-applied-configuration` annotation. You still need to keep using the `-k` +flag to tell `kubectl` to run `kustomize`. + +Example: + +```console +kubectl apply --server-side -k manifests/grafana +``` diff --git a/e2e/manifests/grafana/dashboards.yaml b/e2e/manifests/grafana/dashboards.yaml new file mode 100644 index 0000000..9fc8aa7 --- /dev/null +++ b/e2e/manifests/grafana/dashboards.yaml @@ -0,0 +1,9 @@ +apiVersion: 1 + +providers: + - name: dashboards + type: file + updateIntervalSeconds: 30 + options: + path: /etc/dashboards + foldersFromFilesStructure: true diff --git a/e2e/manifests/grafana/dashboards/telemetry/dashboard-apps.json b/e2e/manifests/grafana/dashboards/telemetry/dashboard-apps.json new file mode 100644 index 0000000..d1cbc6b --- /dev/null +++ b/e2e/manifests/grafana/dashboards/telemetry/dashboard-apps.json @@ -0,0 +1,645 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 92, + "iteration": 1632936342366, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 23, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM \"v2_apps_24h\" WHERE $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Apps by Installation", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 23, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_catalog", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(total) FROM \"v2_apps_24h\" WHERE $timeFilter GROUP BY time(24h), \"catalog\"\n", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Apps by catalog", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 23, + "x": 0, + "y": 24 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM \"v2_apps_24h\" WHERE $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Apps by name", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 11, + "w": 23, + "x": 0, + "y": 36 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name-$tag_version", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM \"v2_apps_24h\" WHERE $timeFilter GROUP BY time(24h), \"name\", \"version\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Apps by version", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": true, + "text": "All", + "value": [ + "$__all" + ] + }, + "datasource": "telemetry", + "definition": "show tag values from telemetry_apps with key = \"catalog\"", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "app_catalog", + "options": [], + "query": "show tag values from telemetry_apps with key = \"catalog\"", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": true, + "text": "All", + "value": [ + "$__all" + ] + }, + "datasource": "telemetry", + "definition": "show tag values from telemetry_apps with key = \"name\" where \"catalog\" =~ /^$app_catalog$/", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "app_name", + "options": [], + "query": "show tag values from telemetry_apps with key = \"name\" where \"catalog\" =~ /^$app_catalog$/", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": true, + "text": "All", + "value": [ + "$__all" + ] + }, + "datasource": "telemetry", + "definition": "show tag values from telemetry_apps with key = \"version\" where \"name\" =~ /^$app_name$/", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "app_version", + "options": [], + "query": "show tag values from telemetry_apps with key = \"version\" where \"name\" =~ /^$app_name$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Apps", + "uid": "6kBikPVMz", + "version": 9 +} \ No newline at end of file diff --git a/e2e/manifests/grafana/dashboards/telemetry/dashboard-drivers.json b/e2e/manifests/grafana/dashboards/telemetry/dashboard-drivers.json new file mode 100644 index 0000000..e03c053 --- /dev/null +++ b/e2e/manifests/grafana/dashboards/telemetry/dashboard-drivers.json @@ -0,0 +1,550 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 93, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM \"v2_drivers_24h\" where kind = 'cluster' AND $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster drivers by installation", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM \"v2_drivers_24h\" where kind = 'cluster' AND $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster drivers by total", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 24 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM \"v2_drivers_24h\" where kind = 'node' AND $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Node driver by installation", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 36 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM \"v2_drivers_24h\" where kind = 'node' AND $timeFilter GROUP BY time(24h), \"name\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Node drivers by total", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Drivers", + "uid": "Noj1kC4Mz", + "version": 5 +} \ No newline at end of file diff --git a/e2e/manifests/grafana/dashboards/telemetry/dashboard-rancher.json b/e2e/manifests/grafana/dashboards/telemetry/dashboard-rancher.json new file mode 100644 index 0000000..da07bc6 --- /dev/null +++ b/e2e/manifests/grafana/dashboards/telemetry/dashboard-rancher.json @@ -0,0 +1,9697 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "iteration": 1632936060849, + "links": [], + "panels": [ + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 74, + "panels": [ + { + "circleMaxSize": 30, + "circleMinSize": 2, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 0, + "esMetric": "Count", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 11 + }, + "hideEmpty": false, + "hideZero": false, + "id": 37, + "initialZoom": 1, + "interval": "$agg_time", + "links": [], + "locationData": "countries", + "mapCenter": "(0°, 0°)", + "mapCenterLatitude": 0, + "mapCenterLongitude": 0, + "maxDataPoints": 1, + "mouseWheelZoom": false, + "showLegend": true, + "stickyLabels": true, + "tableQueryOptions": { + "geohashField": "geohash", + "latitudeField": "latitude", + "longitudeField": "longitude", + "metricField": "metric", + "queryType": "geohash" + }, + "targets": [ + { + "alias": "$tag_country_isocode", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "country_isocode" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "by_country_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM by_country_$agg_time WHERE $timeFilter GROUP BY time($interval), \"country_isocode\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "25,50", + "title": "Daily installations by country", + "type": "grafana-worldmap-panel", + "unitPlural": "", + "unitSingle": "", + "valueName": "total" + } + ], + "repeat": null, + "title": "World map", + "type": "row" + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 75, + "panels": [], + "repeat": null, + "title": "Installations", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 2 + }, + "hiddenSeries": false, + "id": 84, + "interval": "$agg_time", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + { + "url": "/" + } + ], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "v1.x-$tag_status", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version !~ /v2(.*)/ AND $timeFilter GROUP BY time($interval),status", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [] + }, + { + "alias": "v2.x-$tag_status", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "byUid_24h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version =~ /v2(.*)/ AND $timeFilter GROUP BY time($interval),status", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "install_version", + "operator": "=", + "value": "v1.0" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Installations reporting", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 2 + }, + "hiddenSeries": false, + "id": 50, + "interval": "$agg_time", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_country", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "country" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "/^$sourcedb$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM by_country_$agg_time WHERE $timeFilter GROUP BY time($interval), \"country\"", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "uid" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [] + }, + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"value\") FROM \"measurement\" WHERE $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Installations by country", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "telemetry", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 52, + "interval": "$agg_time", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + { + "url": "/" + } + ], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_install_version", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE \"install_version\" =~ /^$version/ AND $timeFilter GROUP BY time($interval),install_version", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Installations by version", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 12 + }, + "hiddenSeries": false, + "id": 53, + "interval": "$agg_time", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + { + "url": "/" + } + ], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_install_version", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE $timeFilter AND status = 'new' AND \"install_version\" =~ /^$version/ GROUP BY time($interval),install_version", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Installations by version - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 76, + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 0, + "y": 23 + }, + "id": 85, + "interval": "$agg_time", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM byUid_$agg_time WHERE install_version !~ /v2(.*)/ ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Total installations", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 4, + "y": 23 + }, + "id": 21, + "interval": "$agg_time", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) FROM byUid_$agg_time WHERE $timeFilter AND install_version !~ /v2(.*)/ GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Installations", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 8, + "y": 23 + }, + "id": 2, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"running\") FROM containers_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Containers running", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 12, + "y": 23 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM containers_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Containers total", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 16, + "y": 23 + }, + "id": 10, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "hosts_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"host\") FROM hosts_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "host" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Hosts total", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": null, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 20, + "y": 23 + }, + "id": 17, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"windows\") FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "windows" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "24,49", + "title": "Windows", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 0, + "y": 28 + }, + "id": 3, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "hosts_24h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cpu\") FROM hosts_1h WHERE $timeFilter ", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cpu" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "CPU cores", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "decmbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 4, + "y": 28 + }, + "id": 30, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "hosts_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"memory\") FROM hosts_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "memory" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Memory", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": null, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 8, + "y": 28 + }, + "id": 14, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_12h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"kubernetes\") FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "25,50", + "title": "Kubernetes", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": null, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 12, + "y": 28 + }, + "id": 16, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"swarm\") FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "swarm" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "25,50", + "title": "Swarm", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": null, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 16, + "y": 28 + }, + "id": 15, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_12h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"mesos\") FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "mesos" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "25,50", + "title": "Mesos", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": null, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 20, + "y": 28 + }, + "id": 8, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cattle\") as cattle FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "25,50", + "title": "Cattle", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 0, + "y": 33 + }, + "id": 4, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cattle\") + sum(\"kubernetes\") + sum(\"mesos\") + sum(\"swarm\") + sum(\"windows\") FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Total environments", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 4, + "y": 33 + }, + "id": 33, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "/^$sourcedb$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"active\") FROM stacks_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "stack_active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Stacks active", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 8, + "y": 33 + }, + "id": 34, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "/^$sourcedb$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM services_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "service_total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Services total", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 12, + "y": 33 + }, + "id": 35, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "/^$sourcedb$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"active\") FROM services_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "service_active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Services active", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "aliasColors": {}, + "cacheTimeout": null, + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": "$sourcedb", + "fontSize": "80%", + "format": "percent", + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 33 + }, + "id": 36, + "interval": "", + "legend": { + "percentage": true, + "show": true, + "values": false + }, + "legendType": "Right side", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "pieType": "pie", + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "strokeWidth": "1", + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cattle\") as cattle, sum(\"kubernetes\") as kubernetes, sum(\"mesos\") as mesos, sum(\"swarm\") as swarm, sum(\"windows\") as windows FROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "Orchestrators", + "type": "grafana-piechart-panel", + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 0, + "y": 38 + }, + "id": 32, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "stacks_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") FROM stacks_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Stacks total", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + } + ], + "repeat": "agg_time", + "scopedVars": { + "agg_time": { + "selected": true, + "text": "24h", + "value": "24h" + } + }, + "title": "Counters by agg_time_V1", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 77, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 49, + "interval": "$agg_time", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + { + "url": "/" + } + ], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_status", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version !~ /v2(.*)/ AND $timeFilter GROUP BY time($interval),status", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Installations reporting", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 20, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "orchestrators_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"kubernetes\") AS \"kubernetes\", sum(\"mesos\") AS \"mesos\", sum(\"swarm\") AS \"swarm\", sum(\"windows\") AS \"windows\", sum(\"cattle\") AS \"cattle\" \nFROM orchestrators_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "kubernetes" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mesos" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "mesos" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "swarm" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "swarm" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "windows" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "windows" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "cattle" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Orchestrators", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 38, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "orchestrators_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"kubernetes\") AS \"kubernetes\", sum(\"mesos\") AS \"mesos\", sum(\"swarm\") AS \"swarm\", sum(\"windows\") AS \"windows\", sum(\"cattle\") AS \"cattle\" \nFROM orchestrators_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "kubernetes" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mesos" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "mesos" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "swarm" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "swarm" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "windows" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "windows" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "cattle" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Orchestrators - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 46 + }, + "id": 26, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"running\") AS \"Running\" FROM containers_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Containers", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 46 + }, + "id": 39, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"running\") AS \"Running\" FROM containers_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Containers - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 57 + }, + "id": 27, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "services_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\" FROM services_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Services", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 57 + }, + "id": 40, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "services_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\" FROM services_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Services - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 68 + }, + "id": 28, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "stacks_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\" FROM stacks_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Stack", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 68 + }, + "id": 41, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "stacks_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\" FROM stacks_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "active" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Stack - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 79 + }, + "id": 31, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "hosts_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"host\") AS \"Hosts\", sum(\"cpu\") AS \"CPU\" FROM hosts_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "host" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cpu" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "CPU" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Hosts & CPU", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 79 + }, + "id": 42, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "hosts_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"host\") AS \"Hosts\", sum(\"cpu\") AS \"CPU\" FROM hosts_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "host" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Active" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cpu" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "CPU" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Hosts & CPU - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 90 + }, + "id": 25, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "hosts_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"memory\") AS \"Mem\" FROM hosts_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "memory" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Mem" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Hosts memory", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decmbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fill": 1, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 90 + }, + "id": 43, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "hosts_4h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"memory\") AS \"Mem\" FROM hosts_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "memory" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Mem" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Hosts memory - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decmbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "repeat": null, + "title": "Instant data by agg_time_V1", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 78, + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 0, + "y": 25 + }, + "id": 82, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version =~ /v2(.*)/ ", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Total installations", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 4, + "y": 25 + }, + "id": 65, + "interval": "$agg_time", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "installations_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version =~ /v2(.*)/ AND $timeFilter GROUP BY time($agg_time)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "i", + "operator": "=", + "value": "select tag value" + } + ] + } + ], + "thresholds": "0,0", + "title": "Installations", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 8, + "y": 25 + }, + "id": 67, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Clusters", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "decimals": 2, + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 12, + "y": 25 + }, + "id": 66, + "interval": "", + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "hosts_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\" FROM v2_nodes_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "host" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Nodes", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 16, + "y": 25 + }, + "id": 73, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"mem_mb\")/1024 as \"Mem Gb\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Memory Gb", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 20, + "y": 25 + }, + "id": 72, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cpu\") AS \"CPU\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "CPU cores", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 31 + }, + "id": 68, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"namespaces\") AS \"Namespaces\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Namespaces", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 6, + "y": 31 + }, + "id": 69, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Projects\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Projects", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 31 + }, + "id": 70, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"workloads\") AS \"workloads\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Workloads", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(60, 171, 55, 0.97)" + ], + "datasource": "$sourcedb", + "format": "short", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 18, + "y": 31 + }, + "id": 71, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "orchestrators_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"pods\") AS \"Pods\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cattle" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ], + [ + { + "params": [ + "kubernetes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "0,0", + "title": "Pods", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + } + ], + "repeat": null, + "title": "Counters by agg_time_V2", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 79, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 26 + }, + "hiddenSeries": false, + "id": 83, + "interval": "$agg_time", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + { + "url": "/" + } + ], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_status", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(distinct(\"uid\")) as total FROM byUid_$agg_time WHERE install_version =~ /v2(.*)/ AND $timeFilter GROUP BY time($interval),status", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Installations reporting", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 35 + }, + "hiddenSeries": false, + "id": 55, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\", sum(\"monitoring\") AS \"Monitoring\", sum(\"istio\") AS \"Istio\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + }, + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "telemetry", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 35 + }, + "hiddenSeries": false, + "id": 56, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\", sum(\"monitoring\") AS \"Monitoring\", sum(\"istio\") AS \"Istio\" FROM v2_clusters_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 45 + }, + "hiddenSeries": false, + "id": 88, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_aks\") AS \"AKS\", sum(\"cluster_eks\") AS \"EKS\", sum(\"cluster_gke\") AS \"GKE\", sum(\"cluster_imported\") AS \"imported\", sum(\"cluster_rke\") AS \"RKE\", sum(\"cluster_k3s\") AS \"K3S\", sum(\"cluster_k3sBased\") AS \"K3SBased\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters by driver", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 45 + }, + "hiddenSeries": false, + "id": 89, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_aks\") AS \"AKS\", sum(\"cluster_eks\") AS \"EKS\", sum(\"cluster_gke\") AS \"GKE\", sum(\"cluster_imported\") AS \"imported\", sum(\"cluster_rke\") AS \"RKE\" FROM v2_clusters_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters by driver - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 55 + }, + "hiddenSeries": false, + "id": 114, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_logging_provider_custom\") AS \"custom\", sum(\"cluster_logging_provider_elasticsearch\") AS \"elasticsearch\", sum(\"cluster_logging_provider_fluentd\") AS \"fluentd\", sum(\"cluster_logging_provider_kafka\") AS \"kafka\", sum(\"cluster_logging_provider_splunk\") AS \"splunk\", sum(\"cluster_logging_provider_syslog\") AS \"syslog\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters by logging", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 55 + }, + "hiddenSeries": false, + "id": 115, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_logging_provider_custom\") AS \"custom\", sum(\"cluster_logging_provider_elasticsearch\") AS \"elasticsearch\", sum(\"cluster_logging_provider_fluentd\") AS \"fluentd\", sum(\"cluster_logging_provider_kafka\") AS \"kafka\", sum(\"cluster_logging_provider_splunk\") AS \"splunk\", sum(\"cluster_logging_provider_syslog\") AS \"syslog\" FROM v2_clusters_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Clusters by logging - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 65 + }, + "hiddenSeries": false, + "id": 92, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_cloud_provider_aws\") AS \"AWS\", sum(\"cluster_cloud_provider_azure\") AS \"Azure\", sum(\"cluster_cloud_provider_custom\") AS \"Custom\", sum(\"cluster_cloud_provider_gce\") AS \"GCE\",sum(\"cluster_cloud_provider_external\") AS \"External\", sum(\"cluster_cloud_provider_openstack\") AS \"Openstack\", sum(\"cluster_cloud_provider_vsphere\") AS \"Vsphere\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "RKE clusters by cloud provider", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 65 + }, + "hiddenSeries": false, + "id": 93, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cluster_cloud_provider_aws\") AS \"AWS\", sum(\"cluster_cloud_provider_azure\") AS \"Azure\", sum(\"cluster_cloud_provider_custom\") AS \"Custom\", sum(\"cluster_cloud_provider_gce\") AS \"GCE\",sum(\"cluster_cloud_provider_external\") AS \"External\", sum(\"cluster_cloud_provider_openstack\") AS \"Openstack\", sum(\"cluster_cloud_provider_vsphere\") AS \"Vsphere\" FROM v2_clusters_$agg_time WHERE $timeFilter AND status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "RKE clusters by cloud provider - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 75 + }, + "hiddenSeries": false, + "id": 63, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cpu\") AS \"CPU\", sum(\"mem_mb\")/1024 as \"Mem Gb\" FROM v2_clusters_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU & Memory", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 75 + }, + "hiddenSeries": false, + "id": 64, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"cpu\") AS \"CPU\", sum(\"mem_mb\")/1024 as \"Mem Gb\" FROM v2_clusters_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU & Memory - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 85 + }, + "hiddenSeries": false, + "id": 57, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\", sum(\"from_template\") AS \"From_template\", sum(\"imported\") AS \"Imported\" FROM v2_nodes_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 85 + }, + "hiddenSeries": false, + "id": 58, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Total\", sum(\"active\") AS \"Active\", sum(\"from_template\") AS \"From_template\" FROM v2_nodes_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 95 + }, + "hiddenSeries": false, + "id": 90, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"node_azure\") AS \"Azure\", sum(\"node_ec2\") AS \"ec2\", sum(\"imported\") AS \"Imported\", sum(\"node_do\") AS \"DO\", sum(\"node_openstack\") AS \"openstack\", sum(\"node_vsphere\") AS \"vsphere\" FROM v2_nodes_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes by drivers", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 95 + }, + "hiddenSeries": false, + "id": 91, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"node_azure\") AS \"Azure\", sum(\"node_ec2\") AS \"ec2\", sum(\"imported\") AS \"Imported\", sum(\"node_do\") AS \"DO\", sum(\"node_openstack\") AS \"openstack\", sum(\"node_vsphere\") AS \"vsphere\" FROM v2_nodes_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes by drivers - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 105 + }, + "hiddenSeries": false, + "id": 86, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"controlplane\") AS \"Control_plane\", sum(\"etcd\") AS \"Etcd\", sum(\"worker\") AS \"Worker\" FROM v2_nodes_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes by role", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 105 + }, + "hiddenSeries": false, + "id": 87, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"controlplane\") AS \"Control_plane\", sum(\"etcd\") AS \"Etcd\", sum(\"worker\") AS \"Worker\" FROM v2_nodes_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Nodes by role - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 115 + }, + "hiddenSeries": false, + "id": 59, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Projects\", sum(\"namespaces\") AS \"Namespaces\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Projects & Namespaces", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 115 + }, + "hiddenSeries": false, + "id": 60, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"total\") AS \"Projects\", sum(\"namespaces\") AS \"Namespaces\" FROM v2_projects_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Projects & Namespaces - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 125 + }, + "hiddenSeries": false, + "id": 61, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"pods\") AS \"Pods\", sum(\"workloads\") AS \"workloads\" FROM v2_projects_$agg_time WHERE $timeFilter GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Workloads & Pods", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$sourcedb", + "fieldConfig": { + "defaults": { + "custom": {}, + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 125 + }, + "hiddenSeries": false, + "id": 62, + "interval": "", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pluginVersion": "7.1.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$col", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + } + ], + "hide": false, + "measurement": "containers_1h", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(\"pods\") AS \"Pods\", sum(\"workloads\") AS \"workloads\" FROM v2_projects_$agg_time WHERE $timeFilter and status = 'new' GROUP BY time($interval)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "running" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "Running" + ], + "type": "alias" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Workloads & Pods - new", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "repeat": null, + "title": "Instant data by agg_time_V2", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 102, + "panels": [ + { + "columns": [], + "datasource": "$sourcedb", + "fontSize": "100%", + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 27 + }, + "id": 110, + "links": [], + "pageSize": 10, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Memory", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 3, + "mappingType": 1, + "pattern": "mem_mb", + "thresholds": [], + "type": "number", + "unit": "decmbytes" + }, + { + "alias": "Total", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "total", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Active", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "active", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "CPU", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "cpu", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Namespaces", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "namespaces", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "UID", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "uid", + "preserveFormat": false, + "sanitize": false, + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Network", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "ip", + "preserveFormat": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT ip, total, active, mem_mb, cpu, namespaces from v2_top_clusters_by_total WHERE $timeFilter group by uid ORDER BY time DESC limit 1", + "rawQuery": true, + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "Clusters", + "transform": "table", + "type": "table-old" + }, + { + "columns": [], + "datasource": "$sourcedb", + "fontSize": "100%", + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 27 + }, + "id": 113, + "links": [], + "pageSize": 10, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Memory", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 3, + "mappingType": 1, + "pattern": "mem_mb", + "thresholds": [], + "type": "number", + "unit": "decmbytes" + }, + { + "alias": "Total", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "total", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Active", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "active", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "CPU", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "cpu", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Namespaces", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "namespaces", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "UID", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "uid", + "preserveFormat": false, + "sanitize": false, + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Network", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "ip", + "preserveFormat": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT ip, active, total, mem_mb, cpu, namespaces from v2_top_clusters_by_active WHERE $timeFilter group by uid ORDER BY time DESC limit 1", + "rawQuery": true, + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "Clusters active", + "transform": "table", + "type": "table-old" + }, + { + "columns": [], + "datasource": "$sourcedb", + "fontSize": "100%", + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 111, + "links": [], + "pageSize": 10, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Projects", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "total", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Pods", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "pods", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Workloads", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "workloads", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Namespaces", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "namespaces", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "UID", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "uid", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Network", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "ip", + "preserveFormat": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT ip, total, pods, workloads, namespaces FROM v2_top_projects_by_total WHERE $timeFilter group by uid ORDER BY time DESC limit 1 ", + "rawQuery": true, + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "Projects", + "transform": "table", + "type": "table-old" + }, + { + "columns": [], + "datasource": "$sourcedb", + "fontSize": "100%", + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 38 + }, + "id": 112, + "links": [], + "pageSize": 10, + "scroll": true, + "showHeader": true, + "sort": { + "col": 3, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "alias": "Total", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "total", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Active", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "active", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Memory", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 3, + "mappingType": 1, + "pattern": "mem_mb", + "thresholds": [], + "type": "number", + "unit": "decmbytes" + }, + { + "alias": "Controlplane", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "controlplane", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "UID", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "uid", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Etcd", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "etcd", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Worker", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "worker", + "thresholds": [], + "type": "number", + "unit": "locale" + }, + { + "alias": "Network", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "ip", + "preserveFormat": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT ip, total, active, mem_mb, controlplane, etcd, worker FROM v2_top_nodes_by_total WHERE $timeFilter group by uid ORDER BY time DESC limit 1 ", + "rawQuery": true, + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "title": "Nodes", + "transform": "table", + "type": "table-old" + } + ], + "repeat": null, + "title": "Top 10 V2 installations by", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "telemetry", + "value": "telemetry" + }, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "sourcedb", + "options": [], + "query": "influxdb", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "auto": false, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "24h", + "value": "24h" + }, + "hide": 0, + "label": null, + "name": "agg_time", + "options": [ + { + "selected": true, + "text": "24h", + "value": "24h" + } + ], + "query": "24h", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": "All", + "value": [ + "$__all" + ] + }, + "datasource": "telemetry", + "definition": "show tag values from byUid_$agg_time with key=\"install_version\"", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "version", + "options": [], + "query": "show tag values from byUid_$agg_time with key=\"install_version\"", + "refresh": 2, + "regex": "/^v\\d[.]\\d?\\d[.]\\d?\\d$/", + "skipUrlSync": false, + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-90d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Rancher", + "uid": "000000001", + "version": 46 +} \ No newline at end of file diff --git a/e2e/manifests/grafana/datasource.yaml b/e2e/manifests/grafana/datasource.yaml new file mode 100644 index 0000000..3386953 --- /dev/null +++ b/e2e/manifests/grafana/datasource.yaml @@ -0,0 +1,16 @@ +apiVersion: 1 + +deleteDatasources: + - name: telemetry + +datasources: + - name: telemetry + type: influxdb + access: proxy + database: telemetry + # user: grafana + url: http://influxdb:8086 + jsonData: + httpMode: GET + # secureJsonData: + # password: grafana diff --git a/e2e/manifests/grafana/deployment.yaml b/e2e/manifests/grafana/deployment.yaml new file mode 100644 index 0000000..60c9497 --- /dev/null +++ b/e2e/manifests/grafana/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: grafana + namespace: telemetry +spec: + selector: + matchLabels: + name: grafana + template: + metadata: + labels: + name: grafana + spec: + containers: + - name: grafana + image: grafana/grafana:8.3.11 # Online: 8.3.1 + resources: + requests: + memory: 128Mi + cpu: 100m + ports: + - containerPort: 3000 + + volumeMounts: + - mountPath: /etc/dashboards + name: grafana-dashboards-vol + - mountPath: /etc/grafana/provisioning/dashboards + name: grafana-dashboards-config-vol + - mountPath: /etc/grafana/provisioning/datasources + name: grafana-datasources-vol + + volumes: + - name: grafana-dashboards-vol + configMap: + name: grafana-dashboards + - name: grafana-dashboards-config-vol + configMap: + name: grafana-dashboards-config + - name: grafana-datasources-vol + configMap: + name: grafana-datasources + diff --git a/e2e/manifests/grafana/kustomization.yaml b/e2e/manifests/grafana/kustomization.yaml new file mode 100644 index 0000000..5c6387e --- /dev/null +++ b/e2e/manifests/grafana/kustomization.yaml @@ -0,0 +1,26 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: telemetry + +resources: + - "deployment.yaml" + - "service.yaml" + +generatorOptions: + disableNameSuffixHash: true + +configMapGenerator: + - name: grafana-dashboards + files: + - ./dashboards/telemetry/dashboard-apps.json + - ./dashboards/telemetry/dashboard-drivers.json + - ./dashboards/telemetry/dashboard-rancher.json + + - name: grafana-datasources + files: + - ./datasource.yaml + + - name: grafana-dashboards-config + files: + - ./dashboards.yaml diff --git a/e2e/manifests/grafana/service.yaml b/e2e/manifests/grafana/service.yaml new file mode 100644 index 0000000..4ad85eb --- /dev/null +++ b/e2e/manifests/grafana/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: grafana + namespace: telemetry +spec: + type: LoadBalancer + selector: + name: grafana + ports: + - port: 3000 + targetPort: 3000 diff --git a/e2e/manifests/influxdb/values.yaml b/e2e/manifests/influxdb/values.yaml new file mode 100644 index 0000000..42838b7 --- /dev/null +++ b/e2e/manifests/influxdb/values.yaml @@ -0,0 +1,2 @@ +service: + type: LoadBalancer diff --git a/e2e/manifests/namespace.yaml b/e2e/manifests/namespace.yaml new file mode 100644 index 0000000..61883d1 --- /dev/null +++ b/e2e/manifests/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + name: telemetry + name: telemetry diff --git a/e2e/manifests/postgres/13.2/config.yaml b/e2e/manifests/postgres/13.2/config.yaml new file mode 100644 index 0000000..130fa3a --- /dev/null +++ b/e2e/manifests/postgres/13.2/config.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: pgadmin + namespace: telemetry +data: + + servers.json: > # pgadmin configuration + { + "Servers": { + "1": { + "Name": "postgresql", + "Group": "Servers", + "Port": 5432, + "Username": "admin", + "Host": "localhost", + "SSLMode": "prefer", + "MaintenanceDB": "telemetry", + "PassFile": "/pgadminpassword" + } + } + } + pgadminpassword: admin + diff --git a/e2e/manifests/postgres/13.2/create_db.sql b/e2e/manifests/postgres/13.2/create_db.sql new file mode 100644 index 0000000..2b23467 --- /dev/null +++ b/e2e/manifests/postgres/13.2/create_db.sql @@ -0,0 +1,35 @@ +CREATE TABLE record ( + id serial PRIMARY KEY, + uid varchar(255) NOT NULL, + ts timestamp, + data json +); + +CREATE INDEX record_ts_uid ON record USING btree(ts,uid); + +CREATE TABLE installation ( + id serial PRIMARY KEY, + uid varchar(255) UNIQUE NOT NULL, + first_seen timestamp, + last_seen timestamp, + last_ip varchar(255), + last_record int REFERENCES record(id), + note text +); + +CREATE INDEX installation_last_seen ON installation USING btree(last_seen); + +CREATE TABLE byday ( + id serial PRIMARY KEY, + uid varchar(255) NOT NULL, + day date NOT NULL, + record_id int REFERENCES record(id) +); + +CREATE UNIQUE INDEX byday_day_uid ON byday USING btree(day,uid); + +CREATE TABLE account ( + id serial PRIMARY KEY, + name varchar(255) NOT NULL UNIQUE, + hash varchar(255) +); diff --git a/e2e/manifests/postgres/13.2/deployment.yaml b/e2e/manifests/postgres/13.2/deployment.yaml new file mode 100644 index 0000000..5ad9b1a --- /dev/null +++ b/e2e/manifests/postgres/13.2/deployment.yaml @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + name: postgresql + name: postgresql + namespace: telemetry +spec: + selector: + matchLabels: + name: postgresql + template: + metadata: + labels: + name: postgresql + spec: + containers: + - image: postgres:13.2 + name: postgres + imagePullPolicy: IfNotPresent + livenessProbe: # restarts containers (kill) + failureThreshold: 3 + periodSeconds: 30 + successThreshold: 1 + tcpSocket: + port: pgsql + timeoutSeconds: 1 + readinessProbe: # doesn't kill the container, just stops serving traffic + failureThreshold: 3 + periodSeconds: 30 + successThreshold: 1 + tcpSocket: + port: pgsql + timeoutSeconds: 1 + startupProbe: # other probes pause till this one succeeds + tcpSocket: + port: pgsql + failureThreshold: 86400 + periodSeconds: 10 + env: + - name: POSTGRES_USER + value: admin + - name: POSTGRES_PASSWORD + value: admin + - name: POSTGRES_DB + value: telemetry + ports: + - containerPort: 5432 + name: pgsql + protocol: TCP + resources: + requests: + memory: 1G + cpu: 100m + limits: + memory: 1G + cpu: 1 + volumeMounts: + - name: pgdata + mountPath: /var/lib/postgresql/data + - name: postgresql-config + mountPath: /docker-entrypoint-initdb.d/create_db.sql + subPath: create_db.sql + readOnly: true + - name: dshm + mountPath: /dev/shm + + - image: dpage/pgadmin4:6 + name: pgadmin + imagePullPolicy: IfNotPresent + resources: + requests: + memory: 128M + cpu: 500m + limits: + memory: 1G + cpu: 1 + ports: + - containerPort: 80 + name: pgadmin-ui + env: + - name: PGADMIN_DEFAULT_EMAIL + value: admin@local.host + - name: PGADMIN_DEFAULT_PASSWORD + value: admin + volumeMounts: + - mountPath: /pgadmin4/servers.json + subPath: servers.json + name: pgadmin-config + + volumes: + - name: pgdata + hostPath: + path: /var/lib/postgresql/data + - name: postgresql-config + configMap: + name: postgresql + - name: pgadmin-config + configMap: + name: pgadmin + - name: dshm + emptyDir: + medium: Memory diff --git a/e2e/manifests/postgres/13.2/kustomization.yaml b/e2e/manifests/postgres/13.2/kustomization.yaml new file mode 100644 index 0000000..8c2180a --- /dev/null +++ b/e2e/manifests/postgres/13.2/kustomization.yaml @@ -0,0 +1,22 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: telemetry + +resources: + - deployment.yaml + - service.yaml + +generatorOptions: + disableNameSuffixHash: true + +configMapGenerator: + - name: pgadmin + literals: + - pgadminpassword=admin + files: + - ./servers.json + + - name: postgresql + files: + - ./create_db.sql diff --git a/e2e/manifests/postgres/13.2/servers.json b/e2e/manifests/postgres/13.2/servers.json new file mode 100644 index 0000000..131db0d --- /dev/null +++ b/e2e/manifests/postgres/13.2/servers.json @@ -0,0 +1,14 @@ +{ + "Servers": { + "1": { + "Name": "postgresql", + "Group": "Servers", + "Port": 5432, + "Username": "admin", + "Host": "localhost", + "SSLMode": "prefer", + "MaintenanceDB": "telemetry", + "PassFile": "/pgadminpassword" + } + } +} diff --git a/e2e/manifests/postgres/13.2/service.yaml b/e2e/manifests/postgres/13.2/service.yaml new file mode 100644 index 0000000..7e37508 --- /dev/null +++ b/e2e/manifests/postgres/13.2/service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: postgresql + name: postgresql + namespace: telemetry +spec: + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: postgres + nodePort: 30055 + port: 5432 + protocol: TCP + targetPort: 5432 + - name: pgadmin + nodePort: 30056 + port: 8080 + protocol: TCP + targetPort: 80 + selector: + name: postgresql + type: LoadBalancer diff --git a/e2e/manifests/postgres/15.2/kustomization.yaml b/e2e/manifests/postgres/15.2/kustomization.yaml new file mode 100644 index 0000000..533e53e --- /dev/null +++ b/e2e/manifests/postgres/15.2/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../13.2 + +images: + - name: postgres + newTag: '15.2' diff --git a/e2e/manifests/telemetry-client/deployment.yaml b/e2e/manifests/telemetry-client/deployment.yaml new file mode 100644 index 0000000..292e7e9 --- /dev/null +++ b/e2e/manifests/telemetry-client/deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + name: telemetry-client + name: telemetry-client + namespace: telemetry +spec: + selector: + matchLabels: + app: telemetry-client + template: + metadata: + labels: + app: telemetry-client + spec: + containers: + - name: telemetry-client + image: $(TELEMETRY_IMAGE) + resources: + requests: + memory: 64Mi + cpu: 100m + limits: + memory: 128Mi + cpu: 1000m + envFrom: + - configMapRef: + name: telemetry-client + env: + - name: TELEMETRY_INTERVAL + value: "1m" + - name: CATTLE_TOKEN_KEY + valueFrom: + secretKeyRef: + name: telemetry + key: api_key + args: + - client diff --git a/e2e/manifests/telemetry-client/dev/deployment.yaml b/e2e/manifests/telemetry-client/dev/deployment.yaml new file mode 100644 index 0000000..2ac9598 --- /dev/null +++ b/e2e/manifests/telemetry-client/dev/deployment.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-client +spec: + template: + spec: + containers: + - name: telemetry-client + imagePullPolicy: Never + image: rancher/telemetry:dev diff --git a/e2e/manifests/telemetry-client/dev/kustomization.yaml b/e2e/manifests/telemetry-client/dev/kustomization.yaml new file mode 100644 index 0000000..8c62fd8 --- /dev/null +++ b/e2e/manifests/telemetry-client/dev/kustomization.yaml @@ -0,0 +1,22 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - ../release + +generatorOptions: + disableNameSuffixHash: true + +patches: + - path: deployment.yaml + target: + kind: Deployment + name: telemetry-client + +configMapGenerator: + - name: telemetry-client + behavior: merge + literals: + - DEBUG=true + - TELEMETRY_INTERVAL=1m diff --git a/e2e/manifests/telemetry-client/extra-config.yaml b/e2e/manifests/telemetry-client/extra-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/e2e/manifests/telemetry-client/kustomization.yaml b/e2e/manifests/telemetry-client/kustomization.yaml new file mode 100644 index 0000000..7d51fb3 --- /dev/null +++ b/e2e/manifests/telemetry-client/kustomization.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - ./deployment.yaml + +generatorOptions: + disableNameSuffixHash: true + +configMapGenerator: + - name: telemetry-client + literals: + - CATTLE_URL=https://rancher.cattle-system/v3 + - TELEMETRY_TO_URL="http://telemetry-server:8115/publish" + # - CATTLE_CERTIFICATE="" + files: + - ./extra-config.yaml diff --git a/e2e/manifests/telemetry-client/master/deployment.yaml b/e2e/manifests/telemetry-client/master/deployment.yaml new file mode 100644 index 0000000..db936ee --- /dev/null +++ b/e2e/manifests/telemetry-client/master/deployment.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-client +spec: + template: + spec: + containers: + - name: telemetry-client + imagePullPolicy: Never + image: rancher/telemetry:master diff --git a/e2e/manifests/telemetry-client/master/kustomization.yaml b/e2e/manifests/telemetry-client/master/kustomization.yaml new file mode 100644 index 0000000..8c62fd8 --- /dev/null +++ b/e2e/manifests/telemetry-client/master/kustomization.yaml @@ -0,0 +1,22 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - ../release + +generatorOptions: + disableNameSuffixHash: true + +patches: + - path: deployment.yaml + target: + kind: Deployment + name: telemetry-client + +configMapGenerator: + - name: telemetry-client + behavior: merge + literals: + - DEBUG=true + - TELEMETRY_INTERVAL=1m diff --git a/e2e/manifests/telemetry-server/deployment.yaml b/e2e/manifests/telemetry-server/deployment.yaml new file mode 100644 index 0000000..57c88c5 --- /dev/null +++ b/e2e/manifests/telemetry-server/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-server +spec: + selector: + matchLabels: + name: telemetry-server + template: + metadata: + labels: + name: telemetry-server + spec: + containers: + - name: telemetry-server + image: foo + livenessProbe: + failureThreshold: 3 + periodSeconds: 30 + successThreshold: 1 + httpGet: + port: tele-server + path: healthcheck.html + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + periodSeconds: 30 + successThreshold: 1 + httpGet: + port: tele-server + path: healthcheck.html + timeoutSeconds: 1 + resources: + requests: + memory: '1Gi' + cpu: 100m + limits: + memory: '4Gi' + cpu: 500m + ports: + - name: tele-server + protocol: TCP + containerPort: 8115 + envFrom: + - configMapRef: + name: telemetry-server + env: + - name: TELEMETRY_API_KEY + valueFrom: + secretKeyRef: + name: telemetry + key: access_key + - name: TELEMETRY_SECRET_KEY + valueFrom: + secretKeyRef: + name: telemetry + key: secret_key + - name: TELEMETRY_DEBUG + value: "true" + args: + - server diff --git a/e2e/manifests/telemetry-server/dev/deployment.yaml b/e2e/manifests/telemetry-server/dev/deployment.yaml new file mode 100644 index 0000000..14743c6 --- /dev/null +++ b/e2e/manifests/telemetry-server/dev/deployment.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-server +spec: + template: + spec: + containers: + - name: telemetry-server + imagePullPolicy: Never + image: rancher/telemetry:dev diff --git a/e2e/manifests/telemetry-server/dev/kustomization.yaml b/e2e/manifests/telemetry-server/dev/kustomization.yaml new file mode 100644 index 0000000..5205eab --- /dev/null +++ b/e2e/manifests/telemetry-server/dev/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - ../release + +generatorOptions: + disableNameSuffixHash: true + +patches: + - path: deployment.yaml + target: + kind: Deployment + name: telemetry-server + +configMapGenerator: + - name: telemetry-server + behavior: merge + literals: + - DEBUG=true diff --git a/e2e/manifests/telemetry-server/extra-config.yaml b/e2e/manifests/telemetry-server/extra-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/e2e/manifests/telemetry-server/kustomization.yaml b/e2e/manifests/telemetry-server/kustomization.yaml new file mode 100644 index 0000000..462748e --- /dev/null +++ b/e2e/manifests/telemetry-server/kustomization.yaml @@ -0,0 +1,20 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - deployment.yaml + - service.yaml + +generatorOptions: + disableNameSuffixHash: true + +configMapGenerator: + - name: telemetry-server + literals: + - "TELEMETRY_PG_USER=admin" + - "TELEMETRY_PG_PASS=admin" + - "TELEMETRY_PG_HOST=postgresql" + files: + - ./extra-config.yaml + diff --git a/e2e/manifests/telemetry-server/master/deployment.yaml b/e2e/manifests/telemetry-server/master/deployment.yaml new file mode 100644 index 0000000..bc3c4e1 --- /dev/null +++ b/e2e/manifests/telemetry-server/master/deployment.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-server +spec: + template: + spec: + containers: + - name: telemetry-server + imagePullPolicy: Never + image: rancher/telemetry:master diff --git a/e2e/manifests/telemetry-server/master/kustomization.yaml b/e2e/manifests/telemetry-server/master/kustomization.yaml new file mode 100644 index 0000000..5205eab --- /dev/null +++ b/e2e/manifests/telemetry-server/master/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - ../release + +generatorOptions: + disableNameSuffixHash: true + +patches: + - path: deployment.yaml + target: + kind: Deployment + name: telemetry-server + +configMapGenerator: + - name: telemetry-server + behavior: merge + literals: + - DEBUG=true diff --git a/e2e/manifests/telemetry-server/service.yaml b/e2e/manifests/telemetry-server/service.yaml new file mode 100644 index 0000000..62e0ace --- /dev/null +++ b/e2e/manifests/telemetry-server/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: telemetry-server + name: telemetry-server +spec: + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: tele-server + port: 8115 + protocol: TCP + targetPort: 8115 + selector: + name: telemetry-server + type: LoadBalancer diff --git a/e2e/manifests/telemetry-stats/base/deployment.yaml b/e2e/manifests/telemetry-stats/base/deployment.yaml new file mode 100644 index 0000000..1cdc549 --- /dev/null +++ b/e2e/manifests/telemetry-stats/base/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-stats + namespace: telemetry +spec: + selector: + matchLabels: + app: telemetry-stats + template: + metadata: + labels: + app: telemetry-stats + spec: + containers: + - name: telemetry-stats + image: rancherlabs/rancher-telemetry-stats:v0.0.1 + env: + - name: TELEMETRY_DEBUG + value: "true" + - name: TELEMETRY_URL + value: http://telemetry-server:8115 + - name: TELEMETRY_ACCESS_KEY + valueFrom: + secretKeyRef: + key: access_key + name: telemetry + - name: TELEMETRY_SECRET_KEY + valueFrom: + secretKeyRef: + key: secret_key + name: telemetry + resources: + limits: + memory: 1.5Gi + cpu: 1000m + requests: + cpu: 100m + memory: 128Mi + # ports: + # - containerPort: + command: + - "/bin/rancher-telemetry-stats" + args: + - --debug + - --insecure + - --influxurl=http://influxdb:8086 + - --influxdb=telemetry + - --influxuser=admin + - --influxpass=admin + - --refresh=30 + # - --influxuser=admin + # - --influxpass=admin + # - --limit + # - --refresh diff --git a/e2e/manifests/telemetry-stats/base/kustomization.yaml b/e2e/manifests/telemetry-stats/base/kustomization.yaml new file mode 100644 index 0000000..3be961a --- /dev/null +++ b/e2e/manifests/telemetry-stats/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: + - deployment.yaml diff --git a/e2e/manifests/telemetry-stats/dev/deployment.yaml b/e2e/manifests/telemetry-stats/dev/deployment.yaml new file mode 100644 index 0000000..c71ae8c --- /dev/null +++ b/e2e/manifests/telemetry-stats/dev/deployment.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: telemetry-stats +spec: + template: + spec: + containers: + - name: telemetry-stats + image: rancherlabs/rancher-telemetry-stats:dev + imagePullPolicy: Never diff --git a/e2e/manifests/telemetry-stats/dev/kustomization.yaml b/e2e/manifests/telemetry-stats/dev/kustomization.yaml new file mode 100644 index 0000000..cc73f5b --- /dev/null +++ b/e2e/manifests/telemetry-stats/dev/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: +- ../base + +patches: + - path: deployment.yaml + target: + kind: Deployment + name: telemetry-stats diff --git a/e2e/manifests/tests/jobs/test-influxdb.sh b/e2e/manifests/tests/jobs/test-influxdb.sh new file mode 100644 index 0000000..12d8d85 --- /dev/null +++ b/e2e/manifests/tests/jobs/test-influxdb.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -x + +INFLUXDB_PORT=${INFLUXDB_PORT:-8086} + +# If run inside Kubernetes, assume Alpine and install dependencies. +if [ -n "${KUBERNETES_SERVICE_HOST}" ]; then + apt update && \ + apt install jq -y +fi + +# Just try. +while true; do + json=$( + influx \ + -host influxdb \ + -database telemetry \ + -execute 'SELECT * FROM telemetry LIMIT 1' \ + -format=json + ) + if [[ "$?" -ne 0 || -z "$json" ]]; then + echo >&2 "error: failed to fetch data" + sleep 2 + continue + fi + + echo "DEBUG: \$json: $json" + + result=$(echo $json | jq -r '.results[0].series | length') + echo "DEBUG: \$result: $result" + if [[ "$?" -ne 0 || -z "$result" || "$result" = "null" ]]; then + echo >&2 "error: couldn't get records, result returned: $result" + sleep 2 + continue + fi + + if [ "$result" -ge 1 ]; then + echo "success" + exit 0 + fi + + echo >&2 "warning: no records found, result contains: $result" + pause 1 +done diff --git a/e2e/manifests/tests/jobs/test-influxdb.yaml b/e2e/manifests/tests/jobs/test-influxdb.yaml new file mode 100644 index 0000000..c2ad440 --- /dev/null +++ b/e2e/manifests/tests/jobs/test-influxdb.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: test-influxdb + namespace: telemetry +spec: + backoffLimit: 0 # Don't retry, we've a loop in the bash script + template: + spec: + restartPolicy: Never # Also only run once + containers: + - name: test-influxdb-container + image: influxdb:1.8 + securityContext: + runAsUser: 0 + command: ["bash"] + args: + - "/tests/test-influxdb.sh" + envFrom: + - secretRef: + name: telemetry + volumeMounts: + - name: test-files-volume + mountPath: /tests + + volumes: + - name: test-files-volume + configMap: + name: tests diff --git a/e2e/manifests/tests/jobs/test-telemetry-server.sh b/e2e/manifests/tests/jobs/test-telemetry-server.sh new file mode 100755 index 0000000..0f80f4b --- /dev/null +++ b/e2e/manifests/tests/jobs/test-telemetry-server.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +TS_PORT=${TS_PORT:-8115} +TS_HOST=${TS_HOST:-"http://telemetry-server"} +TS_PATH=${TS_PATH:-"/admin/active?hours=48"} + +# Check for existence of necessary credentials. +if [[ -z "$access_key" || -z "$secret_key" ]]; then + echo >&2 "error: need \$access_key and \$secret_key environment variables set" + exit 1 +fi + +# If run inside Kubernetes, assume Alpine and install dependencies. +if [ -n "${KUBERNETES_SERVICE_HOST}" ]; then + apk add curl jq +fi + +# Just try. +while true; do + json=$( + curl -fsSL -u "${access_key}":"${secret_key}" "${TS_HOST}":"${TS_PORT}${TS_PATH}" + ) + if [[ "$?" -ne 0 || -z "$json" ]]; then + echo >&2 "error: failed to fetch data" + sleep 2 + continue + fi + + echo "DEBUG: \$json: $json" + + result=$( + echo $json | jq -r '.data[0].record.cluster.active' + ) + if [[ "$?" -ne 0 || -z "$result" || "$result" = "null" ]]; then + echo >&2 "error: couldn't get active cluster count, result returned: $result" + sleep 2 + continue + fi + + if [ "$result" -ne 1 ]; then + echo >&2 "error: wrong cluster count, result contains: $result" + exit 1 + fi + + echo "DEBUG: \$result: $result" + + echo "success" + exit 0 +done diff --git a/e2e/manifests/tests/jobs/test-telemetry-server.yaml b/e2e/manifests/tests/jobs/test-telemetry-server.yaml new file mode 100644 index 0000000..2a51ba8 --- /dev/null +++ b/e2e/manifests/tests/jobs/test-telemetry-server.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: test-telemetry-server + namespace: telemetry +spec: + backoffLimit: 0 # Don't retry, we've a loop in the bash script + template: + spec: + restartPolicy: Never # Also only run once + containers: + - name: test-container + image: bash:5 + securityContext: + runAsUser: 0 + command: ["bash"] + args: + - "/tests/test-telemetry-server.sh" + envFrom: + - secretRef: + name: telemetry + volumeMounts: + - name: test-files-volume + mountPath: /tests + + volumes: + - name: test-files-volume + configMap: + name: tests diff --git a/e2e/manifests/tests/kustomization.yaml b/e2e/manifests/tests/kustomization.yaml new file mode 100644 index 0000000..3137fed --- /dev/null +++ b/e2e/manifests/tests/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: telemetry + +resources: +- jobs/test-telemetry-server.yaml +- jobs/test-influxdb.yaml + +configMapGenerator: + - name: tests + files: + - "jobs/test-telemetry-server.sh" + - "jobs/test-influxdb.sh" diff --git a/e2e/start b/e2e/start new file mode 100755 index 0000000..be6399a --- /dev/null +++ b/e2e/start @@ -0,0 +1,380 @@ +#!/bin/bash + +# The host name to set Rancher Manager to listen for from the host. +: "${HOST_NAME:=rancher}" +# A k3d cluster name to use. Different names prevent collisions. +: "${CLUSTER_NAME:=telemetry-dev}" +# K3s version to use. +: "${K3S_VERSION:=rancher/k3s:v1.23.6-k3s1}" +# Debug mode. +: "${DEBUG:=false}" + +debug_flag="" +if [ -n "${DEBUG}" ]; then + debug_flag="--debug" +fi + +# The cluster IP is determined when the k3d cluster has been created and is any +# node that forwards HTTP ports to the nodes on the cluster. It can hence be +# used to send HTTP requests to a service, provided the host header is set +# correctly. +CLUSTER_IP="" + +# Set up the directory structure for mounting /var/lib/postgresql/data from the +# host into k3d. This is necessary to import data from the host on clsuter +# create, and prevents that working data needs to be re-imported on each cluster +# creation. This is just one part of the functionatlity that handles that. +function setup-volume() { + if [ ! -d /var/lib/postgresql/data ]; then + if ! mkdir -p /var/lib/postgresql/data; then + sudo mkdir -p /var/lib/postgresql/data + fi + fi + if [ ! -d /var/lib/postgresql/docker-entrypoint-initdb.d ]; then + if ! mkdir -p /var/lib/postgresql/docker-entrypoint-initdb.d; then + sudo mkdir -p /var/lib/postgresql/docker-entrypoint-initdb.d + fi + fi + echo "CREATE ROLE telemetry WITH PASSWORD 'telemetry';" | sudo tee \ + /var/lib/postgresql/docker-entrypoint-initdb.d/000-init.sql +} + +# Creates a K3d cluster with the predefined or overridden CLUSTER_NAME. +# CLUSTER_NAME needs to be different if several instances of k3d clusters should +# be run simultaneously. +function k3d-create() { + local create_command="k3d cluster create ${CLUSTER_NAME} --agents 1 --servers 1" + create_command="$create_command --image ${K3S_VERSION}" + create_command="$create_command --volume /var/lib/postgresql:/var/lib/postgresql" + while ! $create_command; do + k3d cluster delete "${CLUSTER_NAME}" + done +} + +function install-rancher() { + echo "Installing cert-manager" + helm repo add jetstack https://charts.jetstack.io + kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.crds.yaml + helm install cert-manager jetstack/cert-manager \ + --namespace cert-manager \ + --create-namespace \ + --version v1.5.1 \ + "${debug_flag}" \ + --atomic + kubectl wait --namespace cert-manager --for=condition=ready pod --all --timeout=30s + + echo "Installing Rancher..." + helm repo add rancher-stable https://releases.rancher.com/server-charts/stable + kubectl create namespace cattle-system + + helm install rancher rancher-stable/rancher \ + --set bootstrapPassword=admin \ + --namespace cattle-system \ + --set hostname="${HOST_NAME}" \ + --set replicas=1 \ + "${debug_flag}" \ + --atomic + + CLUSTER_IP=$(get-cluster-ip) +} + +function get-cluster-ip() { + for i in {0..10}; do + >&2 echo "retrieving IP of cluster (attempt #$((i+1)))" + ip=$( + kubectl get -A ingress -o json | + jq -r '.items[0].status.loadBalancer.ingress[0].ip' + ) + + if [[ -z "${ip}" || "${ip}" = "null" ]]; then + >&2 echo "error: IP couldn't be determined using Ingress status" + return 1 + fi + + if http --quiet --check-status --verify=no GET "https://${ip}" "Host:${HOST_NAME}" ; then + echo "${ip}" + return 0 + fi + + sleep 2 + done + + >&2 echo "error: retrieval of cluster IP failed" + return 1 +} + +# Rancher needs a host name, so we add the IP address of a cluster +# node +function configure-hostnames() { + if [ -n "${NO_ETC_HOST}" ]; then + echo "skipping hostname configuration" + return 0 + fi + + if [ -z "${CLUSTER_IP}" ]; then + >&2 echo "error: cannot configure hostnames: CLUSTER_IP is empty" + return 1 + fi + if [ -z "${HOST_NAME}" ]; then + >&2 echo "error: no HOST_NAME found" + return 1 + fi + + # Do a backup once, but don't ever overwrite it. + if [ ! -f /etc/hosts.bak ]; then + sudo cp -a /etc/hosts /etc/hosts.bak + fi + + sudo sed -n -e "/ ${HOST_NAME}/!p" -i /etc/hosts + echo "${CLUSTER_IP} ${HOST_NAME}" | sudo tee -a /etc/hosts >/dev/null +} + +# Get login token, good for 1 minute. +function get-login-token() { + if [ -z "$1" ]; then + echo >&2 "error: argument missing: password" + return 1 + fi + + local password + local login_token + + password="$1" + + for i in {1..10}; do + login_token=$( + curl -k -s -X POST \ + "https://${CLUSTER_IP}/v3-public/localProviders/local?action=login" \ + -H 'Content-Type: application/json' \ + -H "Host: ${HOST_NAME}" \ + --data-binary "{\"username\":\"admin\",\"password\":\"$password\"}" | + jq -r .token + ) + + if [[ "$?" -eq "0" && -n "${login_token}" && "${login_token}" != "null" ]]; then + echo "${login_token}" + return 0 + fi + + sleep 1 + done + + echo >&2 "error: login token could not be acquired" + return 1 +} + +function change-password() { + local token + if [ -z "$1" ]; then + echo >&2 "The first argument must be an API token" + return 1 + fi + token="$1" + + # Change password + curl -k -s -X POST \ + "https://${CLUSTER_IP}/v3/users?action=changepassword" \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $token" \ + -H "Host: ${HOST_NAME}" \ + --data-binary '{"currentPassword":"admin","newPassword":"dev-admin-pw"}' +} + +# Create API key, good forever. +function create-api-key() { + local login_token + if [ -z "$1" ]; then + echo >&2 "error: argument missing: token" + return 1 + else + login_token="$1" + fi + + local api_key + api_key=$( + curl -k -s \ + -X POST \ + "https://${CLUSTER_IP}/v3/token" \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $login_token" \ + -H "Host: ${HOST_NAME}" \ + --data-binary '{"type": "token", "description": "for scripts"}' | + jq -r .token + ) + + if [ "$?" -ne 0 ]; then + echo >&2 "API key could not be acquired" + return 1 + fi + + echo "${api_key}" +} + +# Set server-url +function change-server-url() { + local api_key + if [ -z "$1" ]; then + echo >&2 "The first argument must be an API token" + return 1 + else + api_key="$1" + fi + curl -k -s \ + "https://${CLUSTER_IP}/v3/settings/server-url" \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $api_key" \ + -H "Host: ${HOST_NAME}" \ + -X PUT \ + --data-binary "{\"name\":\"server-url\",\"value\":\"https://${CLUSTER_IP}/\"}" + + if [ "$?" -ne "0" ]; then + echo >&2 "Changing server URL failed" + fi +} + +function install-postgres-13.2() { + kubectl apply -f manifests/namespace.yaml + kubectl apply -k manifests/postgres/13.2 +} + +function install-postgres-15.2() { + kubectl apply -f manifests/namespace.yaml + kubectl apply -k manifests/postgres/15.2 +} + +function install-influx() { + kubectl apply -f manifests/namespace.yaml + helm repo add influxdata https://helm.influxdata.com + helm upgrade \ + -n telemetry \ + -i influxdb \ + --version 4.12.0 \ + -f manifests/influxdb/values.yaml \ + influxdata/influxdb +} + +function install-telemetry-stats() { + kubectl apply -f manifests/namespace.yaml + kubectl apply --server-side -k ./manifests/telemetry-stats/base +} + +function install-telemetry-stats-dev() { + kubectl apply -f manifests/namespace.yaml + kubectl apply --server-side -k ./manifests/telemetry-stats/dev/ +} + +function create-secret { + if [ "$#" -ne 3 ]; then + echo >&2 "error: create-secret: argument missing: need 3, have $#" + return 1 + fi + + local api_key="$1" + local access_key="$2" + local secret_key="$3" + + cat <secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: telemetry + namespace: telemetry +stringData: + access_key: $access_key + secret_key: $secret_key + api_key: $api_key +EOF + + kubectl create namespace telemetry || true + kubectl apply -f secret.yaml +} + +function install-telemetry-server() { + set -x + + if [[ -z "${TELEMETRY_IMAGE}" ]]; then + echo >&2 "error: TELEMETRY_IMAGE is not set" + return 1 + fi + + yq eval ".spec.template.spec.containers[0].image = \"${TELEMETRY_IMAGE}\"" \ + manifests/telemetry-server/deployment.yaml -i + + kubectl \ + -n telemetry \ + apply \ + -k ./manifests/telemetry-server +} + +function install-telemetry-client() { + set -x + + if [[ -z "${TELEMETRY_IMAGE}" ]]; then + echo >&2 "error: TELEMETRY_IMAGE is not set" + return 1 + fi + + yq eval ".spec.template.spec.containers[0].image = \"${TELEMETRY_IMAGE}\"" \ + manifests/telemetry-client/deployment.yaml -i + + kubectl \ + -n telemetry \ + apply \ + -k ./manifests/telemetry-client +} + +function install-base() { + setup-volume + k3d-create + install-rancher + configure-hostnames +} + +function init-base() { + # shellcheck disable=SC2120 + if [ -z "$1" ]; then + >&2 echo "error: init-base: missing argument: password" + return 1 + fi + + local login_token + login_token=$(get-login-token "$1") + if [ "${login_token}" = "" ] ; then + >&2 echo "error: login token couldn't be acquired" + return 1 + fi + + local api_key + api_key=$(create-api-key "${login_token}") + if [ -z "${api_key}" ]; then + >&2 echo "error: API key couldn't be created" + return 1 + fi + + IFS=':' read -ra keys <<< "$api_key" + local access_key="${keys[0]}" + local secret_key="${keys[1]}" + + change-server-url "$api_key" + change-password "$api_key" # Required to skip the setup screen + + create-secret "$api_key" "${access_key}" "${secret_key}" +} + +# To be called on a developers' machine. +function start() { + install-base + init-base "admin" + install-postgres-15.2 + install-influx + install-telemetry-client + install-telemetry-server + install-telemetry-stats +} + +# Only run start if script wasn't sourced. +if ! (return 0 2>/dev/null); then + set -ex + start + set +ex +fi