Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: capitalize NRQL clauses
  • Loading branch information
brnhensley authored Dec 3, 2025
commit f5b99406dda33152f601c72ff7cace1921811bfb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Our main API experienced elevated error rates starting at 14:32 UTC...

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

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

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

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

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

**Query block: Daily active users creating dashboards**
```sql
SELECT uniqueCount(userId) as 'Users Creating Dashboards'
SELECT uniqueCount(userId) AS 'Users Creating Dashboards'
FROM PageView
WHERE pageUrl LIKE '%/dashboard/create%'
TIMESERIES 1 day
Expand All @@ -177,9 +177,9 @@ SINCE 30 days ago
**Query block: Dashboard creation funnel**
```sql
SELECT funnel(userId,
WHERE pageUrl LIKE '%/dashboard/create%' as 'Started Creation',
WHERE pageUrl LIKE '%/dashboard/create%' AND eventType = 'widget_added' as 'Added Widget',
WHERE eventType = 'dashboard_saved' as 'Saved Dashboard'
WHERE pageUrl LIKE '%/dashboard/create%' AS 'Started Creation',
WHERE pageUrl LIKE '%/dashboard/create%' AND eventType = 'widget_added' AS 'Added Widget',
WHERE eventType = 'dashboard_saved' AS 'Saved Dashboard'
)
FROM PageView, UserAction
SINCE 30 days ago
Expand Down Expand Up @@ -209,8 +209,8 @@ Create ongoing security analysis to track potential threats and system vulnerabi

**Query block: Failed authentication patterns**
```sql
SELECT count(*) as 'Failed Attempts',
latest(remoteAddr) as 'Source IP'
SELECT count(*) AS 'Failed Attempts',
latest(remoteAddr) AS 'Source IP'
FROM Log
WHERE message LIKE '%authentication failed%'
FACET remoteAddr
Expand All @@ -221,8 +221,8 @@ ORDER BY count(*) DESC

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

**Query block: User engagement metrics**
```sql
SELECT count(*) as 'Page Views',
uniqueCount(userId) as 'Active Users',
average(duration) as 'Avg Session Duration'
SELECT count(*) AS 'Page Views',
uniqueCount(userId) AS 'Active Users',
average(duration) AS 'Avg Session Duration'
FROM PageView
TIMESERIES 1 day
SINCE 30 days ago
Expand All @@ -265,10 +265,10 @@ SINCE 30 days ago
**Query block: Conversion funnel**
```sql
SELECT funnel(userId,
WHERE pageUrl = '/signup' as 'Signup Page',
WHERE pageUrl = '/signup/verify' as 'Email Verified',
WHERE pageUrl = '/onboarding/complete' as 'Onboarding Complete',
WHERE eventType = 'subscription_created' as 'Converted'
WHERE pageUrl = '/signup' AS 'Signup Page',
WHERE pageUrl = '/signup/verify' AS 'Email Verified',
WHERE pageUrl = '/onboarding/complete' AS 'Onboarding Complete',
WHERE eventType = 'subscription_created' AS 'Converted'
)
FROM PageView, UserAction
SINCE 30 days ago
Expand Down Expand Up @@ -344,4 +344,4 @@ SINCE 1 hour ago

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