{
  "title": "Boombox speakers",
  "uid": "boombox-speakers",
  "description": "Every Boombox speaker that Prometheus scrapes: what plays, health, the board and the web server. See Documentation/Software/Metrics.md.",
  "tags": [
    "boombox"
  ],
  "editable": true,
  "graphTooltip": 1,
  "refresh": "1m",
  "schemaVersion": 39,
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timezone": "browser",
  "templating": {
    "list": [
      {
        "type": "datasource",
        "name": "datasource",
        "label": "Prometheus",
        "query": "prometheus",
        "current": {},
        "hide": 0,
        "refresh": 1,
        "regex": "",
        "options": []
      },
      {
        "type": "query",
        "name": "instance",
        "label": "Speaker",
        "datasource": {
          "type": "prometheus",
          "uid": "${datasource}"
        },
        "definition": "label_values(boombox_up, instance)",
        "query": {
          "query": "label_values(boombox_up, instance)",
          "refId": "instance"
        },
        "refresh": 2,
        "multi": true,
        "includeAll": true,
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": [
            "All"
          ],
          "value": [
            "$__all"
          ]
        },
        "sort": 1,
        "hide": 0,
        "options": [],
        "regex": ""
      }
    ]
  },
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "links": [],
  "panels": [
    {
      "type": "row",
      "title": "Overview",
      "id": 1,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "panels": []
    },
    {
      "type": "stat",
      "title": "Speakers up",
      "id": 2,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "count(boombox_up{instance=~\"$instance\"} == 1) or vector(0)",
          "legendFormat": "answering",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 0,
        "y": 1
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "description": "Speakers whose agent answered the last scrape.",
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "textMode": "value",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ]
        }
      }
    },
    {
      "type": "stat",
      "title": "Targets down",
      "id": 3,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "count(up{instance=~\"$instance\"} == 0) or vector(0)",
          "legendFormat": "down",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 0,
        "y": 5
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          }
        },
        "overrides": []
      },
      "description": "Scrape targets (web, board, speaker) that do not answer: a speaker that is off, or metrics turned off (404).",
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ]
        }
      }
    },
    {
      "type": "table",
      "title": "Speakers",
      "id": 4,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "min by (instance) (up{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "A",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance, hostname, agent) (boombox_info{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "B",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_uptime_seconds{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "C",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_temperature_celsius{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "D",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_wifi_signal_percent{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "E",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_volume_percent{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "F",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_playing{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "G",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_bluetooth_devices{state=\"connected\", instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "H",
          "format": "table",
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "max by (instance) (boombox_recording_error{instance=~\"$instance\"})",
          "legendFormat": "",
          "refId": "I",
          "format": "table",
          "instant": true
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 19,
        "x": 5,
        "y": 1
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value #A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Reachable"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background",
                  "mode": "basic"
                }
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "1": {
                        "text": "up",
                        "color": "green",
                        "index": 0
                      },
                      "0": {
                        "text": "down",
                        "color": "red",
                        "index": 1
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "hostname"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Name"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "agent"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Version"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Uptime"
              },
              {
                "id": "unit",
                "value": "s"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Temperature"
              },
              {
                "id": "unit",
                "value": "celsius"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 70
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #E"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Wi-Fi"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 30
                    },
                    {
                      "color": "green",
                      "value": 50
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #F"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Volume"
              },
              {
                "id": "unit",
                "value": "percent"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #G"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Playing"
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "1": {
                        "text": "yes",
                        "color": "green",
                        "index": 0
                      },
                      "0": {
                        "text": "no",
                        "color": "text",
                        "index": 1
                      }
                    }
                  }
                ]
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #H"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Phones"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #I"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Recording"
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "1": {
                        "text": "error",
                        "color": "red",
                        "index": 0
                      },
                      "0": {
                        "text": "ok",
                        "color": "text",
                        "index": 1
                      }
                    }
                  }
                ]
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              }
            ]
          }
        ]
      },
      "description": "One row per speaker, as of now. Red cells need a look.",
      "options": {
        "showHeader": true,
        "cellHeight": "sm",
        "sortBy": [
          {
            "displayName": "instance"
          }
        ]
      },
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "Value #B": true
            },
            "indexByName": {
              "instance": 0,
              "hostname": 1,
              "Value #A": 2,
              "agent": 3,
              "Value #C": 5,
              "Value #D": 6,
              "Value #E": 7,
              "Value #F": 8,
              "Value #G": 9,
              "Value #H": 10,
              "Value #I": 11
            }
          }
        }
      ]
    },
    {
      "type": "state-timeline",
      "title": "Reachable",
      "id": 5,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "up{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} {{job}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "1": {
                  "text": "up",
                  "color": "green",
                  "index": 0
                },
                "0": {
                  "text": "down",
                  "color": "red",
                  "index": 1
                }
              }
            }
          ],
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": []
      },
      "description": "Each scrape target over time: the web server, the board (node_exporter) and the speaker (agent).",
      "options": {
        "showValue": "never",
        "mergeValues": true,
        "rowHeight": 0.8,
        "legend": {
          "showLegend": false
        },
        "tooltip": {
          "mode": "single"
        }
      }
    },
    {
      "type": "row",
      "title": "Playback",
      "id": 6,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 15
      },
      "panels": []
    },
    {
      "type": "state-timeline",
      "title": "What plays",
      "id": 7,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_playing{instance=~\"$instance\"} == 1",
          "legendFormat": "{{instance}} {{source}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 16
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "1": {
                  "text": "playing",
                  "color": "green",
                  "index": 0
                }
              }
            }
          ],
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": []
      },
      "description": "Phones over Bluetooth, the speaker's own playlists, or a stream.",
      "options": {
        "showValue": "never",
        "mergeValues": true,
        "rowHeight": 0.8,
        "legend": {
          "showLegend": false
        },
        "tooltip": {
          "mode": "single"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Volume",
      "id": 8,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_volume_percent{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_volume_limit_percent{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} limit",
          "refId": "B"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 16
      },
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "lineInterpolation": "stepAfter"
          }
        },
        "overrides": []
      },
      "description": "The volume and the limit that applies now (speakers or headphones).",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Phones connected",
      "id": 9,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_bluetooth_devices{state=\"connected\", instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 24
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "lineInterpolation": "stepAfter"
          },
          "decimals": 0
        },
        "overrides": []
      },
      "description": "Phones connected over Bluetooth.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "state-timeline",
      "title": "Switches",
      "id": 10,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_amplifier_on{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} amplifier",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_muted{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} muted",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_listen_on_headphones{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} headphones",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_recording_active{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} recording",
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_recording_error{instance=~\"$instance\"}",
          "legendFormat": "{{instance}} recording error",
          "refId": "E"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 16,
        "x": 8,
        "y": 24
      },
      "fieldConfig": {
        "defaults": {
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "1": {
                  "text": "on",
                  "color": "green",
                  "index": 0
                },
                "0": {
                  "text": "off",
                  "color": "transparent",
                  "index": 1
                }
              }
            }
          ],
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*muted$"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "1": {
                        "text": "yes",
                        "color": "orange",
                        "index": 0
                      },
                      "0": {
                        "text": "no",
                        "color": "transparent",
                        "index": 1
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*error$"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "1": {
                        "text": "error",
                        "color": "red",
                        "index": 0
                      },
                      "0": {
                        "text": "ok",
                        "color": "transparent",
                        "index": 1
                      }
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      "description": "The amplifier on, muted, listening on headphones or line out, a song being recorded, and an error storing recordings.",
      "options": {
        "showValue": "never",
        "mergeValues": true,
        "rowHeight": 0.8,
        "legend": {
          "showLegend": false
        },
        "tooltip": {
          "mode": "single"
        }
      }
    },
    {
      "type": "row",
      "title": "Health",
      "id": 11,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 32
      },
      "panels": []
    },
    {
      "type": "timeseries",
      "title": "Temperature",
      "id": 12,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_temperature_celsius{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 33
      },
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 70
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "thresholdsStyle": {
              "mode": "line"
            }
          }
        },
        "overrides": []
      },
      "description": "The system on a chip. Above 80 °C the board slows down: give it air.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Wi-Fi signal",
      "id": 13,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_wifi_signal_percent{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 6,
        "y": 33
      },
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "transparent",
                "value": 30
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "thresholdsStyle": {
              "mode": "area"
            }
          }
        },
        "overrides": []
      },
      "description": "Below 30 % music stutters and pages load slowly: move the speaker or use the external antenna.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Uptime",
      "id": 14,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_uptime_seconds{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 33
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "Time since the speaker started: a drop is a restart.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Recordings waiting",
      "id": 15,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "boombox_recordings_pending{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 33
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "lineInterpolation": "stepAfter"
          },
          "decimals": 0
        },
        "overrides": []
      },
      "description": "Recordings not yet stored in the owner's folder: growing means the folder is not reachable.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "row",
      "title": "Board",
      "id": 16,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 41
      },
      "panels": []
    },
    {
      "type": "timeseries",
      "title": "CPU busy",
      "id": 17,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "100 * (1 - avg by (instance) (rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"$instance\"}[$__rate_interval])))",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 42
      },
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "All cores together.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Memory used",
      "id": 18,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "100 * (1 - node_memory_MemAvailable_bytes{instance=~\"$instance\"} / node_memory_MemTotal_bytes{instance=~\"$instance\"})",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 42
      },
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "What programs use; the rest caches the microSD card.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "microSD card used",
      "id": 19,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "100 * (1 - node_filesystem_avail_bytes{mountpoint=\"/\", instance=~\"$instance\"} / node_filesystem_size_bytes{mountpoint=\"/\", instance=~\"$instance\"})",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 42
      },
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 80
              },
              {
                "color": "red",
                "value": 90
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "The root file system. Recordings and the library live elsewhere when the owner chose a USB stick or SMB.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Network",
      "id": 20,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "sum by (instance) (rate(node_network_receive_bytes_total{device!~\"lo|docker.*|veth.*\", instance=~\"$instance\"}[$__rate_interval]))",
          "legendFormat": "{{instance}} in",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "-sum by (instance) (rate(node_network_transmit_bytes_total{device!~\"lo|docker.*|veth.*\", instance=~\"$instance\"}[$__rate_interval]))",
          "legendFormat": "{{instance}} out",
          "refId": "B"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 50
      },
      "fieldConfig": {
        "defaults": {
          "unit": "Bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "In above the line, out below it: a stream or a library on SMB shows here.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "Load",
      "id": 21,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "node_load1{instance=~\"$instance\"}",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 50
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          },
          "decimals": 0
        },
        "overrides": []
      },
      "description": "Processes waiting for a core, over a minute. The board has four cores.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "row",
      "title": "Web",
      "id": 22,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 58
      },
      "panels": []
    },
    {
      "type": "timeseries",
      "title": "PHP requests by status",
      "id": 23,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "sum by (instance, code) (rate(caddy_http_request_duration_seconds_count{handler=\"php\", instance=~\"$instance\"}[$__rate_interval]))",
          "legendFormat": "{{instance}} {{code}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 59
      },
      "fieldConfig": {
        "defaults": {
          "unit": "reqps",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "Pages and API calls TYPO3 answered, per second.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "PHP response time (p95)",
      "id": 24,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "histogram_quantile(0.95, sum by (instance, le) (rate(caddy_http_request_duration_seconds_bucket{handler=\"php\", instance=~\"$instance\"}[$__rate_interval])))",
          "legendFormat": "{{instance}}",
          "refId": "A"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 59
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false
          }
        },
        "overrides": []
      },
      "description": "95 of 100 pages and API calls were answered faster than this.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "type": "timeseries",
      "title": "PHP workers busy",
      "id": 25,
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "sum by (instance) (frankenphp_busy_workers{instance=~\"$instance\"})",
          "legendFormat": "{{instance}} busy",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "expr": "sum by (instance) (frankenphp_total_workers{instance=~\"$instance\"})",
          "legendFormat": "{{instance}} total",
          "refId": "B"
        }
      ],
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 59
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 0,
            "showPoints": "never",
            "spanNulls": false,
            "lineInterpolation": "stepAfter"
          },
          "decimals": 0
        },
        "overrides": []
      },
      "description": "FrankenPHP's workers: all busy means requests queue.",
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    }
  ]
}
