diff --git a/src/content/docs/aegis/analytics.mdx b/src/content/docs/aegis/analytics.mdx index 6a96427eacca44..87252d3d70a2e4 100644 --- a/src/content/docs/aegis/analytics.mdx +++ b/src/content/docs/aegis/analytics.mdx @@ -11,7 +11,11 @@ Use the [GraphQL API](/analytics/graphql-api/) to get aggregate data and monitor -Refer to the GraphQL Analytics API documentation to [get started](/analytics/graphql-api/getting-started/). The specific Aegis schema is called `aegisIpUtilizationAdaptiveGroups`. +Refer to the [GraphQL Analytics API documentation](/analytics/graphql-api/getting-started/) for further guidance, or consider the [example](#example) below for a quickstart. + +## Aegis schema + +The specific Aegis schema is called `aegisIpUtilizationAdaptiveGroups`. You can get average (`avg`) or maximum (`max`) utilization values (in percentage), and use the following dimensions: @@ -29,3 +33,109 @@ You can get average (`avg`) or maximum (`max`) utilization values (in percentage - `popUtilizationKey` - The Cloudflare point of presence (PoP), the Aegis IP, and the origin IP and port. For example, `sjc 192.0.2.1 203.0.113.150:443`. + +## Example + +Refer to the query below to learn how to get average utilization and maximum utilization by point of presence, and filter the results. + +You can also select the button at the bottom to use this query for your account via the [Cloudflare GraphQL API Explorer](https://graphql.cloudflare.com/explorer). Make sure to provide your account ID and timestamps, and replace the placeholders for `popName`, `egressIp`, and `origin` as needed. + +```graphql graphql-api-explorer "popName: """ "egressIp: """ "origin: """ +query AegisIpUtilizationQuery( + $accountTag: string + $datetimeStart: string + $datetimeEnd: string +) { + viewer { + utilization: accounts(filter: { accountTag: $accountTag }) { + avgByPopUtilization: aegisIpUtilizationAdaptiveGroups( + limit: 100 + filter: { + datetimeFiveMinutes_geq: $datetimeStart + datetimeFiveMinutes_leq: $datetimeEnd + } + orderBy: [datetimeFiveMinutes_ASC] + ) { + avg { + utilization + } + dimensions { + datetimeFiveMinutes + popUtilizationKey + } + } + + maxByPopUtilization: aegisIpUtilizationAdaptiveGroups( + limit: 100 + filter: { + datetimeFiveMinutes_geq: $datetimeStart + datetimeFiveMinutes_leq: $datetimeEnd + } + orderBy: [datetimeFiveMinutes_ASC] + ) { + max { + utilization + } + dimensions { + datetimeFiveMinutes + popUtilizationKey + } + } + + filterPopUtilization: aegisIpUtilizationAdaptiveGroups( + limit: 100 + filter: { + datetimeFiveMinutes_geq: $datetimeStart + datetimeFiveMinutes_leq: $datetimeEnd + popName: "" + } + orderBy: [datetimeFiveMinutes_ASC] + ) { + max { + utilization + } + dimensions { + datetimeFiveMinutes + popUtilizationKey + } + } + + filterIPUtilization: aegisIpUtilizationAdaptiveGroups( + limit: 100 + filter: { + datetimeFiveMinutes_geq: $datetimeStart + datetimeFiveMinutes_leq: $datetimeEnd + egressIp: "" + } + orderBy: [datetimeFiveMinutes_ASC] + ) { + max { + utilization + } + dimensions { + datetimeFiveMinutes + popUtilizationKey + } + } + + filterOriginUtilization: aegisIpUtilizationAdaptiveGroups( + limit: 100 + filter: { + datetimeFiveMinutes_geq: $datetimeStart + datetimeFiveMinutes_leq: $datetimeEnd + origin: "" + } + orderBy: [datetimeFiveMinutes_ASC] + ) { + max { + utilization + } + dimensions { + datetimeFiveMinutes + popUtilizationKey + } + } + } + } +} +``` \ No newline at end of file