Grafana

From bibbleWiki
Jump to navigation Jump to search

Introduction

This is a quick page to note about setup of Grafana

CA Cert

The CA Cert is configured against the datasource. You cut and paste the rootCA.pem. Otherwise you get the error

client: failed to call resources: error querying resource: Post \"https://192.168.1.220:9090/api/v1/labels\": tls: failed to verify certificate: x509: certificate signed by unknown authority

Data Frames

Gosh it is all lingo. This is what grafana refers to for it internal layout.

{
  "status": "success",
  "data": {
    "resultType": "matrix",
    "result": [
      {
        "metric": {
          "__name__": "caddy_requests_by_5min",
          "bucket": "1752712500",
          "instance": "192.168.1.220:8080",
          "job": "bibble-caddy-exporter",
          "site": "wiki.bibble.co.nz"
        },
        "values": [
          [
            1752719700,
            "123"
          ]
        ]
      },
      {
        "metric": {
          "__name__": "caddy_requests_by_5min",
          "bucket": "1752712800",
          "instance": "192.168.1.220:8080",
          "job": "bibble-caddy-exporter",
          "site": "wiki.bibble.co.nz"
        },
        "values": [
          [
            1752719700,
            "118"
          ]
        ]
      },
    ]
  }
}

View a data frame this would look like this. Note it is the prometheus generated timestamp in the value which makes these data frames. Here they are not unique because the scrape time was the same.

Time (Scrape TS) Value Bucket Label Site Instance Job Frame Explanation
1752719700 123 1752712500 wiki.bibble.co.nz 192.168.1.220:8080 bibble-caddy-exporter Unique frame due to scrape timestamp
1752719700 118 1752712800 wiki.bibble.co.nz 192.168.1.220:8080 bibble-caddy-exporter Separate frame (same scrape time, different labels)
1752719700 104 1752712500 www.bibble.co.nz 192.168.1.220:8080 bibble-caddy-exporter Separate frame (same scrape time, different site)