Sindweller commented on issue #691:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/691#issuecomment-928731830


   Here are the PromQL and basic config for each metric in Grafana Dashboard, 
please give me some advise:
   
   ---
   apisix_ingress_controller_is_leader
   - Description: Whether the role of controller instance is leader
   - PromQL: `apisix_ingress_controller_is_leader`
   - Visualization: Stat
   ---
   apisix_ingress_controller_cache_sync_total
   - Description: Cache Sync Operations
   - PromQL: `irate(apisix_ingress_controller_cache_sync_total[5m])`
   - Visualization: Stat
   ---
   apisix_ingress_controller_sync_operation_total
   - Description: Sync Operations
   - PromQL: `irate(apisix_ingress_controller_sync_operation_total[5m])`
   - Visualization: Stat
   ---
   apisix_ingress_controller_events_total
   - Description: Number of events handled by the controller
   - PromQL: `irate(apisix_ingress_controller_events_total[2m])`
   - Visualization: Stat
   ---
   apisix_ingress_controller_check_cluster_health_total
   - Description: Cluster Health Check
   - PromQL: `irate(apisix_ingress_controller_check_cluster_health_total[5m])`
   - Visualization: stat
   ---
   apisix_ingress_controller_apisix_requests
   - Description: Total Requests
   - PromQL: `apisix_ingress_controller_apisix_requests`
   - Visualization: Graph
   ---
   apisix_ingress_controller_apisix_bad_status_codes
   - Description: Status codes of requests to APISIX
   - PromQL: `apisix_ingress_controller_apisix_bad_status_codes`
   - Visualization: Graph
   ---
    apisix_ingress_controller_apisix_request_latencies
   - Description: Request latencies with APISIX
   - PromQL: `sum (
     rate(
         apisix_ingress_controller_apisix_request_latencies_sum{}[1m]
   )) / sum (
     rate(
         apisix_ingress_controller_apisix_request_latencies_count{}[1m]
     )
   )`
   ---
   apisix_ingress_controller_apisix_requests
   - Description: Number of requests to APISIX
   - PromQL: `apisix_ingress_controller_apisix_requests`
   - Visualization: Graph
   
   ---
   The Grafana JSON model:
   ```
   {
     "annotations": {
       "list": [
         {
           "builtIn": 1,
           "datasource": "Prometheus",
           "enable": true,
           "hide": true,
           "iconColor": "rgba(0, 211, 255, 1)",
           "limit": 100,
           "name": "Annotations & Alerts",
           "showIn": 0,
           "type": "dashboard"
         }
       ]
     },
     "description": "Ingress Controller of Apache APISIX",
     "editable": true,
     "gnetId": 11719,
     "graphTooltip": 0,
     "id": 2,
     "iteration": 1632800063013,
     "links": [],
     "panels": [
       {
         "collapsed": false,
         "datasource": "Prometheus",
         "gridPos": {
           "h": 1,
           "w": 24,
           "x": 0,
           "y": 0
         },
         "id": 10,
         "panels": [],
         "title": "APISIX Ingress controller",
         "type": "row"
       },
       {
         "datasource": null,
         "description": "Whether the role of controller instance is leader",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [
               {
                 "from": "",
                 "id": 1,
                 "text": "Candidate",
                 "to": "",
                 "type": 1,
                 "value": "0"
               },
               {
                 "from": "",
                 "id": 2,
                 "text": "Leader",
                 "to": "",
                 "type": 1,
                 "value": "1"
               }
             ],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             }
           },
           "overrides": []
         },
         "gridPos": {
           "h": 5,
           "w": 8,
           "x": 0,
           "y": 1
         },
         "id": 33,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": "apisix_ingress_controller_is_leader",
             "instant": false,
             "interval": "",
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "title": "Is Leader",
         "type": "stat"
       },
       {
         "cacheTimeout": null,
         "datasource": "Prometheus",
         "description": "",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "ops"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 5,
           "w": 8,
           "x": 8,
           "y": 1
         },
         "id": 16,
         "interval": null,
         "links": [],
         "maxDataPoints": 100,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": "irate(apisix_ingress_controller_cache_sync_total[5m])",
             "interval": "",
             "intervalFactor": 2,
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "timeFrom": null,
         "timeShift": null,
         "title": "Cache Sync Operations",
         "type": "stat"
       },
       {
         "cacheTimeout": null,
         "datasource": "Prometheus",
         "description": "",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 }
               ]
             },
             "unit": "ops"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 5,
           "w": 8,
           "x": 16,
           "y": 1
         },
         "id": 11,
         "interval": null,
         "links": [],
         "maxDataPoints": 100,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": "rate(apisix_ingress_controller_sync_operation_total[5m])",
             "interval": "",
             "intervalFactor": 2,
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "timeFrom": null,
         "timeShift": null,
         "title": "Sync Operations",
         "type": "stat"
       },
       {
         "datasource": null,
         "description": "Number of events handled by the controller",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "ops"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 7,
           "w": 16,
           "x": 0,
           "y": 6
         },
         "id": 35,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": "irate(apisix_ingress_controller_events_total[2m])",
             "interval": "",
             "legendFormat": "{{resource}}-{{operation}}",
             "refId": "A"
           }
         ],
         "timeFrom": null,
         "timeShift": null,
         "title": "Total Events",
         "type": "stat"
       },
       {
         "datasource": null,
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             }
           },
           "overrides": []
         },
         "gridPos": {
           "h": 7,
           "w": 8,
           "x": 16,
           "y": 6
         },
         "id": 29,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": 
"irate(apisix_ingress_controller_check_cluster_health_total[5m])",
             "interval": "",
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "timeFrom": null,
         "timeShift": null,
         "title": "Cluster Health Check",
         "type": "stat"
       },
       {
         "collapsed": false,
         "datasource": null,
         "gridPos": {
           "h": 1,
           "w": 24,
           "x": 0,
           "y": 13
         },
         "id": 31,
         "panels": [],
         "title": "Apisix Requests",
         "type": "row"
       },
       {
         "aliasColors": {},
         "bars": false,
         "cacheTimeout": null,
         "dashLength": 10,
         "dashes": false,
         "datasource": "Prometheus",
         "description": "",
         "fieldConfig": {
           "defaults": {
             "unit": "none"
           },
           "overrides": []
         },
         "fill": 1,
         "fillGradient": 0,
         "gridPos": {
           "h": 6,
           "w": 24,
           "x": 0,
           "y": 14
         },
         "hiddenSeries": false,
         "id": 8,
         "interval": null,
         "legend": {
           "avg": false,
           "current": false,
           "max": false,
           "min": false,
           "show": true,
           "total": false,
           "values": false
         },
         "lines": true,
         "linewidth": 1,
         "links": [],
         "maxDataPoints": 100,
         "nullPointMode": "null",
         "options": {
           "alertThreshold": true
         },
         "percentage": false,
         "pluginVersion": "7.5.6",
         "pointradius": 2,
         "points": false,
         "renderer": "flot",
         "seriesOverrides": [],
         "spaceLength": 10,
         "stack": false,
         "steppedLine": false,
         "targets": [
           {
             "exemplar": true,
             "expr": "apisix_ingress_controller_apisix_requests",
             "interval": "",
             "intervalFactor": 2,
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "thresholds": [],
         "timeFrom": null,
         "timeRegions": [],
         "timeShift": null,
         "title": "Total Requests",
         "tooltip": {
           "shared": true,
           "sort": 0,
           "value_type": "individual"
         },
         "type": "graph",
         "xaxis": {
           "buckets": null,
           "mode": "time",
           "name": null,
           "show": true,
           "values": []
         },
         "yaxes": [
           {
             "$$hashKey": "object:1442",
             "format": "none",
             "label": null,
             "logBase": 1,
             "max": null,
             "min": "0",
             "show": true
           },
           {
             "$$hashKey": "object:1443",
             "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": "Prometheus",
         "fieldConfig": {
           "defaults": {
             "links": []
           },
           "overrides": []
         },
         "fill": 1,
         "fillGradient": 0,
         "gridPos": {
           "h": 7,
           "w": 24,
           "x": 0,
           "y": 20
         },
         "hiddenSeries": false,
         "id": 17,
         "legend": {
           "alignAsTable": false,
           "avg": false,
           "current": false,
           "max": false,
           "min": false,
           "rightSide": false,
           "show": true,
           "total": false,
           "values": false
         },
         "lines": true,
         "linewidth": 1,
         "nullPointMode": "null",
         "options": {
           "alertThreshold": true
         },
         "percentage": false,
         "pluginVersion": "7.5.6",
         "pointradius": 2,
         "points": false,
         "renderer": "flot",
         "seriesOverrides": [],
         "spaceLength": 10,
         "stack": false,
         "steppedLine": false,
         "targets": [
           {
             "exemplar": true,
             "expr": "apisix_ingress_controller_apisix_bad_status_codes",
             "instant": false,
             "interval": "",
             "intervalFactor": 1,
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "thresholds": [],
         "timeFrom": null,
         "timeRegions": [],
         "timeShift": null,
         "title": "Status Codes",
         "tooltip": {
           "shared": true,
           "sort": 0,
           "value_type": "individual"
         },
         "type": "graph",
         "xaxis": {
           "buckets": null,
           "mode": "time",
           "name": null,
           "show": true,
           "values": []
         },
         "yaxes": [
           {
             "$$hashKey": "object:567",
             "decimals": null,
             "format": "short",
             "label": "",
             "logBase": 1,
             "max": null,
             "min": null,
             "show": true
           },
           {
             "$$hashKey": "object:568",
             "decimals": null,
             "format": "Misc",
             "label": "",
             "logBase": 1,
             "max": null,
             "min": null,
             "show": true
           }
         ],
         "yaxis": {
           "align": false,
           "alignLevel": null
         }
       },
       {
         "datasource": "Prometheus",
         "fieldConfig": {
           "defaults": {
             "color": {
               "mode": "thresholds"
             },
             "mappings": [],
             "thresholds": {
               "mode": "absolute",
               "steps": [
                 {
                   "color": "green",
                   "value": null
                 },
                 {
                   "color": "red",
                   "value": 80
                 }
               ]
             },
             "unit": "percentunit"
           },
           "overrides": []
         },
         "gridPos": {
           "h": 6,
           "w": 24,
           "x": 0,
           "y": 27
         },
         "id": 6,
         "options": {
           "colorMode": "value",
           "graphMode": "area",
           "justifyMode": "auto",
           "orientation": "auto",
           "reduceOptions": {
             "calcs": [
               "lastNotNull"
             ],
             "fields": "",
             "values": false
           },
           "text": {},
           "textMode": "auto"
         },
         "pluginVersion": "7.5.6",
         "targets": [
           {
             "exemplar": true,
             "expr": 
"sum(apisix_ingress_controller_apisix_bad_status_codes{status_code =~ 
\"[4-5].*\"}) / sum(apisix_ingress_controller_apisix_requests)",
             "hide": false,
             "interval": "",
             "legendFormat": "average",
             "refId": "A"
           }
         ],
         "timeFrom": null,
         "timeShift": null,
         "title": "Response Error Rate",
         "type": "stat"
       },
       {
         "aliasColors": {},
         "bars": false,
         "cacheTimeout": null,
         "dashLength": 10,
         "dashes": false,
         "datasource": "Prometheus",
         "description": "Request latencies with APISIX",
         "fieldConfig": {
           "defaults": {
             "unit": "short"
           },
           "overrides": []
         },
         "fill": 1,
         "fillGradient": 0,
         "gridPos": {
           "h": 6,
           "w": 24,
           "x": 0,
           "y": 33
         },
         "hiddenSeries": false,
         "id": 2,
         "interval": "",
         "legend": {
           "avg": false,
           "current": false,
           "max": false,
           "min": false,
           "show": false,
           "total": false,
           "values": false
         },
         "lines": true,
         "linewidth": 1,
         "links": [],
         "nullPointMode": "null",
         "options": {
           "alertThreshold": true
         },
         "percentage": false,
         "pluginVersion": "7.5.6",
         "pointradius": 2,
         "points": false,
         "renderer": "flot",
         "seriesOverrides": [],
         "spaceLength": 10,
         "stack": false,
         "steppedLine": false,
         "targets": [
           {
             "exemplar": true,
             "expr": "sum (\n  rate(\n      
apisix_ingress_controller_apisix_request_latencies_sum{}[1m]\n)) / sum (\n  
rate(\n      apisix_ingress_controller_apisix_request_latencies_count{}[1m]\n  
)\n)",
             "instant": false,
             "interval": "",
             "intervalFactor": 1,
             "legendFormat": "",
             "refId": "A"
           }
         ],
         "thresholds": [],
         "timeFrom": null,
         "timeRegions": [],
         "timeShift": null,
         "title": "Requests Latencies",
         "tooltip": {
           "shared": true,
           "sort": 0,
           "value_type": "individual"
         },
         "type": "graph",
         "xaxis": {
           "buckets": null,
           "mode": "time",
           "name": null,
           "show": true,
           "values": []
         },
         "yaxes": [
           {
             "$$hashKey": "object:439",
             "format": "short",
             "label": null,
             "logBase": 1,
             "max": null,
             "min": null,
             "show": true
           },
           {
             "$$hashKey": "object:440",
             "format": "short",
             "label": null,
             "logBase": 1,
             "max": null,
             "min": null,
             "show": true
           }
         ],
         "yaxis": {
           "align": false,
           "alignLevel": null
         }
       }
     ],
     "refresh": "5m",
     "schemaVersion": 27,
     "style": "dark",
     "tags": [],
     "templating": {
       "list": [
         {
           "allValue": ".*",
           "current": {
             "selected": false,
             "text": "All",
             "value": "$__all"
           },
           "datasource": "Prometheus",
           "definition": "label_values(resource)",
           "description": null,
           "error": null,
           "hide": 0,
           "includeAll": true,
           "label": null,
           "multi": true,
           "name": "resource",
           "options": [],
           "query": {
             "query": "label_values(resource)",
             "refId": "StandardVariableQuery"
           },
           "refresh": 2,
           "regex": ".*",
           "skipUrlSync": false,
           "sort": 1,
           "tagValuesQuery": "",
           "tags": [],
           "tagsQuery": "",
           "type": "query",
           "useTags": false
         },
         {
           "allValue": ".*",
           "current": {
             "selected": false,
             "text": "All",
             "value": "$__all"
           },
           "datasource": "Prometheus",
           "definition": "label_values(operation)",
           "description": null,
           "error": null,
           "hide": 0,
           "includeAll": true,
           "label": null,
           "multi": true,
           "name": "operation",
           "options": [],
           "query": {
             "query": "label_values(operation)",
             "refId": "StandardVariableQuery"
           },
           "refresh": 2,
           "regex": "",
           "skipUrlSync": false,
           "sort": 1,
           "tagValuesQuery": "",
           "tags": [],
           "tagsQuery": "",
           "type": "query",
           "useTags": false
         }
       ]
     },
     "time": {
       "from": "now-30m",
       "to": "now"
     },
     "timepicker": {
       "refresh_intervals": [
         "5s",
         "10s",
         "30s",
         "1m",
         "5m",
         "15m",
         "30m",
         "1h",
         "2h",
         "1d"
       ]
     },
     "timezone": "",
     "title": "Apache APISIX Ingress Controller",
     "version": 18
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to