Erweiterung der Gitlab-Metriken in Grafana

vorhergehende Artikel in: Linux TeleGrafana Git(lab|hub)
03.07.2020

Ich habe meine Idee zur Visualisierung bestimmter Metriken aus Gitlab auf einem Grafana-Dashboard ausgebaut - ich erfasse nicht mehr nur in einem Projekt die offenen Issues pro Komponente sondern nun auch die offenen Issues auf Projektebene.

Daher habe ich das bereits aus dem Gist etwas variiert und das Dashboard ergänzt:

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 13,
  "iteration": 1589035932265,
  "links": [],
  "panels": [
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 7,
      "title": "Issues by Project",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 5,
      "interval": "",
      "links": [
        {
          "dashboard": "http://gitlab.fritz.box/elbosso/java-class_src/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=geo",
          "title": "list $projectName Issues",
          "type": "absolute",
          "url": "http://gitlab.fritz.box/elbosso/java-class_src/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=$component"
        }
      ],
      "options": {
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "max": 20,
            "min": 0
          },
          "mappings": [],
          "override": {},
          "thresholds": [
            {
              "color": "rgb(43, 43, 43)",
              "index": 0,
              "value": null
            },
            {
              "color": "green",
              "index": 1,
              "value": 1
            },
            {
              "color": "#EAB839",
              "index": 2,
              "value": 4
            },
            {
              "color": "red",
              "index": 3,
              "value": 10
            }
          ],
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.2.2",
      "repeat": "projectName",
      "repeatDirection": "h",
      "scopedVars": {
        "projectName": {
          "selected": true,
          "text": "website",
          "value": "website"
        }
      },
      "targets": [
        {
          "alias": "$projectName",
          "groupBy": [],
          "measurement": "openIssues",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "count"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=",
              "value": "gitlab"
            },
            {
              "condition": "AND",
              "key": "projectName",
              "operator": "=~",
              "value": "/^$projectName$/"
            }
          ]
        }
      ],
      "title": "$projectName",
      "type": "gauge"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "id": 4,
      "panels": [],
      "title": "Issues in Project java-class_src by component",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 2,
      "links": [
        {
          "dashboard": "http://gitlab.fritz.box/elbosso/java-class_src/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=geo",
          "title": "list $component Issues",
          "type": "absolute",
          "url": "http://gitlab.fritz.box/elbosso/java-class_src/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=$component"
        }
      ],
      "options": {
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "max": 20,
            "min": 0
          },
          "mappings": [],
          "override": {},
          "thresholds": [
            {
              "color": "rgb(43, 43, 43)",
              "index": 0,
              "value": null
            },
            {
              "color": "green",
              "index": 1,
              "value": 1
            },
            {
              "color": "#EAB839",
              "index": 2,
              "value": 4
            },
            {
              "color": "red",
              "index": 3,
              "value": 10
            }
          ],
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.2.2",
      "repeat": "component",
      "repeatDirection": "h",
      "scopedVars": {
        "component": {
          "selected": true,
          "text": "Bug",
          "value": "Bug"
        }
      },
      "targets": [
        {
          "alias": "$component",
          "groupBy": [],
          "measurement": "openIssues",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "count"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=",
              "value": "gitlab"
            },
            {
              "condition": "AND",
              "key": "component",
              "operator": "=~",
              "value": "/^$component$/"
            }
          ]
        }
      ],
      "title": "$component",
      "type": "gauge"
    }
  ],
  "refresh": "1m",
  "schemaVersion": 18,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "Bug",
          "value": [
            "Bug"
          ]
        },
        "datasource": "InfluxDB monitoring",
        "definition": "SHOW TAG VALUES WITH KEY = \"component\"",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "component",
        "options": [],
        "query": "SHOW TAG VALUES WITH KEY = \"component\"",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "website",
          "value": [
            "website"
          ]
        },
        "datasource": "InfluxDB monitoring",
        "definition": "SHOW TAG VALUES WITH KEY = \"projectName\"",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "projectName",
        "options": [],
        "query": "SHOW TAG VALUES WITH KEY = \"projectName\"",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Gitlab Overview Open Issues",
  "uid": "EhwYwVkgk",
  "version": 26
}

Alle Artikel rss Wochenübersicht Monatsübersicht Github Repositories Gitlab Repositories Mastodon Über mich home xmpp


Vor 5 Jahren hier im Blog

  • Fährnisse des Buildprozesses unter Windows

    17.07.2019

    Nachdem ich begonnen hatte, mich mit der Beschleunigung der Berechnung des Mandelbrot-Fraktals unter Zuhilfenahme der Shadereinheiten in Graphikkarten zu beschäftigen und erste Erfolge feiern konnte, wollte ich das mal auf einer richtigen Graphikkarte ausprobieren...

    Weiterlesen...

Neueste Artikel

  • Datenvalidierung UTF8 mit BiDi-Steuerzeichen (TrojanSource 2.0)

    Ich bin heute nochmal inspiriert worden, weiter über die Trojan Source Vulnerability nachzudenken. Meiner Meinung nach bestehen hier noch Probleme - speziell bei Nutzereingaben oder Daten, die über externe Schnittstellen ampfangen werden.

    Weiterlesen...
  • OpenStreetMap Navi als Docker-Container

    Ich habe die auf OpenStreetMap basierende OpenSource Navigationslösung Graphhopper in einen Docker-Container gepackt und als neuestes Mitglied in meinem Docker-Zoo willkommen geheißen.

    Weiterlesen...
  • SQL-Aggregatfunktionen in SQLite als BeanShell-Scripts

    Ich habe neulich über eine Möglichkeit berichtet, SQLite mittels der sQLshell und Beanshell-Skripten um SQL-Funktionen zu erweitern. In diesem Artikel versprach ich auch, über eine solche Möglichkeit für Aggregatfunktionen zu berichten.

    Weiterlesen...

Manche nennen es Blog, manche Web-Seite - ich schreibe hier hin und wieder über meine Erlebnisse, Rückschläge und Erleuchtungen bei meinen Hobbies.

Wer daran teilhaben und eventuell sogar davon profitieren möchte, muß damit leben, daß ich hin und wieder kleine Ausflüge in Bereiche mache, die nichts mit IT, Administration oder Softwareentwicklung zu tun haben.

Ich wünsche allen Lesern viel Spaß und hin und wieder einen kleinen AHA!-Effekt...

PS: Meine öffentlichen GitHub-Repositories findet man hier - meine öffentlichen GitLab-Repositories finden sich dagegen hier.