Git Product home page Git Product logo

Comments (2)

virusbrain avatar virusbrain commented on August 25, 2024 1

Hi @fho! Wow, thanks this helps a lot!

from jenkins-exporter.

fho avatar fho commented on August 25, 2024

Hello @virusbrain,

no that I know of.

We are also using Grafana and have a jenkins-exporter dashboard about build duration and results per Job.

I exported it, maybe it helps: :-)

{
  "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,
  "iteration": 1646323945723,
  "links": [],
  "panels": [
    {
      "aliasColors": {
        "0.9 Quantile": "dark-orange",
        "0.99 Quantile": "dark-purple",
        "Median": "dark-blue"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "prometheus",
      "decimals": null,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 10,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.0.6",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": true,
      "targets": [
        {
          "expr": "histogram_quantile(0.5, rate(jenkins_exporter_job_duration_seconds_bucket{jenkins_job=\"$job\", result=\"$result\", type=\"building_duration\"}[3d]))",
          "legendFormat": "Median",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.9, rate(jenkins_exporter_job_duration_seconds_bucket{jenkins_job=\"$job\", result=\"$result\", type=\"building_duration\"}[3d]))",
          "legendFormat": "0.9 Quantile",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.99, rate(jenkins_exporter_job_duration_seconds_bucket{jenkins_job=\"$job\", result=\"$result\", type=\"building_duration\"}[3d]))",
          "legendFormat": "0.99 Quantile",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Job Runtime",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": false,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:214",
          "decimals": null,
          "format": "s",
          "label": "Duration",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:215",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 10,
        "y": 0
      },
      "id": 4,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.0.6",
      "targets": [
        {
          "exemplar": true,
          "expr": "histogram_quantile(0.99, rate(jenkins_exporter_job_duration_seconds_bucket{jenkins_job=\"$job\", result=\"$result\", type=\"building_duration\"}[3d]))",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Runtime 99%ile",
      "type": "stat"
    },
    {
      "aliasColors": {
        "Builds / hour": "rgb(0, 255, 214)",
        "sum(increase(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"sandbox-create\",type=\"building_duration\"}[1h])) ": "rgb(6, 230, 213)",
        "sum(rate(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"sandbox-create\",type=\"building_duration\"}[1d])) * 60 * 60 *24": "semi-dark-purple"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 3,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 9,
        "x": 13,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 8,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.0.6",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": true,
      "targets": [
        {
          "expr": "sum(increase(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\"}[1h])) ",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Builds / hour",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:138",
          "decimals": 0,
          "format": "short",
          "label": "Count",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:139",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#C4162A",
                "value": null
              },
              {
                "color": "#E0B400",
                "value": 0.6
              },
              {
                "color": "#37872D",
                "value": 0.9
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 10,
        "y": 4
      },
      "id": 10,
      "interval": "",
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.0.6",
      "targets": [
        {
          "expr": "sum(increase(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",result=\"success\", type=\"building_duration\"}[$__range])) / sum(increase(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\", type=\"building_duration\"}[$__range]))",
          "instant": false,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Success Rate",
      "type": "stat"
    },
    {
      "aliasColors": {
        "Aborted": "purple",
        "Failure": "red",
        "Success": "green",
        "Unstable": "yellow"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 5,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 10,
        "x": 0,
        "y": 10
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 2,
      "nullPointMode": "connected",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.0.6",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": true,
      "targets": [
        {
          "expr": "(sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\", result=\"success\"}) / sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\"}))",
          "legendFormat": "Success",
          "refId": "A"
        },
        {
          "expr": "(sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\", result=\"aborted\"}) / sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\"}))",
          "hide": false,
          "legendFormat": "Aborted",
          "refId": "C"
        },
        {
          "expr": "(sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\", result=\"unstable\"}) / sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\"}))",
          "hide": false,
          "legendFormat": "Unstable",
          "refId": "D"
        },
        {
          "expr": "(sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\", result=\"failure\"}) / sum(jenkins_exporter_job_duration_seconds_count{jenkins_job=\"$job\",type=\"building_duration\"}))",
          "legendFormat": "Failure",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Result Rate",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:291",
          "format": "percentunit",
          "label": "Rate",
          "logBase": 1,
          "max": "1",
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:292",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 30,
  "style": "dark",
  "tags": [
    "jenkins, ci"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "sisu-ci-ng",
          "value": "sisu-ci-ng"
        },
        "datasource": "prometheus",
        "definition": "label_values(jenkins_exporter_job_duration_seconds_count, jenkins_job)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Jenkins Job",
        "multi": false,
        "name": "job",
        "options": [],
        "query": {
          "query": "label_values(jenkins_exporter_job_duration_seconds_count, jenkins_job)",
          "refId": "prometheus-job-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "success",
          "value": "success"
        },
        "datasource": "prometheus",
        "definition": "label_values(jenkins_exporter_job_duration_seconds_count, result)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Result",
        "multi": false,
        "name": "result",
        "options": [],
        "query": {
          "query": "label_values(jenkins_exporter_job_duration_seconds_count, result)",
          "refId": "prometheus-result-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Jenkins Jobs",
  "uid": "nnER9nXGk",
  "version": 1
}

from jenkins-exporter.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.