Getting monthly totals with graphql

What is the name of the domain?

xdmitry.com

What is the issue you’re encountering

it appears that it is not possible to get monthly totals for zone with graphql

What steps have you taken to resolve the issue?

I was trying to fetch data with httpRequests1dGroups, but it aggregates it daily, not monthly.

Also it is not possible to remove dimensions from the query, or use empty dimensions, or none as dimensions key, this would theoretically sum up all the data for the whole period.

My query is like below

{
viewer {
zones(filter: {zoneTag: $zoneTag}) {
totals: httpRequests1dGroups(orderBy: [date_DESC],limit: 100, filter: {date_geq: $since}) {
dimensions {date}
sum { bytes cachedBytes cachedRequests encryptedBytes encryptedRequests pageViews requests threats }
}
}
}
}

What feature, service or problem is this related to?

Web Analytics

Hi,

Thank you for reaching out. There’s a tutorial available in our documentation so feel free to copy from it: Querying HTTP events by hostname with GraphQL | Cloudflare Analytics docs

I hope this helps.

Kindly,

I’m getting “message”: “zone ‘my-zone-id’ does not have access to the path. Refer to this page for more details about access controls: Error responses | Cloudflare Analytics docs”,

Is RequestsAndDataTransferByHostname available on a free plan?

This topic was automatically closed after 15 days. New replies are no longer allowed.