Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/fixtures/grafana')
-rw-r--r--spec/fixtures/grafana/dashboard_response.json764
-rw-r--r--spec/fixtures/grafana/datasource_response.json21
-rw-r--r--spec/fixtures/grafana/expected_grafana_embed.json27
-rw-r--r--spec/fixtures/grafana/proxy_response.json459
-rw-r--r--spec/fixtures/grafana/simplified_dashboard_response.json40
5 files changed, 1311 insertions, 0 deletions
diff --git a/spec/fixtures/grafana/dashboard_response.json b/spec/fixtures/grafana/dashboard_response.json
new file mode 100644
index 00000000000..c0dd77e2fdc
--- /dev/null
+++ b/spec/fixtures/grafana/dashboard_response.json
@@ -0,0 +1,764 @@
+{
+ "meta": {
+ "type": "db",
+ "canSave": true,
+ "canEdit": true,
+ "canAdmin": true,
+ "canStar": true,
+ "slug": "gitlab-omnibus-redis",
+ "url": "/-/grafana/d/XDaNK6amz/gitlab-omnibus-redis",
+ "expires": "0001-01-01T00:00:00Z",
+ "created": "2019-10-04T13:43:20Z",
+ "updated": "2019-10-04T13:43:20Z",
+ "updatedBy": "Anonymous",
+ "createdBy": "Anonymous",
+ "version": 1,
+ "hasAcl": false,
+ "isFolder": false,
+ "folderId": 1,
+ "folderTitle": "GitLab Omnibus",
+ "folderUrl": "/-/grafana/dashboards/f/l2EpNh2Zk/gitlab-omnibus",
+ "provisioned": true,
+ "provisionedExternalId": "redis.json"
+ },
+ "dashboard": {
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations \u0026 Alerts",
+ "type": "dashboard"
+ }
+ ]
+ },
+ "description": "GitLab Omnibus dashboard for Redis servers",
+ "editable": true,
+ "gnetId": 763,
+ "graphTooltip": 0,
+ "id": 3,
+ "iteration": 1556027798221,
+ "links": [],
+ "panels": [
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
+ "datasource": "GitLab Omnibus",
+ "decimals": 0,
+ "editable": true,
+ "error": false,
+ "format": "dtdurations",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": { "h": 3, "w": 4, "x": 0, "y": 0 },
+ "id": 9,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ { "name": "value to text", "value": 1 },
+ { "name": "range to text", "value": 2 }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [{ "from": "null", "text": "N/A", "to": "null" }],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "tableColumn": "addr",
+ "targets": [
+ {
+ "expr": "avg(time() - redis_start_time_seconds{instance=~\"$instance\"})",
+ "format": "time_series",
+ "instant": true,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "metric": "",
+ "refId": "A",
+ "step": 1800
+ }
+ ],
+ "thresholds": "",
+ "title": "Uptime",
+ "type": "singlestat",
+ "valueFontSize": "70%",
+ "valueMaps": [{ "op": "=", "text": "N/A", "value": "null" }],
+ "valueName": "current"
+ },
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
+ "datasource": "GitLab Omnibus",
+ "decimals": 0,
+ "editable": true,
+ "error": false,
+ "format": "none",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": { "h": 3, "w": 4, "x": 4, "y": 0 },
+ "hideTimeOverride": true,
+ "id": 12,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ { "name": "value to text", "value": 1 },
+ { "name": "range to text", "value": 2 }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [{ "from": "null", "text": "N/A", "to": "null" }],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum(\n avg_over_time(redis_connected_clients{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "metric": "",
+ "refId": "A",
+ "step": 2
+ }
+ ],
+ "thresholds": "",
+ "timeFrom": "1m",
+ "timeShift": null,
+ "title": "Clients",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [{ "op": "=", "text": "N/A", "value": "null" }],
+ "valueName": "avg"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "gridPos": { "h": 6, "w": 8, "x": 8, "y": 0 },
+ "id": 2,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(\n rate(redis_commands_processed_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "metric": "A",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Commands Executed",
+ "tooltip": { "msResolution": false, "shared": true, "sort": 0, "value_type": "cumulative" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "reqps", "label": null, "logBase": 1, "max": null, "min": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "decimals": 2,
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "gridPos": { "h": 6, "w": 8, "x": 16, "y": 0 },
+ "id": 1,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": true,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(\n rate(redis_keyspace_hits_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "hide": false,
+ "interval": "1m",
+ "intervalFactor": 1,
+ "legendFormat": "hits",
+ "metric": "",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ },
+ {
+ "expr": "sum(\n rate(redis_keyspace_misses_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "hide": false,
+ "interval": "1m",
+ "intervalFactor": 1,
+ "legendFormat": "misses",
+ "metric": "",
+ "refId": "B",
+ "step": 240,
+ "target": ""
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Hits, Misses per Second",
+ "tooltip": { "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "short", "label": "", "logBase": 1, "max": null, "min": 0, "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": { "max": "#BF1B00" },
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "gridPos": { "h": 10, "w": 8, "x": 0, "y": 3 },
+ "id": 7,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "hideEmpty": false,
+ "hideZero": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "null as zero",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [{ "alias": "/max - .*/", "dashes": true }],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "redis_memory_used_bytes{instance=~\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used - {{instance}}",
+ "metric": "",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ },
+ {
+ "expr": "redis_config_maxmemory{instance=~\"$instance\"} \u003e 0",
+ "format": "time_series",
+ "hide": false,
+ "intervalFactor": 2,
+ "legendFormat": "max - {{instance}}",
+ "refId": "B",
+ "step": 240
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Memory Usage",
+ "tooltip": { "msResolution": false, "shared": true, "sort": 0, "value_type": "cumulative" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "bytes", "label": null, "logBase": 1, "max": null, "min": 0, "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {
+ "evicts": "#890F02",
+ "memcached_items_evicted_total{instance=\"172.17.0.1:9150\",job=\"prometheus\"}": "#890F02",
+ "reclaims": "#3F6833"
+ },
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "gridPos": { "h": 7, "w": 8, "x": 8, "y": 6 },
+ "id": 8,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [{ "alias": "reclaims", "yaxis": 2 }],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(rate(redis_expired_keys_total{instance=~\"$instance\"}[$__interval]))",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "expired - {{ test_attribute }}",
+ "metric": "",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ },
+ {
+ "expr": "sum(rate(redis_evicted_keys_total{instance=~\"$instance\"}[$__interval]))",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "evicted",
+ "refId": "B",
+ "step": 240
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Expired / Evicted",
+ "tooltip": { "msResolution": false, "shared": true, "sort": 0, "value_type": "cumulative" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "gridPos": { "h": 7, "w": 8, "x": 16, "y": 6 },
+ "id": 10,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(\n rate(redis_net_input_bytes_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "In",
+ "refId": "A",
+ "step": 240
+ },
+ {
+ "expr": "sum(\n rate(redis_net_output_bytes_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "Out",
+ "refId": "B",
+ "step": 240
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Network I/O",
+ "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "Bps", "label": null, "logBase": 1, "max": null, "min": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 8,
+ "grid": {},
+ "gridPos": { "h": 7, "w": 16, "x": 0, "y": 13 },
+ "id": 14,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "max": true,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum without (instance) (\n rate(redis_commands_total{instance=~\"$instance\"}[$__interval])\n) \u003e 0",
+ "format": "time_series",
+ "interval": "1m",
+ "intervalFactor": 2,
+ "legendFormat": "{{ cmd }}",
+ "metric": "redis_command_calls_total",
+ "refId": "A",
+ "step": 240
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Command Calls / sec",
+ "tooltip": { "msResolution": true, "shared": true, "sort": 2, "value_type": "individual" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 7,
+ "grid": {},
+ "gridPos": { "h": 7, "w": 8, "x": 16, "y": 13 },
+ "id": 13,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(redis_db_keys{instance=~\"$instance\"} - redis_db_keys_expiring{instance=~\"$instance\"}) ",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "not expiring",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ },
+ {
+ "expr": "sum(redis_db_keys_expiring{instance=~\"$instance\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "expiring",
+ "metric": "",
+ "refId": "B",
+ "step": 240
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Expiring vs Not-Expiring Keys",
+ "tooltip": { "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" },
+ "type": "graph",
+ "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] },
+ "yaxes": [
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "GitLab Omnibus",
+ "editable": true,
+ "error": false,
+ "fill": 7,
+ "grid": {},
+ "gridPos": { "h": 7, "w": 16, "x": 0, "y": 20 },
+ "id": 5,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": false,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "paceLength": 10,
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (db) (\n redis_db_keys{instance=~\"$instance\"}\n)",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "{{ db }} ",
+ "refId": "A",
+ "step": 240,
+ "target": ""
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Items per DB",
+ "tooltip": { "msResolution": false, "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": "0", "show": true },
+ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }
+ ],
+ "yaxis": { "align": false, "alignLevel": null }
+ }
+ ],
+ "refresh": "1m",
+ "schemaVersion": 18,
+ "style": "dark",
+ "tags": ["redis"],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": { "tags": [], "text": "All", "value": "$__all" },
+ "datasource": "GitLab Omnibus",
+ "definition": "",
+ "hide": 0,
+ "includeAll": true,
+ "label": null,
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": "label_values(up{job=\"redis\"}, instance)",
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": { "from": "now-24h", "to": "now" },
+ "timepicker": {
+ "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
+ "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
+ },
+ "timezone": "",
+ "title": "GitLab Omnibus - Redis",
+ "uid": "XDaNK6amz",
+ "version": 1
+ }
+}
diff --git a/spec/fixtures/grafana/datasource_response.json b/spec/fixtures/grafana/datasource_response.json
new file mode 100644
index 00000000000..07c075beb35
--- /dev/null
+++ b/spec/fixtures/grafana/datasource_response.json
@@ -0,0 +1,21 @@
+{
+ "id": 1,
+ "orgId": 1,
+ "name": "GitLab Omnibus",
+ "type": "prometheus",
+ "typeLogoUrl": "",
+ "access": "proxy",
+ "url": "http://localhost:9090",
+ "password": "",
+ "user": "",
+ "database": "",
+ "basicAuth": false,
+ "basicAuthUser": "",
+ "basicAuthPassword": "",
+ "withCredentials": false,
+ "isDefault": true,
+ "jsonData": {},
+ "secureJsonFields": {},
+ "version": 1,
+ "readOnly": true
+}
diff --git a/spec/fixtures/grafana/expected_grafana_embed.json b/spec/fixtures/grafana/expected_grafana_embed.json
new file mode 100644
index 00000000000..72fb5477b9e
--- /dev/null
+++ b/spec/fixtures/grafana/expected_grafana_embed.json
@@ -0,0 +1,27 @@
+{
+ "panel_groups": [
+ {
+ "panels": [
+ {
+ "title": "Network I/O",
+ "type": "area-chart",
+ "y_label": "",
+ "metrics": [
+ {
+ "id": "In_0",
+ "query_range": "sum( rate(redis_net_input_bytes_total{instance=~\"localhost:9121\"}[1m]))",
+ "label": "In",
+ "prometheus_endpoint_path": "/foo/bar/-/grafana/proxy/1/api/v1/query_range?query=sum%28++rate%28redis_net_input_bytes_total%7Binstance%3D~%22localhost%3A9121%22%7D%5B1m%5D%29%29"
+ },
+ {
+ "id": "Out_1",
+ "query_range": "sum( rate(redis_net_output_bytes_total{instance=~\"localhost:9121\"}[1m]))",
+ "label": "Out",
+ "prometheus_endpoint_path": "/foo/bar/-/grafana/proxy/1/api/v1/query_range?query=sum%28++rate%28redis_net_output_bytes_total%7Binstance%3D~%22localhost%3A9121%22%7D%5B1m%5D%29%29"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/spec/fixtures/grafana/proxy_response.json b/spec/fixtures/grafana/proxy_response.json
new file mode 100644
index 00000000000..b9f34abcaaf
--- /dev/null
+++ b/spec/fixtures/grafana/proxy_response.json
@@ -0,0 +1,459 @@
+{
+ "status": "success",
+ "data": {
+ "resultType": "matrix",
+ "result": [
+ {
+ "metric": {
+ "test_attribute": "test-attribute-value"
+ },
+ "values": [
+ [1570768177, "54"],
+ [1570768237, "54"],
+ [1570768297, "54"],
+ [1570768357, "54"],
+ [1570768417, "54"],
+ [1570768477, "54"],
+ [1570768537, "54"],
+ [1570768597, "54"],
+ [1570768657, "54"],
+ [1570768717, "54"],
+ [1570768777, "54"],
+ [1570768837, "54"],
+ [1570768897, "54"],
+ [1570768957, "54"],
+ [1570769017, "54"],
+ [1570769077, "54"],
+ [1570769377, "54"],
+ [1570769437, "54"],
+ [1570769497, "54"],
+ [1570769557, "54"],
+ [1570769617, "54"],
+ [1570769677, "54"],
+ [1570769737, "54"],
+ [1570769797, "54"],
+ [1570769857, "54"],
+ [1570769917, "54"],
+ [1570769977, "54"],
+ [1570770037, "54"],
+ [1570770097, "54"],
+ [1570770157, "54"],
+ [1570770217, "54"],
+ [1570770277, "54"],
+ [1570770337, "54"],
+ [1570770397, "54"],
+ [1570770457, "54"],
+ [1570770517, "54"],
+ [1570770577, "54"],
+ [1570770637, "54"],
+ [1570770697, "54"],
+ [1570770757, "54"],
+ [1570770817, "54"],
+ [1570770877, "54"],
+ [1570770937, "54"],
+ [1570770997, "54"],
+ [1570771057, "54"],
+ [1570771117, "54"],
+ [1570771177, "54"],
+ [1570771237, "54"],
+ [1570771297, "54"],
+ [1570771357, "54"],
+ [1570771417, "54"],
+ [1570771477, "54"],
+ [1570771537, "54"],
+ [1570771597, "54"],
+ [1570771657, "54"],
+ [1570771717, "54"],
+ [1570771777, "54"],
+ [1570771837, "54"],
+ [1570771897, "54"],
+ [1570771957, "54"],
+ [1570772017, "54"],
+ [1570772077, "54"],
+ [1570772137, "54"],
+ [1570772197, "54"],
+ [1570772257, "54"],
+ [1570772317, "54"],
+ [1570772377, "54"],
+ [1570772437, "54"],
+ [1570772497, "54"],
+ [1570772557, "54"],
+ [1570772617, "54"],
+ [1570772677, "54"],
+ [1570772737, "54"],
+ [1570772797, "54"],
+ [1570772857, "54"],
+ [1570772917, "54"],
+ [1570772977, "54"],
+ [1570773037, "54"],
+ [1570773097, "54"],
+ [1570773157, "54"],
+ [1570773217, "54"],
+ [1570773277, "54"],
+ [1570773337, "54"],
+ [1570773397, "54"],
+ [1570773457, "54"],
+ [1570773517, "54"],
+ [1570773577, "54"],
+ [1570773637, "54"],
+ [1570773697, "54"],
+ [1570773757, "54"],
+ [1570773817, "54"],
+ [1570773877, "54"],
+ [1570773937, "54"],
+ [1570773997, "54"],
+ [1570774057, "54"],
+ [1570774117, "54"],
+ [1570774177, "54"],
+ [1570774237, "54"],
+ [1570774297, "54"],
+ [1570774357, "54"],
+ [1570774417, "54"],
+ [1570774477, "54"],
+ [1570774537, "54"],
+ [1570774597, "54"],
+ [1570774657, "54"],
+ [1570774717, "54"],
+ [1570774777, "54"],
+ [1570774837, "54"],
+ [1570774897, "54"],
+ [1570774957, "54"],
+ [1570775017, "54"],
+ [1570775077, "54"],
+ [1570775137, "54"],
+ [1570776937, "54"],
+ [1570776997, "54"],
+ [1570777057, "54"],
+ [1570777117, "54"],
+ [1570777177, "54"],
+ [1570777237, "54"],
+ [1570777297, "54"],
+ [1570777357, "54"],
+ [1570777417, "54"],
+ [1570777477, "54"],
+ [1570777537, "54"],
+ [1570777597, "54"],
+ [1570777657, "54"],
+ [1570777717, "54"],
+ [1570778017, "54"],
+ [1570778077, "54"],
+ [1570778137, "54"],
+ [1570778197, "54"],
+ [1570778257, "54"],
+ [1570778317, "54"],
+ [1570778377, "54"],
+ [1570778437, "54"],
+ [1570778497, "54"],
+ [1570778557, "54"],
+ [1570778617, "54"],
+ [1570778677, "54"],
+ [1570778737, "54"],
+ [1570778797, "54"],
+ [1570778857, "54"],
+ [1570778917, "54"],
+ [1570778977, "54"],
+ [1570779037, "54"],
+ [1570779097, "54"],
+ [1570779157, "54"],
+ [1570779217, "54"],
+ [1570779277, "54"],
+ [1570779337, "54"],
+ [1570779397, "54"],
+ [1570779457, "54"],
+ [1570779517, "54"],
+ [1570779577, "54"],
+ [1570779637, "54"],
+ [1570779697, "54"],
+ [1570779757, "54"],
+ [1570779817, "54"],
+ [1570779877, "54"],
+ [1570779937, "54"],
+ [1570779997, "54"],
+ [1570780057, "54"],
+ [1570780117, "54"],
+ [1570780177, "54"],
+ [1570780237, "54"],
+ [1570780297, "54"],
+ [1570780357, "54"],
+ [1570780417, "54"],
+ [1570780477, "54"],
+ [1570780537, "54"],
+ [1570780597, "54"],
+ [1570780657, "54"],
+ [1570780717, "54"],
+ [1570780777, "54"],
+ [1570780837, "54"],
+ [1570780897, "54"],
+ [1570780957, "54"],
+ [1570781017, "54"],
+ [1570781077, "54"],
+ [1570781137, "54"],
+ [1570781197, "54"],
+ [1570781257, "54"],
+ [1570781317, "54"],
+ [1570781377, "54"],
+ [1570781437, "54"],
+ [1570781497, "54"],
+ [1570781557, "54"],
+ [1570781617, "54"],
+ [1570781677, "54"],
+ [1570781737, "54"],
+ [1570781797, "54"],
+ [1570781857, "54"],
+ [1570781917, "54"],
+ [1570781977, "54"],
+ [1570782037, "54"],
+ [1570782097, "54"],
+ [1570782157, "54"],
+ [1570782217, "54"],
+ [1570782277, "54"],
+ [1570782337, "54"],
+ [1570782397, "54"],
+ [1570782457, "54"],
+ [1570782517, "54"],
+ [1570782577, "54"],
+ [1570782637, "54"],
+ [1570782697, "54"],
+ [1570782757, "54"],
+ [1570782817, "54"],
+ [1570782877, "54"],
+ [1570782937, "54"],
+ [1570782997, "54"],
+ [1570783057, "54"],
+ [1570783117, "54"],
+ [1570783177, "54"],
+ [1570783237, "54"],
+ [1570783297, "54"],
+ [1570783357, "54"],
+ [1570783417, "54"],
+ [1570783477, "54"],
+ [1570783537, "54"],
+ [1570783597, "54"],
+ [1570783657, "54"],
+ [1570783717, "54"],
+ [1570783777, "54"],
+ [1570783837, "54"],
+ [1570783897, "54"],
+ [1570783957, "54"],
+ [1570784017, "54"],
+ [1570784077, "54"],
+ [1570784137, "54"],
+ [1570784197, "54"],
+ [1570784257, "54"],
+ [1570784317, "54"],
+ [1570784377, "54"],
+ [1570784437, "54"],
+ [1570784497, "54"],
+ [1570784557, "54"],
+ [1570784617, "54"],
+ [1570784677, "54"],
+ [1570784737, "54"],
+ [1570784797, "54"],
+ [1570784857, "54"],
+ [1570784917, "54"],
+ [1570784977, "54"],
+ [1570785037, "54"],
+ [1570785097, "54"],
+ [1570785157, "54"],
+ [1570785217, "54"],
+ [1570785277, "54"],
+ [1570785337, "54"],
+ [1570785397, "54"],
+ [1570785457, "54"],
+ [1570785517, "54"],
+ [1570785577, "54"],
+ [1570785637, "54"],
+ [1570785697, "54"],
+ [1570785757, "54"],
+ [1570785817, "54"],
+ [1570785877, "54"],
+ [1570785937, "54"],
+ [1570785997, "54"],
+ [1570786057, "54"],
+ [1570786117, "54"],
+ [1570786177, "54"],
+ [1570786237, "54"],
+ [1570786297, "54"],
+ [1570786357, "54"],
+ [1570786417, "54"],
+ [1570786477, "54"],
+ [1570786537, "54"],
+ [1570786597, "54"],
+ [1570786657, "54"],
+ [1570786717, "54"],
+ [1570786777, "54"],
+ [1570786837, "54"],
+ [1570786897, "54"],
+ [1570786957, "53"],
+ [1570787017, "54"],
+ [1570787077, "54"],
+ [1570787137, "54"],
+ [1570787197, "54"],
+ [1570787257, "54"],
+ [1570787317, "54"],
+ [1570787377, "54"],
+ [1570787437, "54"],
+ [1570787497, "54"],
+ [1570787557, "54"],
+ [1570787617, "54"],
+ [1570787677, "54"],
+ [1570787737, "54"],
+ [1570787797, "54"],
+ [1570787857, "54"],
+ [1570787917, "54"],
+ [1570787977, "54"],
+ [1570788037, "54"],
+ [1570788097, "54"],
+ [1570788157, "54"],
+ [1570788217, "54"],
+ [1570788277, "54"],
+ [1570788337, "54"],
+ [1570788397, "54"],
+ [1570788457, "54"],
+ [1570788517, "54"],
+ [1570788577, "54"],
+ [1570788637, "54"],
+ [1570788697, "54"],
+ [1570788757, "54"],
+ [1570788817, "54"],
+ [1570788877, "54"],
+ [1570788937, "54"],
+ [1570788997, "54"],
+ [1570789057, "54"],
+ [1570789117, "54"],
+ [1570789177, "54"],
+ [1570789237, "54"],
+ [1570789297, "54"],
+ [1570789357, "54"],
+ [1570789417, "54"],
+ [1570789477, "54"],
+ [1570789537, "54"],
+ [1570789597, "54"],
+ [1570789657, "54"],
+ [1570789717, "54"],
+ [1570789777, "54"],
+ [1570789837, "54"],
+ [1570789897, "54"],
+ [1570789957, "54"],
+ [1570790017, "54"],
+ [1570790077, "54"],
+ [1570790137, "54"],
+ [1570790197, "54"],
+ [1570790257, "54"],
+ [1570790317, "54"],
+ [1570790377, "54"],
+ [1570790437, "54"],
+ [1570790497, "54"],
+ [1570790557, "54"],
+ [1570790617, "54"],
+ [1570790677, "54"],
+ [1570790737, "54"],
+ [1570790797, "54"],
+ [1570790857, "54"],
+ [1570790917, "54"],
+ [1570790977, "54"],
+ [1570791037, "54"],
+ [1570791097, "54"],
+ [1570791157, "54"],
+ [1570791217, "54"],
+ [1570791277, "54"],
+ [1570791337, "54"],
+ [1570791397, "54"],
+ [1570791457, "54"],
+ [1570791517, "54"],
+ [1570791577, "54"],
+ [1570791637, "54"],
+ [1570791697, "54"],
+ [1570791757, "54"],
+ [1570791817, "54"],
+ [1570791877, "54"],
+ [1570791937, "54"],
+ [1570791997, "54"],
+ [1570792057, "54"],
+ [1570792117, "54"],
+ [1570792177, "54"],
+ [1570792237, "54"],
+ [1570792297, "54"],
+ [1570792357, "54"],
+ [1570792417, "54"],
+ [1570792477, "54"],
+ [1570792537, "54"],
+ [1570792597, "54"],
+ [1570792657, "54"],
+ [1570792717, "54"],
+ [1570792777, "54"],
+ [1570792837, "54"],
+ [1570792897, "54"],
+ [1570792957, "54"],
+ [1570793017, "54"],
+ [1570793077, "54"],
+ [1570793137, "54"],
+ [1570793197, "54"],
+ [1570793257, "54"],
+ [1570793317, "54"],
+ [1570793377, "54"],
+ [1570793437, "54"],
+ [1570793497, "54"],
+ [1570793557, "54"],
+ [1570793617, "54"],
+ [1570793677, "54"],
+ [1570793737, "54"],
+ [1570793797, "54"],
+ [1570793857, "54"],
+ [1570793917, "54"],
+ [1570793977, "54"],
+ [1570794037, "54"],
+ [1570794097, "54"],
+ [1570794157, "54"],
+ [1570794217, "54"],
+ [1570794277, "54"],
+ [1570794337, "54"],
+ [1570794397, "54"],
+ [1570794457, "54"],
+ [1570794517, "54"],
+ [1570794577, "54"],
+ [1570794637, "54"],
+ [1570794697, "54"],
+ [1570794757, "54"],
+ [1570794817, "54"],
+ [1570794877, "54"],
+ [1570794937, "54"],
+ [1570794997, "54"],
+ [1570795057, "54"],
+ [1570795117, "54"],
+ [1570795177, "54"],
+ [1570795237, "54"],
+ [1570795297, "54"],
+ [1570795357, "54"],
+ [1570795417, "54"],
+ [1570795477, "54"],
+ [1570795537, "54"],
+ [1570795597, "54"],
+ [1570795657, "54"],
+ [1570795717, "54"],
+ [1570795777, "54"],
+ [1570795837, "54"],
+ [1570795897, "54"],
+ [1570795957, "54"],
+ [1570796017, "54"],
+ [1570796077, "54"],
+ [1570796137, "54"],
+ [1570796197, "54"],
+ [1570796257, "54"],
+ [1570796317, "54"],
+ [1570796377, "54"],
+ [1570796437, "55"],
+ [1570796497, "54"],
+ [1570796557, "54"],
+ [1570796617, "54"],
+ [1570796677, "54"],
+ [1570796737, "54"],
+ [1570796797, "54"],
+ [1570796857, "54"],
+ [1570796917, "54"],
+ [1570796977, "54"]
+ ]
+ }
+ ]
+ }
+}
diff --git a/spec/fixtures/grafana/simplified_dashboard_response.json b/spec/fixtures/grafana/simplified_dashboard_response.json
new file mode 100644
index 00000000000..b450fda082b
--- /dev/null
+++ b/spec/fixtures/grafana/simplified_dashboard_response.json
@@ -0,0 +1,40 @@
+{
+ "dashboard": {
+ "panels": [
+ {
+ "datasource": "GitLab Omnibus",
+ "id": 8,
+ "lines": true,
+ "targets": [
+ {
+ "expr": "sum(\n rate(redis_net_input_bytes_total{instance=~\"$instance\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "legendFormat": "In",
+ "refId": "A"
+ },
+ {
+ "expr": "sum(\n rate(redis_net_output_bytes_total{instance=~\"[[instance]]\"}[$__interval])\n)",
+ "format": "time_series",
+ "interval": "1m",
+ "legendFormat": "Out",
+ "refId": "B"
+ }
+ ],
+ "title": "Network I/O",
+ "type": "graph",
+ "yaxes": [{ "format": "Bps" }, { "format": "short" }]
+ }
+ ],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "value": "localhost:9121"
+ },
+ "name": "instance"
+ }
+ ]
+ }
+ }
+}