{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    },
    {
      "name": "VAR_TBL_STATS",
      "label": "influx",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    },
    {
      "name": "VAR_DS_INFLUXDB",
      "type": "constant",
      "label": "InfluxDB DataSource",
      "value": "InfluxDB-starlinkstats",
      "description": ""
    },
    {
      "name": "VAR_TBL_STATS",
      "type": "constant",
      "label": "Table name for Statistics",
      "value": "spacex.starlink.user_terminal.status",
      "description": ""
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.5"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1637920561166,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "binbps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/(uplink)/m"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Uplink"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "downlink_throughput_bps"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Downlink"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "uplink_throughput_bps"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Uplink"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max",
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi"
        }
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "hide": false,
          "query": "from(bucket: \"starlink\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_field\"] == \"downlink_throughput_bps\" or r[\"_field\"] == \"uplink_throughput_bps\")\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Actual Throughput",
      "type": "timeseries"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "fraction_obstructed"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Fraction Obstruction"
              },
              {
                "id": "unit",
                "value": "%"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "pop_ping_drop_rate"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Pop Ping Drop Rate"
              },
              {
                "id": "unit",
                "value": "%"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "pop_ping_latency_ms"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Pop Ping Latency Rate"
              },
              {
                "id": "unit",
                "value": "ms"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max",
            "min"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi"
        }
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "query": "from(bucket: \"starlink\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_field\"] == \"pop_ping_latency_ms\" or r[\"_field\"] == \"pop_ping_drop_rate\" or r[\"_field\"] == \"fraction_obstructed\" or r[\"_field\"] == \"snr\")\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Ping Latency, Drop Rate, Percent Obstructed & SNR",
      "type": "timeseries"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_INFLUXDB}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "displayMode": "auto",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "alerts"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Alerts"
              },
              {
                "id": "custom.width",
                "value": 100
              },
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "currently_obstructed"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Currently Obstructed"
              },
              {
                "id": "custom.width",
                "value": 200
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "hardware_version"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Hardware Revision"
              },
              {
                "id": "custom.width",
                "value": 200
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "software_version"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Software Revision"
              },
              {
                "id": "custom.width",
                "value": 400
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "state"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "State"
              },
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "alert_motors_stuck"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Motor Stuck"
              },
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "alert_unexpected_location"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Unexpected Location"
              },
              {
                "id": "custom.width",
                "value": 150
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "alert_thermal_shutdown"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Thermal Shutdown"
              },
              {
                "id": "custom.width",
                "value": 140
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "alert_thermal_throttle"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Thermal Throttle"
              },
              {
                "id": "custom.width",
                "value": 130
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "uptime"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Uptime"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "unit",
                "value": "s"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 150
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "id": 6,
      "interval": null,
      "links": [],
      "options": {
        "frameIndex": 0,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Time (last)"
          }
        ]
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "query": "from(bucket: \"starlink\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_field\"] == \"hardware_version\" or r[\"_field\"] == \"state\" or r[\"_field\"] == \"software_version\" or r[\"_field\"] == \"alerts\" or r[\"_field\"] == \"currently_obstructed\" or  r[\"_field\"] == \"alert_unexpected_location\" or r[\"_field\"] == \"alert_thermal_throttle\" or r[\"_field\"] == \"alert_thermal_shutdown\" or r[\"_field\"] == \"alert_motors_stuck\" or r[\"_field\"] == \"uptime\" )\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Alerts & Versions",
      "transformations": [
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "Time"
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": false,
  "schemaVersion": 32,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "description": null,
        "error": null,
        "hide": 2,
        "label": "InfluxDB DataSource",
        "name": "DS_INFLUXDB",
        "query": "${VAR_DS_INFLUXDB}",
        "skipUrlSync": false,
        "type": "constant",
        "current": {
          "value": "${VAR_DS_INFLUXDB}",
          "text": "${VAR_DS_INFLUXDB}",
          "selected": false
        },
        "options": [
          {
            "value": "${VAR_DS_INFLUXDB}",
            "text": "${VAR_DS_INFLUXDB}",
            "selected": false
          }
        ]
      },
      {
        "description": null,
        "error": null,
        "hide": 2,
        "label": "Table name for Statistics",
        "name": "TBL_STATS",
        "query": "${VAR_TBL_STATS}",
        "skipUrlSync": false,
        "type": "constant",
        "current": {
          "value": "${VAR_TBL_STATS}",
          "text": "${VAR_TBL_STATS}",
          "selected": false
        },
        "options": [
          {
            "value": "${VAR_TBL_STATS}",
            "text": "${VAR_TBL_STATS}",
            "selected": false
          }
        ]
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Starlink Statistics",
  "uid": "ymkHwLaMz",
  "version": 12
}