Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of notes #1

Open
chipironcin opened this issue Aug 8, 2023 · 1 comment
Open

Couple of notes #1

chipironcin opened this issue Aug 8, 2023 · 1 comment

Comments

@chipironcin
Copy link

Cool project! Thanks for sharing with all of us :)

I played with it a little bit and found the following limitations:

  • No shared crosshair
  • Only latency is stored in the database (no failed pings)
  • No minimum interval (should be the interval of pings)
  • Not sure if Grafana/Influx are estimating values due to lack of space when selecting a big time window. Maybe we need a "max" function here and there

Also I tried adding the following panels

  • How many pings over/under x ms
  • Percentage of time latency was over/under x ms

But found them not super reliable due to my questions/observations on the first paragraph.
If someone could help me clarify these I could contribute the panels with more confidence 👍

(Here is what I have so far, for those who want to play with it. Keep in mind it can be wrong and it is unfinished)

{
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:7",
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "type": "dashboard"
      },
      {
        "$$hashKey": "object:8",
        "datasource": {
          "type": "influxdb",
          "uid": "P951FEA4DE68E13C5"
        },
        "enable": true,
        "hide": false,
        "iconColor": "rgba(255, 96, 96, 1)",
        "limit": 100,
        "name": "OFFLINE",
        "query": "SELECT \"latency\" FROM \"ping\" WHERE $timeFilter AND latency=0 GROUP BY \"host\"",
        "showIn": 0,
        "tags": [],
        "type": "tags"
      }
    ]
  },
  "description": "monitor your internet connection using ping and monitoring latency",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "influxdb",
        "uid": "P951FEA4DE68E13C5"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 50,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 4,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 3,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.3",
      "targets": [
        {
          "alias": "$tag_host",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            }
          ],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"latency\" FROM \"ping\" WHERE $timeFilter GROUP BY \"host\"",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": []
        }
      ],
      "title": "Internet latency",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "P951FEA4DE68E13C5"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 50,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 4,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1200
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": [
          {
            "__systemRef": "hideSeriesFrom",
            "matcher": {
              "id": "byNames",
              "options": {
                "mode": "exclude",
                "names": [
                  "Max"
                ],
                "prefix": "All except:",
                "readOnly": true
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": true
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 4,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.3",
      "targets": [
        {
          "alias": "$tag_host",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            }
          ],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"latency\" FROM \"ping\" WHERE $timeFilter GROUP BY \"host\"",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": []
        }
      ],
      "title": "Internet latency",
      "transformations": [
        {
          "id": "calculateField",
          "options": {
            "mode": "reduceRow",
            "reduce": {
              "include": [
                "1.1.1.1",
                "8.8.8.8"
              ],
              "reducer": "max"
            },
            "replaceFields": true
          }
        }
      ],
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "P951FEA4DE68E13C5"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 50,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 4,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 17
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.3",
      "targets": [
        {
          "alias": "$tag_host",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            }
          ],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"latency\" FROM \"ping\" WHERE $timeFilter GROUP BY \"host\"",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "latency::field",
              "operator": ">",
              "value": "$threshold"
            }
          ]
        }
      ],
      "title": "Latency over $threshold ms (might be wrong)",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "calculateField",
          "options": {
            "binary": {
              "left": "1.1.1.1",
              "operator": "/",
              "reducer": "sum",
              "right": "1.1.1.1"
            },
            "mode": "binary",
            "reduce": {
              "include": [
                "1.1.1.1"
              ],
              "reducer": "sum"
            },
            "replaceFields": true
          }
        }
      ],
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "P951FEA4DE68E13C5"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 25
      },
      "id": 6,
      "interval": "2s",
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.3",
      "targets": [
        {
          "alias": "latency under $latency ms",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "autogen",
          "query": "SELECT count(*) FROM \"autogen\".\"ping\" WHERE (\"latency\"::field < $threshold) AND $timeFilter group by time($__interval)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "latency::field",
              "operator": "<",
              "value": "1000"
            }
          ]
        },
        {
          "alias": "latency over $latency ms",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [],
          "hide": false,
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "autogen",
          "query": "SELECT count(*) FROM \"autogen\".\"ping\" WHERE (\"latency\"::field > $threshold) AND $timeFilter group by time($__interval)",
          "rawQuery": true,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "latency::field",
              "operator": "<",
              "value": "1000"
            }
          ]
        }
      ],
      "title": "count of pings under/over $threshold ms (might be wrong)",
      "transformations": [],
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "P951FEA4DE68E13C5"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 2,
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 25
      },
      "id": 7,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "/^latency2$/",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "10.0.3",
      "targets": [
        {
          "alias": "latency",
          "datasource": {
            "type": "influxdb",
            "uid": "P951FEA4DE68E13C5"
          },
          "groupBy": [],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "autogen",
          "query": "SELECT mean(\"latency\") FROM \"autogen\".\"ping\" WHERE (\"latency\"::field > $threshold) AND $timeFilter group by time($__interval) fill(0)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "latency"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "latency::field",
              "operator": ">",
              "value": "$latency"
            }
          ]
        }
      ],
      "title": "% of time over $threshold ms (prob wrong)",
      "transformations": [
        {
          "id": "convertFieldType",
          "options": {
            "conversions": [
              {
                "destinationType": "boolean",
                "targetField": "latency"
              }
            ],
            "fields": {}
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "latency": "latency2"
            }
          }
        },
        {
          "id": "convertFieldType",
          "options": {
            "conversions": [
              {
                "destinationType": "number",
                "targetField": "latency2"
              }
            ],
            "fields": {}
          }
        }
      ],
      "transparent": true,
      "type": "gauge"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "200",
          "value": "200"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Threshold",
        "multi": false,
        "name": "threshold",
        "options": [],
        "query": "",
        "queryValue": "200",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1s",
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "PING",
  "uid": "3Qprta6Wk",
  "version": 2,
  "weekStart": ""
}
@tapionx
Copy link
Owner

tapionx commented Aug 8, 2023

thanks @chipironcin for taking interest in the project!
I'm not sure I will have time to investigate about the problems you are mentioning, but if you want to provide a pull request, I would be happy to review and merge it 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants