Skip to content

Commit f5b9940

Browse files
authored
chore: capitalize NRQL clauses
1 parent 67dc218 commit f5b9940

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/content/docs/query-your-data/explore-query-data/notebooks/notebooks-examples.mdx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Our main API experienced elevated error rates starting at 14:32 UTC...
3535

3636
**Query block: Error rate timeline**
3737
```sql
38-
SELECT count(*) as 'Total Requests',
39-
filter(count(*), WHERE httpResponseCode >= 400) as 'Errors'
38+
SELECT count(*) AS 'Total Requests',
39+
filter(count(*), WHERE httpResponseCode >= 400) AS 'Errors'
4040
FROM Transaction
4141
WHERE appName = 'api-production'
4242
TIMESERIES 1 minute
@@ -45,8 +45,8 @@ SINCE '2024-10-15 14:00:00' UNTIL '2024-10-15 16:00:00'
4545

4646
**Query block: Error breakdown by endpoint**
4747
```sql
48-
SELECT count(*) as 'Error Count',
49-
average(duration) as 'Avg Duration (ms)'
48+
SELECT count(*) AS 'Error Count',
49+
average(duration) AS 'Avg Duration (ms)'
5050
FROM Transaction
5151
WHERE appName = 'api-production'
5252
AND httpResponseCode >= 400
@@ -73,8 +73,8 @@ ORDER BY count(*) DESC
7373

7474
**Query block: Database performance during incident**
7575
```sql
76-
SELECT average(duration) as 'Query Duration (ms)',
77-
count(*) as 'Query Count'
76+
SELECT average(duration) AS 'Query Duration (ms)',
77+
count(*) AS 'Query Count'
7878
FROM DatabaseSample
7979
WHERE host = 'prod-db-01'
8080
TIMESERIES 5 minutes
@@ -104,9 +104,9 @@ Track and analyze application performance trends over time to identify optimizat
104104

105105
**Query block: Response time trends**
106106
```sql
107-
SELECT percentile(duration, 50) as 'P50',
108-
percentile(duration, 95) as 'P95',
109-
percentile(duration, 99) as 'P99'
107+
SELECT percentile(duration, 50) AS 'P50',
108+
percentile(duration, 95) AS 'P95',
109+
percentile(duration, 99) AS 'P99'
110110
FROM Transaction
111111
WHERE appName IN ('web-frontend', 'api-backend', 'auth-service')
112112
FACET appName
@@ -116,7 +116,7 @@ SINCE 7 days ago
116116

117117
**Query block: Error rate comparison**
118118
```sql
119-
SELECT percentage(count(*), WHERE error IS true) as 'Error Rate %'
119+
SELECT percentage(count(*), WHERE error IS true) AS 'Error Rate %'
120120
FROM Transaction
121121
WHERE appName IN ('web-frontend', 'api-backend', 'auth-service')
122122
FACET appName
@@ -167,7 +167,7 @@ New interactive dashboard builder with drag-and-drop widgets...
167167

168168
**Query block: Daily active users creating dashboards**
169169
```sql
170-
SELECT uniqueCount(userId) as 'Users Creating Dashboards'
170+
SELECT uniqueCount(userId) AS 'Users Creating Dashboards'
171171
FROM PageView
172172
WHERE pageUrl LIKE '%/dashboard/create%'
173173
TIMESERIES 1 day
@@ -177,9 +177,9 @@ SINCE 30 days ago
177177
**Query block: Dashboard creation funnel**
178178
```sql
179179
SELECT funnel(userId,
180-
WHERE pageUrl LIKE '%/dashboard/create%' as 'Started Creation',
181-
WHERE pageUrl LIKE '%/dashboard/create%' AND eventType = 'widget_added' as 'Added Widget',
182-
WHERE eventType = 'dashboard_saved' as 'Saved Dashboard'
180+
WHERE pageUrl LIKE '%/dashboard/create%' AS 'Started Creation',
181+
WHERE pageUrl LIKE '%/dashboard/create%' AND eventType = 'widget_added' AS 'Added Widget',
182+
WHERE eventType = 'dashboard_saved' AS 'Saved Dashboard'
183183
)
184184
FROM PageView, UserAction
185185
SINCE 30 days ago
@@ -209,8 +209,8 @@ Create ongoing security analysis to track potential threats and system vulnerabi
209209

210210
**Query block: Failed authentication patterns**
211211
```sql
212-
SELECT count(*) as 'Failed Attempts',
213-
latest(remoteAddr) as 'Source IP'
212+
SELECT count(*) AS 'Failed Attempts',
213+
latest(remoteAddr) AS 'Source IP'
214214
FROM Log
215215
WHERE message LIKE '%authentication failed%'
216216
FACET remoteAddr
@@ -221,8 +221,8 @@ ORDER BY count(*) DESC
221221

222222
**Query block: API access anomalies**
223223
```sql
224-
SELECT count(*) as 'Request Count',
225-
uniqueCount(userAgent) as 'Unique User Agents'
224+
SELECT count(*) AS 'Request Count',
225+
uniqueCount(userAgent) AS 'Unique User Agents'
226226
FROM Transaction
227227
WHERE appName = 'api-gateway'
228228
FACET request.headers.x-forwarded-for
@@ -254,9 +254,9 @@ Track key business KPIs alongside technical metrics to understand the complete p
254254

255255
**Query block: User engagement metrics**
256256
```sql
257-
SELECT count(*) as 'Page Views',
258-
uniqueCount(userId) as 'Active Users',
259-
average(duration) as 'Avg Session Duration'
257+
SELECT count(*) AS 'Page Views',
258+
uniqueCount(userId) AS 'Active Users',
259+
average(duration) AS 'Avg Session Duration'
260260
FROM PageView
261261
TIMESERIES 1 day
262262
SINCE 30 days ago
@@ -265,10 +265,10 @@ SINCE 30 days ago
265265
**Query block: Conversion funnel**
266266
```sql
267267
SELECT funnel(userId,
268-
WHERE pageUrl = '/signup' as 'Signup Page',
269-
WHERE pageUrl = '/signup/verify' as 'Email Verified',
270-
WHERE pageUrl = '/onboarding/complete' as 'Onboarding Complete',
271-
WHERE eventType = 'subscription_created' as 'Converted'
268+
WHERE pageUrl = '/signup' AS 'Signup Page',
269+
WHERE pageUrl = '/signup/verify' AS 'Email Verified',
270+
WHERE pageUrl = '/onboarding/complete' AS 'Onboarding Complete',
271+
WHERE eventType = 'subscription_created' AS 'Converted'
272272
)
273273
FROM PageView, UserAction
274274
SINCE 30 days ago
@@ -344,4 +344,4 @@ SINCE 1 hour ago
344344

345345
* Learn how to [add queries to notebooks](/docs/query-your-data/explore-query-data/notebooks/add-queries-to-notebooks)
346346
* Discover [sharing options](/docs/query-your-data/explore-query-data/notebooks/share-notebooks) for your notebooks
347-
* Explore [NRQL examples](/docs/nrql/nrql-examples) for more query inspiration
347+
* Explore [NRQL examples](/docs/nrql/nrql-examples) for more query inspiration

0 commit comments

Comments
 (0)