Skip to content

Commit f93126e

Browse files
RebeccaTamachirosdnts
authored andcommitted
[Aegis] GraphQL Explorer in Aegis analytics docs (cloudflare#23681)
* Create dedicated section for example and use graphql code block * Call out variables and placeholders to replace
1 parent 3b2b374 commit f93126e

File tree

1 file changed

+111
-1
lines changed

1 file changed

+111
-1
lines changed

src/content/docs/aegis/analytics.mdx

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ Use the [GraphQL API](/analytics/graphql-api/) to get aggregate data and monitor
1111

1212
<Render file="concurrent-connections-explainer" />
1313

14-
Refer to the GraphQL Analytics API documentation to [get started](/analytics/graphql-api/getting-started/). The specific Aegis schema is called `aegisIpUtilizationAdaptiveGroups`.
14+
Refer to the [GraphQL Analytics API documentation](/analytics/graphql-api/getting-started/) for further guidance, or consider the [example](#example) below for a quickstart.
15+
16+
## Aegis schema
17+
18+
The specific Aegis schema is called `aegisIpUtilizationAdaptiveGroups`.
1519

1620
You can get average (`avg`) or maximum (`max`) utilization values (in percentage), and use the following dimensions:
1721

@@ -29,3 +33,109 @@ You can get average (`avg`) or maximum (`max`) utilization values (in percentage
2933

3034
- `popUtilizationKey` <Type text="string" />
3135
- 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`.
36+
37+
## Example
38+
39+
Refer to the query below to learn how to get average utilization and maximum utilization by point of presence, and filter the results.
40+
41+
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.
42+
43+
```graphql graphql-api-explorer "popName: "<CLOUDFLARE_POP>"" "egressIp: "<YOUR_EGRESS_IP>"" "origin: "<ORIGIN_IP_AND_PORT>""
44+
query AegisIpUtilizationQuery(
45+
$accountTag: string
46+
$datetimeStart: string
47+
$datetimeEnd: string
48+
) {
49+
viewer {
50+
utilization: accounts(filter: { accountTag: $accountTag }) {
51+
avgByPopUtilization: aegisIpUtilizationAdaptiveGroups(
52+
limit: 100
53+
filter: {
54+
datetimeFiveMinutes_geq: $datetimeStart
55+
datetimeFiveMinutes_leq: $datetimeEnd
56+
}
57+
orderBy: [datetimeFiveMinutes_ASC]
58+
) {
59+
avg {
60+
utilization
61+
}
62+
dimensions {
63+
datetimeFiveMinutes
64+
popUtilizationKey
65+
}
66+
}
67+
68+
maxByPopUtilization: aegisIpUtilizationAdaptiveGroups(
69+
limit: 100
70+
filter: {
71+
datetimeFiveMinutes_geq: $datetimeStart
72+
datetimeFiveMinutes_leq: $datetimeEnd
73+
}
74+
orderBy: [datetimeFiveMinutes_ASC]
75+
) {
76+
max {
77+
utilization
78+
}
79+
dimensions {
80+
datetimeFiveMinutes
81+
popUtilizationKey
82+
}
83+
}
84+
85+
filterPopUtilization: aegisIpUtilizationAdaptiveGroups(
86+
limit: 100
87+
filter: {
88+
datetimeFiveMinutes_geq: $datetimeStart
89+
datetimeFiveMinutes_leq: $datetimeEnd
90+
popName: "<CLOUDFLARE_POP>"
91+
}
92+
orderBy: [datetimeFiveMinutes_ASC]
93+
) {
94+
max {
95+
utilization
96+
}
97+
dimensions {
98+
datetimeFiveMinutes
99+
popUtilizationKey
100+
}
101+
}
102+
103+
filterIPUtilization: aegisIpUtilizationAdaptiveGroups(
104+
limit: 100
105+
filter: {
106+
datetimeFiveMinutes_geq: $datetimeStart
107+
datetimeFiveMinutes_leq: $datetimeEnd
108+
egressIp: "<YOUR_EGRESS_IP>"
109+
}
110+
orderBy: [datetimeFiveMinutes_ASC]
111+
) {
112+
max {
113+
utilization
114+
}
115+
dimensions {
116+
datetimeFiveMinutes
117+
popUtilizationKey
118+
}
119+
}
120+
121+
filterOriginUtilization: aegisIpUtilizationAdaptiveGroups(
122+
limit: 100
123+
filter: {
124+
datetimeFiveMinutes_geq: $datetimeStart
125+
datetimeFiveMinutes_leq: $datetimeEnd
126+
origin: "<ORIGIN_IP_AND_PORT>"
127+
}
128+
orderBy: [datetimeFiveMinutes_ASC]
129+
) {
130+
max {
131+
utilization
132+
}
133+
dimensions {
134+
datetimeFiveMinutes
135+
popUtilizationKey
136+
}
137+
}
138+
}
139+
}
140+
}
141+
```

0 commit comments

Comments
 (0)