diff --git a/README.md b/README.md index 4b1faca..7782b5e 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,14 @@ Then run the exporter: ./bin/syselevenexporter ``` +The exporter uses the API version v1 by default. If you want to change to the current API version v3, you can run the exporter with: + +```sh +./bin/syselevenexporter --api-version v3 +``` + +See here for more information about the [API for Quota and Usage Information](https://docs.syseleven.de/syseleven-stack/en/reference/get-quota-info). + A Docker image is available at `syseleven/syseleven-exporter:` and can be retrieved via: ```sh @@ -75,7 +83,7 @@ docker pull syseleven/syseleven-exporter: | syseleven_network_floating_ips_used | Number of used floating IPs per `region` and `project` | | syseleven_network_loadbalancers_total | Quota for number of load balancers per `region` and `project` | | syseleven_network_loadbalancers_used | Number of used load balancers per `region` and `project` | -| syseleven_s3_space_total_bytes | Quota for S3 space per `region` and `project` in bytes | +| syseleven_s3_space_total_bytes | Quota for S3 space per `region`, `project` and `type` in bytes | | syseleven_s3_space_used_bytes | Used S3 space per `region` and `project` in bytes | | syseleven_volume_space_total_gigabytes | Quota for volume space per `region` and `project` in gigabytes | | syseleven_volume_space_used_gigabytes | Number of used volume space per `region` and `project` in gigabytes | diff --git a/charts/syseleven-exporter-chart/README.md b/charts/syseleven-exporter-chart/README.md index 27256f4..a9aa0f1 100644 --- a/charts/syseleven-exporter-chart/README.md +++ b/charts/syseleven-exporter-chart/README.md @@ -29,6 +29,8 @@ openstack.password openstack.projectId ``` +The exporter uses the API version v1 by default. If you want to change to the current API version v3, you can adjust the API version with `openstack.apiversion`. See here for more information about the [API for Quota and Usage Information](https://docs.syseleven.de/syseleven-stack/en/reference/get-quota-info). + ### Prometheus If you want a [Prometheus ServiceMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#servicemonitor) you can use the `prometheus.serviceMonitor.enabled` flag, which is false by default. The default `serviceMonitor.interval` is 10 minutes, since the API is only polled once per hour by the exporter pod. diff --git a/charts/syseleven-exporter-chart/dashboards/syseleven-exporter-quotas.json b/charts/syseleven-exporter-chart/dashboards/syseleven-exporter-quotas.json index a13ff07..af14f3e 100644 --- a/charts/syseleven-exporter-chart/dashboards/syseleven-exporter-quotas.json +++ b/charts/syseleven-exporter-chart/dashboards/syseleven-exporter-quotas.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -14,7 +17,7 @@ }, "description": "Dashboard for SysEleven Exporter", "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 118, "links": [], @@ -34,7 +37,6 @@ "id": 9, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -45,12 +47,13 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -66,28 +69,38 @@ "h": 7, "w": 8, "x": 0, - "y": 1 + "y": 25 }, "id": 25, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_compute_cores_used)by(__name__, project, region) / max(syseleven_compute_cores_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_compute_cores_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_compute_cores_total{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -95,204 +108,209 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "CPUs" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 1 + "y": 25 }, - "hiddenSeries": false, "id": 26, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_cores_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_cores_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Compute Cores", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "CPUs", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "CPUs" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 1 + "y": 25 }, - "hiddenSeries": false, "id": 27, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_cores_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_cores_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Compute Cores", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "CPUs", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Compute Cores", @@ -313,7 +331,6 @@ "id": 19, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -324,12 +341,13 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -345,28 +363,38 @@ "h": 7, "w": 8, "x": 0, - "y": 2 + "y": 33 }, "id": 15, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_compute_ram_used_megabytes)by(__name__, project, region) / max(syseleven_compute_ram_total_megabytes)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_compute_ram_used_megabytes{project=~\"$project\"})by(__name__, project, region) / max(syseleven_compute_ram_total_megabytes{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -374,211 +402,216 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "decmbytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 2 + "y": 33 }, - "hiddenSeries": false, "id": 16, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_ram_used_megabytes)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_ram_used_megabytes{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Compute Ram", - "tooltip": { - "shared": true, - "sort": 0, - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "decmbytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 2 + "y": 33 }, - "hiddenSeries": false, "id": 22, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_ram_total_megabytes)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_ram_total_megabytes{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Compute Ram", - "tooltip": { - "shared": true, - "sort": 0, - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Compute Ram", "type": "row" }, { - "collapsed": false, + "collapsed": true, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -590,270 +623,286 @@ "y": 2 }, "id": 7, - "panels": [], - "title": "SysEleven - S3 Space", - "type": "row" - }, - { - "cacheTimeout": null, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 3 - }, - "id": 2, - "links": [], - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.5", - "targets": [ + "panels": [ { - "exemplar": true, - "expr": "sum((max(syseleven_s3_space_used_bytes)by(__name__, project, region) / max(syseleven_s3_space_total_bytes)by(__name__, project, region)) * 100) by(region, project)", - "interval": "", - "legendFormat": "{{region}}", - "refId": "A" - } - ], - "title": "SysEleven - S3 Space", - "type": "gauge" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "unit": "bytes" + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 41 + }, + "id": 2, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum((max(syseleven_s3_space_used_bytes{project=~\"$project\"})by(__name__, project, region, type) / max(syseleven_s3_space_total_bytes{project=~\"$project\"})by(__name__, project, region, type)) * 100) by(region, project, type)", + "interval": "", + "legendFormat": "{{region}} - {{type}}", + "range": true, + "refId": "A" + } + ], + "title": "SysEleven - S3 Space", + "type": "gauge" }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 3 - }, - "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", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "exemplar": true, - "expr": "sum(max(syseleven_s3_space_used_bytes)by(__name__, project, region)) by(region, project) ", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{region}} ", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "SysEleven - Used S3 Space", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 41 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(max(syseleven_s3_space_used_bytes{project=~\"$project\"})by(__name__, project, region, type)) by(region, project, type) ", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{region}} - {{type}} ", + "range": true, + "refId": "A" + } + ], + "title": "SysEleven - Used S3 Space", + "type": "timeseries" }, { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 41 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(max(syseleven_s3_space_total_bytes{project=~\"$project\"})by(__name__, project, region, type)) by(region, project, type) ", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{region}} - {{type}}", + "range": true, + "refId": "A" + } + ], + "title": "SysEleven - Total S3 Space", + "type": "timeseries" } ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "unit": "bytes" - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 3 - }, - "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", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { - "exemplar": true, - "expr": "sum(max(syseleven_s3_space_total_bytes)by(__name__, project, region)) by(region, project) ", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{region}} ", + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "SysEleven - Total S3 Space", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "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 - } + "title": "SysEleven - S3 Space", + "type": "row" }, { "collapsed": true, @@ -865,12 +914,11 @@ "h": 1, "w": 24, "x": 0, - "y": 10 + "y": 3 }, "id": 39, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -881,12 +929,13 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -902,28 +951,38 @@ "h": 7, "w": 8, "x": 0, - "y": 4 + "y": 28 }, "id": 40, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_volume_space_used_gigabytes)by(__name__, project, region) / max(syseleven_volume_space_total_gigabytes)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_volume_space_used_gigabytes{project=~\"$project\"})by(__name__, project, region) / max(syseleven_volume_space_total_gigabytes{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -931,204 +990,209 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "bytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 4 + "y": 28 }, - "hiddenSeries": false, "id": 41, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_volume_space_used_gigabytes)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_volume_space_used_gigabytes{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Volume Space", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "bytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 4 + "y": 28 }, - "hiddenSeries": false, "id": 42, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_volume_space_total_gigabytes)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_volume_space_total_gigabytes{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Volume Space", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Volume Space", @@ -1144,12 +1208,11 @@ "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 4 }, "id": 44, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1160,12 +1223,13 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1181,28 +1245,38 @@ "h": 7, "w": 8, "x": 0, - "y": 5 + "y": 29 }, "id": 45, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_volume_volumes_used)by(__name__, project, region) / max(syseleven_volume_volumes_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_volume_volumes_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_volume_volumes_total{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -1210,204 +1284,209 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "none" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 5 + "y": 29 }, - "hiddenSeries": false, "id": 31, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_volume_volumes_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_volume_volumes_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Volumes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "none" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 5 + "y": 29 }, - "hiddenSeries": false, "id": 47, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_volume_volumes_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_volume_volumes_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Volumes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Volume Volumes", @@ -1423,12 +1502,11 @@ "h": 1, "w": 24, "x": 0, - "y": 12 + "y": 5 }, "id": 14, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1439,6 +1517,8 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -1460,28 +1540,38 @@ "h": 7, "w": 8, "x": 0, - "y": 6 + "y": 13 }, "id": 10, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_compute_instances_used)by(__name__, project, region) / max(syseleven_compute_instances_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_compute_instances_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_compute_instances_total{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -1489,210 +1579,218 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Instances" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 6 + "y": 13 }, - "hiddenSeries": false, "id": 11, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_instances_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_instances_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Compute Instances", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Instances", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Instances" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 6 + "y": 13 }, - "hiddenSeries": false, "id": 12, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_compute_instances_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_compute_instances_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Compute Instances", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Instances", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Compute Instances", "type": "row" }, { + "collapsed": true, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1701,12 +1799,11 @@ "h": 1, "w": 24, "x": 0, - "y": 13 + "y": 6 }, "id": 34, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1717,6 +1814,8 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -1740,26 +1839,36 @@ "x": 0, "y": 7 }, - "id": 35, - "links": [], + "id": 48, "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_network_loadbalancers_used)by(__name__, project, region) / max(syseleven_network_loadbalancers_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_network_loadbalancers_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_network_loadbalancers_total{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -1767,204 +1876,211 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { - "unit": "none" + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 7 }, - "hiddenSeries": false, - "id": 46, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", + "id": 49, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_network_loadbalancers_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_network_loadbalancers_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Network LoadBalancers", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { - "unit": "none" + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 7 }, - "hiddenSeries": false, - "id": 37, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", + "id": 50, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_network_loadbalancers_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_network_loadbalancers_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Network LoadBalancers", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Network LoadBalancers", @@ -1980,12 +2096,11 @@ "h": 1, "w": 24, "x": 0, - "y": 14 + "y": 7 }, "id": 29, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -1996,6 +2111,8 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -2017,28 +2134,38 @@ "h": 7, "w": 8, "x": 0, - "y": 8 + "y": 15 }, "id": 30, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_network_floating_ips_used)by(__name__, project, region) / max(syseleven_network_floating_ips_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_network_floating_ips_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_network_floating_ips_total{project=~\"$project\"})by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -2046,204 +2173,211 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "IPs" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 8 + "y": 15 }, - "hiddenSeries": false, "id": 36, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_network_floating_ips_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_network_floating_ips_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used Network Floating IPs", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "IPs", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "IPs" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 8 + "y": 15 }, - "hiddenSeries": false, "id": 32, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_network_floating_ips_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_network_floating_ips_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total Network Floating IPs", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "IPs", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - Network Floating IPs", @@ -2259,12 +2393,11 @@ "h": 1, "w": 24, "x": 0, - "y": 15 + "y": 8 }, "id": 24, "panels": [ { - "cacheTimeout": null, "datasource": { "type": "prometheus", "uid": "${datasource}" @@ -2275,6 +2408,8 @@ "mode": "thresholds" }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -2296,28 +2431,38 @@ "h": 7, "w": 8, "x": 0, - "y": 9 + "y": 47 }, "id": 20, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "auto", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "7.5.5", + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum((max(syseleven_dns_zones_used)by(__name__, project, region) / max(syseleven_dns_zones_total)by(__name__, project, region)) * 100) by(region, project)", + "expr": "sum((max(syseleven_dns_zones_used{project=~\"$project\"})by(__name__, project, region) / max(syseleven_dns_zones_total)by(__name__, project, region)) * 100) by(region, project)", "interval": "", "legendFormat": "{{region}}", + "range": true, "refId": "A" } ], @@ -2325,217 +2470,227 @@ "type": "gauge" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Zones" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 9 + "y": 47 }, - "hiddenSeries": false, "id": 21, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_dns_zones_used)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_dns_zones_used{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Used DNS Zones", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Zones", - "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 - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Zones" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 9 + "y": 47 }, - "hiddenSeries": false, "id": 17, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", "exemplar": true, - "expr": "sum(max(syseleven_dns_zones_total)by(__name__, project, region)) by(region, project) ", + "expr": "sum(max(syseleven_dns_zones_total{project=~\"$project\"})by(__name__, project, region)) by(region, project) ", "interval": "", "intervalFactor": 1, "legendFormat": "{{region}} ", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "SysEleven - Total DNS Zones", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Zones", - "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 - } + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" } ], "title": "SysEleven - DNS Zones", "type": "row" } ], - "schemaVersion": 27, - "style": "dark", + "schemaVersion": 39, "tags": [], "templating": { "list": [ { - "current": null, + "current": { + "selected": false, + "text": "Prometheus", + "value": "prometheus" + }, "hide": 0, "includeAll": false, "label": "Data Source", @@ -2547,6 +2702,34 @@ "regex": "", "skipUrlSync": false, "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "046ebaa2b2ba4182bd5e6a2d98af2bc7", + "value": "046ebaa2b2ba4182bd5e6a2d98af2bc7" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(syseleven_compute_cores_total,project)", + "hide": 0, + "includeAll": false, + "label": "Project", + "multi": false, + "name": "project", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(syseleven_compute_cores_total,project)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" } ] }, @@ -2558,5 +2741,6 @@ "timezone": "", "title": "SysEleven - Quotas", "uid": "ezkVYBqMz", - "version": 4 + "version": 2, + "weekStart": "" } diff --git a/charts/syseleven-exporter-chart/templates/deployment.yaml b/charts/syseleven-exporter-chart/templates/deployment.yaml index e24179f..4090e91 100644 --- a/charts/syseleven-exporter-chart/templates/deployment.yaml +++ b/charts/syseleven-exporter-chart/templates/deployment.yaml @@ -23,6 +23,9 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "--api-version" + - {{ .Values.openstack.apiversion }} envFrom: - secretRef: name: {{ template "syseleven-exporter.secret" . }} diff --git a/charts/syseleven-exporter-chart/templates/prometheusrule.yaml b/charts/syseleven-exporter-chart/templates/prometheusrule.yaml index 372c380..cec5fa7 100644 --- a/charts/syseleven-exporter-chart/templates/prometheusrule.yaml +++ b/charts/syseleven-exporter-chart/templates/prometheusrule.yaml @@ -59,12 +59,12 @@ spec: description: {{ "'{{ $value | humanize }}% of all Network Loadbalancers in project {{ $labels.project }} in region {{ $labels.region }} are in use.'" }} summary: {{ "'Nearly all Network Loadbalancers in project {{ $labels.project }} are in use.'" }} - alert: SysElevenS3space - expr: sum((max(syseleven_s3_space_used_bytes)by(__name__, project, region) / max(syseleven_s3_space_total_bytes)by(__name__, project, region)) * 100) by(region, project) > 90 + expr: sum((max(syseleven_s3_space_used_bytes)by(__name__, project, region, type) / max(syseleven_s3_space_total_bytes)by(__name__, project, region, type)) * 100) by(region, project, type) > 90 for: 1m labels: severity: critical annotations: - description: {{ "'{{ $value | humanize }}% of all S3 Space in project {{ $labels.project }} in region {{ $labels.region }} is in use.'" }} + description: {{ "'{{ $value | humanize }}% of all S3 Space in project {{ $labels.project }} from type { $labels.type }} in region {{ $labels.region }} is in use.'" }} summary: {{ "'High S3 disk usage in project {{ $labels.project }}.'" }} - alert: SysElevenVolumeSpace expr: sum((max(syseleven_volume_space_used_gigabytes)by(__name__, project, region) / max(syseleven_volume_space_total_gigabytes)by(__name__, project, region)) * 100) by(region, project) > 90 diff --git a/charts/syseleven-exporter-chart/values.yaml b/charts/syseleven-exporter-chart/values.yaml index 19f7e70..dc2be24 100644 --- a/charts/syseleven-exporter-chart/values.yaml +++ b/charts/syseleven-exporter-chart/values.yaml @@ -77,3 +77,4 @@ openstack: # or application_credential_id: "" application_credential_secret: "" + apiversion: v1 diff --git a/cmd/syselevenexporter/syselevenexporter.go b/cmd/syselevenexporter/syselevenexporter.go index daa8cd0..832700b 100644 --- a/cmd/syselevenexporter/syselevenexporter.go +++ b/cmd/syselevenexporter/syselevenexporter.go @@ -40,6 +40,7 @@ var ( logOutput string metricsPath string useAppCreds bool + apiVersion string ) var rootCmd = &cobra.Command{ @@ -84,7 +85,7 @@ var rootCmd = &cobra.Command{ if err != nil { log.WithError(err).Fatal("Could not create exporter") } - go exporter.Run(interval, exp) + go exporter.Run(interval, apiVersion, exp) }(projectID) } } else { @@ -99,7 +100,7 @@ var rootCmd = &cobra.Command{ if err != nil { log.WithError(err).Fatal("Could not create exporter") } - go exporter.Run(interval, exp) + go exporter.Run(interval, apiVersion, exp) } router := chi.NewRouter() @@ -183,6 +184,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&logOutput, "log.output", "plain", "Set the output format of the log line. Must be plain or json.") rootCmd.PersistentFlags().StringVar(&listenAddress, "web.listen-address", ":8080", "Address to listen on for web interface and telemetry.") rootCmd.PersistentFlags().StringVar(&metricsPath, "web.telemetry-path", "/metrics", "Path under which to expose metrics.") + rootCmd.PersistentFlags().StringVar(&apiVersion, "api-version", "v1", "specify the OpenStack API") } func main() { diff --git a/pkg/api/api.go b/pkg/api/api.go index 62885f1..898df03 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -31,20 +31,103 @@ type Error struct { var endpoint string -func GetQuota(projectID, token string) (map[string]Quota, error) { +// use API v3 for Quota and Usage Information + +func GetQuotaV3(projectID, token string) (map[string]QuotaV3, error) { if os.Getenv("SYSELEVEN_QUOTA_API_ENDPOINT") == "" { endpoint = "https://api.cloud.syseleven.net:5001" } else { endpoint = os.Getenv("SYSELEVEN_QUOTA_API_ENDPOINT") } - req, err := http.NewRequest("GET", fmt.Sprintf("%s/v1/projects/%s/quota", endpoint, projectID), nil) + req, err := http.NewRequest("GET", fmt.Sprintf("%s/v3/projects/%s/quota", endpoint, projectID), nil) if err != nil { return nil, err } req.Header.Set("X-Auth-Token", token) + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + var apiError Error + + err = json.NewDecoder(resp.Body).Decode(&apiError) + if err != nil { + return nil, err + } + + return nil, fmt.Errorf("%s: %s (%s)", apiError.Title, apiError.Detail, apiError.Type) + } + + var quotas map[string]QuotaV3 + quotas = make(map[string]QuotaV3) + + err = json.NewDecoder(resp.Body).Decode("as) + + if err != nil { + return nil, err + } + + return quotas, nil +} + +func GetCurrentUsageV3(projectID, token string) (map[string]CurrentUsageV3, error) { + req, err := http.NewRequest("GET", fmt.Sprintf("%s/v3/projects/%s/current_usage", endpoint, projectID), nil) + if err != nil { + return nil, err + } + + req.Header.Set("X-Auth-Token", token) + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + var apiError Error + + err = json.NewDecoder(resp.Body).Decode(&apiError) + if err != nil { + return nil, err + } + + return nil, fmt.Errorf("%s: %s (%s)", apiError.Title, apiError.Detail, apiError.Type) + } + + var currentUsages map[string]CurrentUsageV3 + currentUsages = make(map[string]CurrentUsageV3) + + err = json.NewDecoder(resp.Body).Decode(¤tUsages) + + if err != nil { + return nil, err + } + + return currentUsages, nil +} + +// use API v3 for Quota and Usage Information + +func GetQuotaV1(projectID, token string) (map[string]QuotaV1, error) { + if os.Getenv("SYSELEVEN_QUOTA_API_ENDPOINT") == "" { + endpoint = "https://api.cloud.syseleven.net:5001" + } else { + endpoint = os.Getenv("SYSELEVEN_QUOTA_API_ENDPOINT") + } + + req, err := http.NewRequest("GET", fmt.Sprintf("%s/v1/projects/%s/quota", endpoint, projectID), nil) + if err != nil { + return nil, err + } + + req.Header.Set("X-Auth-Token", token) resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err @@ -63,10 +146,11 @@ func GetQuota(projectID, token string) (map[string]Quota, error) { return nil, fmt.Errorf("%s: %s (%s)", apiError.Title, apiError.Detail, apiError.Type) } - var quotas map[string]Quota - quotas = make(map[string]Quota) + var quotas map[string]QuotaV1 + quotas = make(map[string]QuotaV1) err = json.NewDecoder(resp.Body).Decode("as) + if err != nil { return nil, err } @@ -74,14 +158,13 @@ func GetQuota(projectID, token string) (map[string]Quota, error) { return quotas, nil } -func GetCurrentUsage(projectID, token string) (map[string]CurrentUsage, error) { +func GetCurrentUsageV1(projectID, token string) (map[string]CurrentUsageV1, error) { req, err := http.NewRequest("GET", fmt.Sprintf("%s/v1/projects/%s/current_usage", endpoint, projectID), nil) if err != nil { return nil, err } req.Header.Set("X-Auth-Token", token) - resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err @@ -100,10 +183,11 @@ func GetCurrentUsage(projectID, token string) (map[string]CurrentUsage, error) { return nil, fmt.Errorf("%s: %s (%s)", apiError.Title, apiError.Detail, apiError.Type) } - var currentUsages map[string]CurrentUsage - currentUsages = make(map[string]CurrentUsage) + var currentUsages map[string]CurrentUsageV1 + currentUsages = make(map[string]CurrentUsageV1) err = json.NewDecoder(resp.Body).Decode(¤tUsages) + if err != nil { return nil, err } diff --git a/pkg/api/types.go b/pkg/api/types.go index 1e0949e..20a9ad1 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -16,7 +16,89 @@ limitations under the License. package api -type Quota struct { +type QuotaV3 struct { + ComputeCores float64 `json:"compute.cores"` + ComputeInstances float64 `json:"compute.instances"` + ComputeKeyPairs float64 `json:"compute.key_pairs"` + ComputeMetadataItems float64 `json:"compute.metadata_items"` + ComputeRAMMb float64 `json:"compute.ram_mb"` + ComputeServerGroupMembers float64 `json:"compute.server_group_members"` + ComputeServerGroups float64 `json:"compute.server_groups"` + DNSZones float64 `json:"dns.zones"` + LoadbalancerHealthmonitors float64 `json:"loadbalancer.healthmonitors"` + LoadbalancerListeners float64 `json:"loadbalancer.listeners"` + LoadbalancerLoadbalancers float64 `json:"loadbalancer.loadbalancers"` + LoadbalancerMembers float64 `json:"loadbalancer.members"` + LoadbalancerPools float64 `json:"loadbalancer.pools"` + NetworkFloatingips float64 `json:"network.floatingips"` + NetworkNetworks float64 `json:"network.networks"` + NetworkPorts float64 `json:"network.ports"` + NetworkRbacPolicies float64 `json:"network.rbac_policies"` + NetworkRouters float64 `json:"network.routers"` + NetworkSecurityGroupRules float64 `json:"network.security_group_rules"` + NetworkSecurityGroups float64 `json:"network.security_groups"` + NetworkSubnetPools float64 `json:"network.subnet_pools"` + NetworkSubnets float64 `json:"network.subnets"` + NetworkTrunks float64 `json:"network.trunks"` + NetworkVpnEndpointGroups float64 `json:"network.vpn_endpoint_groups"` + NetworkVpnIkepolicies float64 `json:"network.vpn_ikepolicies"` + NetworkVpnIpsecSiteConnections float64 `json:"network.vpn_ipsec_site_connections"` + NetworkVpnIpsecpolicies float64 `json:"network.vpn_ipsecpolicies"` + NetworkVpnServices float64 `json:"network.vpn_services"` + Objectstorage []struct { + SpaceBytes float64 `json:"space_bytes"` + Type string `json:"type"` + } `json:"objectstorage"` + VolumeBackupGb float64 `json:"volume.backup_gb"` + VolumeBackups float64 `json:"volume.backups"` + VolumeSnapshots float64 `json:"volume.snapshots"` + VolumeSpaceGb float64 `json:"volume.space_gb"` + VolumeVolumes float64 `json:"volume.volumes"` +} + +type CurrentUsageV3 struct { + ComputeCores float64 `json:"compute.cores"` + ComputeFlavors map[string]float64 `json:"compute.flavors"` + ComputeInstances float64 `json:"compute.instances"` + ComputeRAMMb float64 `json:"compute.ram_mb"` + ComputeServerGroups float64 `json:"compute.server_groups"` + DNSZones float64 `json:"dns.zones"` + ImageImages float64 `json:"image.images"` + ImageSpaceBytes float64 `json:"image.space_bytes"` + LoadbalancerFlavors struct { + } `json:"loadbalancer.flavors"` + LoadbalancerHealthmonitors float64 `json:"loadbalancer.healthmonitors"` + LoadbalancerListeners float64 `json:"loadbalancer.listeners"` + LoadbalancerLoadbalancers float64 `json:"loadbalancer.loadbalancers"` + LoadbalancerMembers float64 `json:"loadbalancer.members"` + LoadbalancerPools float64 `json:"loadbalancer.pools"` + NetworkFloatingips float64 `json:"network.floatingips"` + NetworkNetworks float64 `json:"network.networks"` + NetworkPorts float64 `json:"network.ports"` + NetworkRbacPolicies float64 `json:"network.rbac_policies"` + NetworkRouters float64 `json:"network.routers"` + NetworkSecurityGroupRules float64 `json:"network.security_group_rules"` + NetworkSecurityGroups float64 `json:"network.security_groups"` + NetworkSubnetPools float64 `json:"network.subnet_pools"` + NetworkSubnets float64 `json:"network.subnets"` + NetworkTrunks float64 `json:"network.trunks"` + NetworkVpnEndpointGroups float64 `json:"network.vpn_endpoint_groups"` + NetworkVpnIkepolicies float64 `json:"network.vpn_ikepolicies"` + NetworkVpnIpsecSiteConnections float64 `json:"network.vpn_ipsec_site_connections"` + NetworkVpnIpsecpolicies float64 `json:"network.vpn_ipsecpolicies"` + NetworkVpnServices float64 `json:"network.vpn_services"` + Objectstorage []struct { + SpaceBytes float64 `json:"space_bytes"` + Type string `json:"type"` + } `json:"objectstorage"` + VolumeBackupGb float64 `json:"volume.backup_gb"` + VolumeBackups float64 `json:"volume.backups"` + VolumeSnapshots float64 `json:"volume.snapshots"` + VolumeSpaceGb float64 `json:"volume.space_gb"` + VolumeVolumes float64 `json:"volume.volumes"` +} + +type QuotaV1 struct { ComputeCores float64 `json:"compute.cores"` ComputeInstances float64 `json:"compute.instances"` ComputeRAMMb float64 `json:"compute.ram_mb"` @@ -37,7 +119,7 @@ type Quota struct { VolumeVolumes float64 `json:"volume.volumes"` } -type CurrentUsage struct { +type CurrentUsageV1 struct { ComputeCores float64 `json:"compute.cores"` ComputeFlavors map[string]float64 `json:"compute.flavors"` ComputeInstances float64 `json:"compute.instances"` diff --git a/pkg/exporter/exporter.go b/pkg/exporter/exporter.go index 1f9bbe1..ca91a18 100644 --- a/pkg/exporter/exporter.go +++ b/pkg/exporter/exporter.go @@ -42,7 +42,120 @@ func New(projectID string, useAppCreds bool, username string, password string) ( }, nil } -func Run(interval int64, exporter *Exporter) { +// set utils for API v3 for Quota and Usage Information + +func SetUtilsV3(quota map[string]api.QuotaV3, usage map[string]api.CurrentUsageV3, exporter *Exporter) { + computeCoresTotal.Reset() + computeInstancesTotal.Reset() + computeRamTotalMegabytes.Reset() + dnsZonesTotal.Reset() + networkFloatingIPsTotal.Reset() + networkLoadbalancersTotal.Reset() + s3SpaceTotalBytes.Reset() + volumeSpaceTotalGigabytes.Reset() + volumeVolumesTotalGigabytes.Reset() + computeCoresUsed.Reset() + computeInstancesUsed.Reset() + computeRamUsedMegabytes.Reset() + dnsZonesUsed.Reset() + networkFloatingIPsUsed.Reset() + networkLoadbalancersUsed.Reset() + s3SpaceUsedBytes.Reset() + volumeSpaceUsedGigabytes.Reset() + volumeVolumesUsedGigabytes.Reset() + computeFlavorsUsed.Reset() + + for k, v := range quota { + computeCoresTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) + computeInstancesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) + computeRamTotalMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) + dnsZonesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) + networkFloatingIPsTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) + networkLoadbalancersTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.LoadbalancerLoadbalancers) + volumeSpaceTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) + volumeVolumesTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) + + for _, os := range v.Objectstorage { + s3SpaceTotalBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "type": os.Type}).Set(os.SpaceBytes) + } + + } + + for k, v := range usage { + computeCoresUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) + computeInstancesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) + computeRamUsedMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) + dnsZonesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) + networkFloatingIPsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) + networkLoadbalancersUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.LoadbalancerLoadbalancers) + volumeSpaceUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) + volumeVolumesUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) + + for flavor := range v.ComputeFlavors { + computeFlavorsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "flavor": flavor}).Set(v.ComputeFlavors[flavor]) + } + + for _, os := range v.Objectstorage { + s3SpaceUsedBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "type": os.Type}).Set(os.SpaceBytes) + } + } + + +} + +// set utils for API v1 for Quota and Usage Information + +func SetUtilsV1(quota map[string]api.QuotaV1, usage map[string]api.CurrentUsageV1, exporter *Exporter) { + computeCoresTotal.Reset() + computeInstancesTotal.Reset() + computeRamTotalMegabytes.Reset() + dnsZonesTotal.Reset() + networkFloatingIPsTotal.Reset() + networkLoadbalancersTotal.Reset() + s3SpaceTotalBytes.Reset() + volumeSpaceTotalGigabytes.Reset() + volumeVolumesTotalGigabytes.Reset() + computeCoresUsed.Reset() + computeInstancesUsed.Reset() + computeRamUsedMegabytes.Reset() + dnsZonesUsed.Reset() + networkFloatingIPsUsed.Reset() + networkLoadbalancersUsed.Reset() + s3SpaceUsedBytes.Reset() + volumeSpaceUsedGigabytes.Reset() + volumeVolumesUsedGigabytes.Reset() + computeFlavorsUsed.Reset() + + for k, v := range quota { + computeCoresTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) + computeInstancesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) + computeRamTotalMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) + dnsZonesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) + networkFloatingIPsTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) + networkLoadbalancersTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkLoadbalancers) + s3SpaceTotalBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "type": "quobyte"}).Set(v.S3SpaceBytes) + volumeSpaceTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) + volumeVolumesTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) + } + + for k, v := range usage { + computeCoresUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) + computeInstancesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) + computeRamUsedMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) + dnsZonesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) + networkFloatingIPsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) + networkLoadbalancersUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkLoadbalancers) + s3SpaceUsedBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "type": "quobyte"}).Set(v.S3SpaceBytes) + volumeSpaceUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) + volumeVolumesUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) + + for flavor := range v.ComputeFlavors { + computeFlavorsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "flavor": flavor}).Set(v.ComputeFlavors[flavor]) + } + } +} + +func Run(interval int64, apiVersion string, exporter *Exporter) { for { var token string var err error @@ -59,66 +172,40 @@ func Run(interval int64, exporter *Exporter) { continue } - quota, err := api.GetQuota(exporter.ProjectID, token) - if err != nil { - log.WithError(err).Error("Could not get quota") - time.Sleep(60 * time.Second) - continue - } + switch { + case apiVersion == "v3": + quota, err := api.GetQuotaV3(exporter.ProjectID, token) + if err != nil { + log.WithError(err).Error("Could not get quota") + time.Sleep(60 * time.Second) + continue + } - usage, err := api.GetCurrentUsage(exporter.ProjectID, token) - if err != nil { - log.WithError(err).Error("Could not get current usage") - time.Sleep(60 * time.Second) - continue - } + usage, err := api.GetCurrentUsageV3(exporter.ProjectID, token) + if err != nil { + log.WithError(err).Error("Could not get current usage") + time.Sleep(60 * time.Second) + continue + } - computeCoresTotal.Reset() - computeInstancesTotal.Reset() - computeRamTotalMegabytes.Reset() - dnsZonesTotal.Reset() - networkFloatingIPsTotal.Reset() - networkLoadbalancersTotal.Reset() - s3SpaceTotalBytes.Reset() - volumeSpaceTotalGigabytes.Reset() - volumeVolumesTotalGigabytes.Reset() - computeCoresUsed.Reset() - computeInstancesUsed.Reset() - computeRamUsedMegabytes.Reset() - dnsZonesUsed.Reset() - networkFloatingIPsUsed.Reset() - networkLoadbalancersUsed.Reset() - s3SpaceUsedBytes.Reset() - volumeSpaceUsedGigabytes.Reset() - volumeVolumesUsedGigabytes.Reset() - computeFlavorsUsed.Reset() - - for k, v := range quota { - computeCoresTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) - computeInstancesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) - computeRamTotalMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) - dnsZonesTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) - networkFloatingIPsTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) - networkLoadbalancersTotal.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkLoadbalancers) - s3SpaceTotalBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.S3SpaceBytes) - volumeSpaceTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) - volumeVolumesTotalGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) - } + SetUtilsV3(quota, usage, exporter) + + default: + quota, err := api.GetQuotaV1(exporter.ProjectID, token) + if err != nil { + log.WithError(err).Error("Could not get quota") + time.Sleep(60 * time.Second) + continue + } - for k, v := range usage { - computeCoresUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeCores) - computeInstancesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeInstances) - computeRamUsedMegabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.ComputeRAMMb) - dnsZonesUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.DNSZones) - networkFloatingIPsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkFloatingips) - networkLoadbalancersUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.NetworkLoadbalancers) - s3SpaceUsedBytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.S3SpaceBytes) - volumeSpaceUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeSpaceGb) - volumeVolumesUsedGigabytes.With(prometheus.Labels{"region": k, "project": exporter.ProjectID}).Set(v.VolumeVolumes) - - for flavor := range v.ComputeFlavors { - computeFlavorsUsed.With(prometheus.Labels{"region": k, "project": exporter.ProjectID, "flavor": flavor}).Set(v.ComputeFlavors[flavor]) + usage, err := api.GetCurrentUsageV1(exporter.ProjectID, token) + if err != nil { + log.WithError(err).Error("Could not get current usage") + time.Sleep(60 * time.Second) + continue } + + SetUtilsV1(quota, usage, exporter) } time.Sleep(time.Duration(interval) * time.Second) diff --git a/pkg/exporter/metrics.go b/pkg/exporter/metrics.go index 5db09ca..1d2ab10 100644 --- a/pkg/exporter/metrics.go +++ b/pkg/exporter/metrics.go @@ -106,13 +106,13 @@ var ( Namespace: namespace, Name: "s3_space_total_bytes", Help: "Quota for S3 space per region and project in bytes", - }, []string{"region", "project"}) + }, []string{"region", "project", "type"}) s3SpaceUsedBytes = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "s3_space_used_bytes", Help: "Used S3 space per region and project in bytes", - }, []string{"region", "project"}) + }, []string{"region", "project", "type"}) volumeSpaceTotalGigabytes = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace,