Grafana dashboard: Carbon Reductor Statistic
Description: Carbon Reductor Statistics, collected with telegraf and stored in InfluxDB.

# Includes
- activation states
- versions and updates
- modules internal databases stats (urls/domains/elements)
- modules internal checked/matching stats
- lists sizes (rkn/load)

# Known bugs
- No opportunity for templating hosts or reg num if multiple servers are in use
- No interval templating

{
  "__inputs": [
    {
      "name": "DS_REDUCTOR",
      "label": "reductor",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "3.1.1"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    }
  ],
  "id": null,
  "title": "Carbon Reductor Statistic",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "hideControls": false,
  "sharedCrosshair": false,
  "rows": [
    {
      "collapse": false,
      "editable": true,
      "height": "150px",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_REDUCTOR}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 14,
          "isNew": true,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "$tag_module",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "module"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "activation_error",
              "policy": "default",
              "query": "SELECT $func(\"value\") FROM \"activation_error\" WHERE $timeFilter GROUP BY time($interval), \"module\" fill(null)",
              "rawQuery": true,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": []
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Ошибки активации",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_REDUCTOR}",
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 17,
          "isNew": true,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "Обновление",
              "yaxis": 2
            }
          ],
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "Версия",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "version",
              "policy": "default",
              "query": "SELECT $func(\"value\") FROM \"activation_error\" WHERE $timeFilter GROUP BY time($interval), \"module\" fill(null)",
              "rawQuery": false,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": []
            },
            {
              "alias": "Обновление",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "version",
              "policy": "default",
              "query": "SELECT $func(\"value\") FROM \"activation_error\" WHERE $timeFilter GROUP BY time($interval), \"module\" fill(null)",
              "rawQuery": false,
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "max"
                  },
                  {
                    "params": [
                      "1s"
                    ],
                    "type": "non_negative_derivative"
                  }
                ]
              ],
              "tags": []
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Используемая версия",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "transparent": false,
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 800000000,
              "show": true
            },
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "showTitle": true,
      "title": "Обновления и активация"
    },
    {
      "collapse": false,
      "editable": true,
      "height": "300px",
      "panels": [
        {
          "aliasColors": {
            "buffer elements": "#C15C17",
            "buffer urls": "#E5AC0E",
            "readonly elements": "#1F78C1",
            "readonly urls": "#CFFAFF"
          },
          "bars": false,
          "datasource": "${DS_REDUCTOR}",
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 7,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": true,
            "max": true,
            "min": true,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "minSpan": 4,
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 1,
          "points": false,
          "renderer": "flot",
          "repeat": "module",
          "scopedVars": {
            "module": {
              "selected": true,
              "text": "ipt_reductor",
              "value": "ipt_reductor"
            }
          },
          "seriesOverrides": [
            {
              "alias": "readonly elements",
              "yaxis": 1
            },
            {
              "alias": "readonly urls",
              "yaxis": 1
            }
          ],
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "$tag_db $tag_type",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "db"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "type"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "database",
              "policy": "default",
              "query": "SELECT $func(\"value\") FROM \"database\" WHERE \"module\" =~ /^$module$/ AND $timeFilter GROUP BY time($interval), \"db\", \"type\" fill(null)",
              "rawQuery": true,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "module",
                  "operator": "=~",
                  "value": "/^$module$/"
                }
              ]
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$module",
          "tooltip": {
            "msResolution": true,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ]
        }
      ],
      "showTitle": true,
      "title": "Данные о содержимом внутренних баз данных модулей"
    },
    {
      "collapse": false,
      "editable": true,
      "height": "200px",
      "panels": [
        {
          "aliasColors": {
            "buffer elements": "#C15C17",
            "buffer urls": "#E5AC0E",
            "readonly elements": "#1F78C1",
            "readonly urls": "#CFFAFF"
          },
          "bars": false,
          "datasource": "${DS_REDUCTOR}",
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 11,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": false,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "minSpan": 4,
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 1,
          "points": false,
          "renderer": "flot",
          "repeat": "module",
          "scopedVars": {
            "module": {
              "selected": true,
              "text": "ipt_reductor",
              "value": "ipt_reductor"
            }
          },
          "seriesOverrides": [
            {
              "alias": "readonly elements",
              "yaxis": 1
            },
            {
              "alias": "readonly urls",
              "yaxis": 1
            }
          ],
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "$tag_db $tag_type",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "db"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "type"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "packets",
              "policy": "default",
              "query": "SELECT non_negative_derivative($func(\"value\"), 10s) FROM \"packets\" WHERE \"module\" =~ /^$module$/ AND $timeFilter GROUP BY time($interval), \"db\", \"type\" fill(null)",
              "rawQuery": true,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "max"
                  },
                  {
                    "params": [
                      "10s"
                    ],
                    "type": "non_negative_derivative"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "module",
                  "operator": "=~",
                  "value": "/^$module$/"
                }
              ]
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$module",
          "tooltip": {
            "msResolution": true,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ]
        }
      ],
      "showTitle": true,
      "title": "Статистика обработки пакетов"
    },
    {
      "collapse": false,
      "editable": true,
      "height": "300px",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_REDUCTOR}",
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 15,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "minSpan": 6,
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "repeat": "list_type",
          "scopedVars": {
            "list_type": {
              "text": "load",
              "value": "load",
              "selected": true
            }
          },
          "seriesOverrides": [],
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "$tag_list",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "list"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "type"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "lists",
              "policy": "default",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "value"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "type",
                  "operator": "=~",
                  "value": "/^$list_type$/"
                }
              ]
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$list_type",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 10,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "showTitle": true,
      "title": "Размеры списков"
    }
  ],
  "time": {
    "from": "now-3h",
    "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"
    ]
  },
  "templating": {
    "list": [
      {
        "current": {
          "text": "ipt_reductor + ipt_dnsmatch + ipt_snimatch",
          "value": [
            "ipt_reductor",
            "ipt_dnsmatch",
            "ipt_snimatch"
          ]
        },
        "datasource": null,
        "hide": 0,
        "includeAll": false,
        "multi": true,
        "name": "module",
        "options": [
          {
            "selected": true,
            "text": "ipt_reductor",
            "value": "ipt_reductor"
          },
          {
            "selected": true,
            "text": "ipt_dnsmatch",
            "value": "ipt_dnsmatch"
          },
          {
            "selected": true,
            "text": "ipt_snimatch",
            "value": "ipt_snimatch"
          }
        ],
        "query": "ipt_reductor,ipt_dnsmatch,ipt_snimatch",
        "refresh": 0,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "min",
          "value": "min"
        },
        "datasource": null,
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "func",
        "options": [
          {
            "selected": false,
            "text": "mean",
            "value": "mean"
          },
          {
            "selected": true,
            "text": "min",
            "value": "min"
          },
          {
            "selected": false,
            "text": "max",
            "value": "max"
          }
        ],
        "query": "mean,min,max",
        "refresh": 0,
        "type": "custom"
      },
      {
        "current": {},
        "datasource": "${DS_REDUCTOR}",
        "hide": 0,
        "includeAll": false,
        "multi": true,
        "name": "list_type",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"lists\" WITH KEY = \"type\"",
        "refresh": 1,
        "regex": "",
        "type": "query"
      }
    ]
  },
  "annotations": {
    "list": []
  },
  "refresh": "30s",
  "schemaVersion": 12,
  "version": 57,
  "links": [],
  "gnetId": 1183,
  "description": "Carbon Reductor Statistics, collected with telegraf and stored in InfluxDB."
}