lablabs / cloudflare-exporter

Prometheus CloudFlare Exporter
Apache License 2.0
315 stars 104 forks source link

client request path #79

Open supergrilo-cw opened 2 years ago

supergrilo-cw commented 2 years ago

Hi guys! Is possible to have a client request path metrics? Something like top10, or configurable

I use this query to get that information:

query

query GetZoneTopNs {
  viewer {
    zones(filter: {zoneTag: $zoneTag}) {
      total: httpRequestsAdaptiveGroups(filter: $filter, limit: 1) {
        count
        sum {
          edgeResponseBytes
          visits
          __typename
        }
        __typename
      }
      topPaths: httpRequestsAdaptiveGroups(filter: $filter, limit: 15, orderBy: [$order]) {
        count
        avg {
          sampleInterval
          __typename
        }
        sum {
          edgeResponseBytes
          visits
          __typename
        }
        dimensions {
          metric: clientRequestPath
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

Variables:

 {
    "zoneTag": "ZONEID",
    "filter": {
      "AND": [
        {
          "datetime_geq": "2022-10-06T19:41:43Z",
          "datetime_leq": "2022-10-06T20:11:43Z"
        },
        {
          "requestSource": "eyeball"
        },
        {
          "clientRequestPath": "/api/"
        }
      ]
    },
  "order": "count_DESC"
}