apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-dashboard-microservice
  labels:
    grafana_dashboard: "true"
data:
  microservice-api.json: |-
     {
     "annotations": {
       "list": [
         {
           "builtIn": 1,
           "datasource": {
             "type": "grafana",
             "uid": "-- Grafana --"
           },
           "enable": true,
           "hide": true,
           "iconColor": "rgba(0, 211, 255, 1)",
           "name": "Annotations & Alerts",
           "target": {
             "limit": 100,
             "matchAny": false,
             "tags": [],
             "type": "dashboard"
           },
           "type": "dashboard"
         }
       ]
     },
     "editable": true,
     "fiscalYearStartMonth": 0,
     "graphTooltip": 0,
     "id": 1,
     "links": [],
     "liveNow": false,
     "panels": [
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "palette-classic"
             },
             "custom": {
               "hideFrom": {
                 "legend": false,
                 "tooltip": false,
                 "viz": false
               }
             },
             "mappings": []
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 8,
           "x": 0,
           "y": 0
         },
         "id": 4,
         "options": {
           "displayLabels": [
             "value"
           ],
           "legend": {
             "displayMode": "hidden",
             "placement": "bottom",
             "values": []
           },
           "pieType": "pie",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "tooltip": {
             "mode": "single",
             "sort": "none"
           }
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_count{status='success'}",
             "refId": "A"
           },
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_count{status='failed'}",
             "hide": false,
             "refId": "B"
           }
         ],
         "title": "Sucesso X Falha",
         "type": "piechart"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             }
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 8,
           "x": 8,
           "y": 0
         },
         "id": 2,
         "options": {
           "colorMode": "value",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='build'}",
             "refId": "A"
           }
         ],
         "title": "Número de Build",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 8,
           "x": 16,
           "y": 0
         },
         "id": 5,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_duration_seconds_sum{pipeline='microservice-api',status='success'} / tekton_pipelines_controller_pipelinerun_duration_seconds_count{pipeline='microservice-api',status='success'}",
             "refId": "A"
           }
         ],
         "title": "LeadTime",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 0,
           "y": 6
         },
         "id": 6,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='source'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='source'}",
             "refId": "A"
           }
         ],
         "title": "Source",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 4,
           "y": 6
         },
         "id": 7,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='build'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='build'}",
             "refId": "A"
           }
         ],
         "title": "Build",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 8,
           "y": 6
         },
         "id": 8,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='security'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='security'}",
             "refId": "A"
           }
         ],
         "title": "Security",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 12,
           "y": 6
         },
         "id": 9,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='quality'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='quality'}",
             "refId": "A"
           }
         ],
         "title": "Quality",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 16,
           "y": 6
         },
         "id": 10,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='tests'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='tests'}",
             "refId": "A"
           }
         ],
         "title": "Tests",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "s"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 20,
           "y": 6
         },
         "id": 11,
         "options": {
           "colorMode": "none",
           "graphMode": "none",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_sum{pipeline='microservice-api',status='success',task='deploy'}/tekton_pipelines_controller_pipelinerun_taskrun_duration_seconds_count{pipeline='microservice-api',status='success',task='deploy'}",
             "refId": "A"
           }
         ],
         "title": "Deploy",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             }
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 0,
           "y": 12
         },
         "id": 3,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_running_pipelineruns_count",
             "refId": "A"
           }
         ],
         "title": "Taem Execução",
         "type": "stat"
       },
       {
         "datasource": {
           "type": "prometheus",
           "uid": "P1809F7CD0C75ACF3"
         },
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             }
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 4,
           "x": 4,
           "y": 12
         },
         "id": 12,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "textMode": "auto"
         },
         "pluginVersion": "8.5.2",
         "targets": [
           {
             "datasource": {
               "type": "prometheus",
               "uid": "P1809F7CD0C75ACF3"
             },
             "expr": "tekton_pipelines_controller_running_taskruns_count",
             "refId": "A"
           }
         ],
         "title": "Tasks em Execução",
         "type": "stat"
       }
     ],
     "refresh": "5s",
     "schemaVersion": 36,
     "style": "dark",
     "tags": [],
     "templating": {
       "list": []
     },
     "time": {
       "from": "now-12h",
       "to": "now"
     },
     "timepicker": {},
     "timezone": "",
     "title": "dashboard-tekton",
     "uid": "F-Nfzu_nz",
     "version": 12,
     "weekStart": ""