Skip to content

Commit

Permalink
Merge pull request #19643 from brnhensley/patch-1
Browse files Browse the repository at this point in the history
chore: capitalize nrql queries
  • Loading branch information
newrelic707195 authored Jan 7, 2025
2 parents 32abab5 + f8d302f commit 89573ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
25 changes: 14 additions & 11 deletions src/content/docs/service-level-management/create-slm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Based on `Transaction` events, these SLIs are the most common for request-driven
To select an appropriate value for the duration condition, one typical practice is to select the 95 percentile duration of the responses for the last 7 or 15 days. Find this duration threshold using the [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder/), and use it to determine what you consider to be good events for your SLI:

```sql
SELECT percentile(duration, 95) FROM Transaction WHERE entityGuid = '{entityGuid}' since 7 days ago limit max
SELECT percentile(duration, 95) FROM Transaction WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX
```

<DNT>
Expand Down Expand Up @@ -385,7 +385,8 @@ The following SLIs are based on Google's Browser Core Web Vitals.
To determine a realistic number to use for `{largestContentfulPaint}` in your environment, one typical practice is to select the 95 percentile duration of the responses for the last 7 or 15 days. Find it by using the query builder:

```sql
SELECT percentile(largestContentfulPaint, 95) FROM PageViewTiming WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX
SELECT percentile(largestContentfulPaint, 95) FROM PageViewTiming
WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX
```
</Collapser>

Expand Down Expand Up @@ -422,7 +423,8 @@ The following SLIs are based on Google's Browser Core Web Vitals.
To determine a realistic number to use for `{interactionToNextPaint}` in your environment, one typical practice is to select the 95 percentile duration of the responses for the last 7 or 15 days. Find it by using the query builder:

```sql
SELECT percentile(interactionToNextPaint, 95) FROM PageViewTiming WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX FACET deviceType
SELECT percentile(interactionToNextPaint, 95) FROM PageViewTiming
WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX FACET deviceType
```
</Collapser>

Expand Down Expand Up @@ -469,7 +471,8 @@ The following SLIs are based on Google's Browser Core Web Vitals.
To determine a realistic number to select for `{cumulativeLayoutShift}` in your environment, one typical practice is to select the 75th percentile of page loads for the last 7 or 15 days, segmented across mobile and desktop devices. Find it by using the query builder:

```sql
SELECT percentile(cumulativeLayoutShift, 95) FROM PageViewTiming WHERE entityGuid = '{entityGuid}' since 7 days ago limit max facet deviceType
SELECT percentile(cumulativeLayoutShift, 95) FROM PageViewTiming
WHERE entityGuid = '{entityGuid}' since 7 days ago limit max facet deviceType
```
</Collapser>
</CollapserGroup>
Expand Down Expand Up @@ -567,26 +570,26 @@ To create service levels, follow these steps:
```sql
FROM Metric
SELECT percentage(sum(scrooge_do_expire_count),
WHERE status = 'success') AS 'Success Rate'
WHERE env='production'
WHERE status = 'success') AS 'Success Rate'
WHERE env = 'production'
AND status != 'attempt'
```

For the valid queries we would just copy the outside `WHERE` clause:

```sql
FROM Metric
SELECT sum(scrooge_do_expire_count))
WHERE env='production'
SELECT sum(scrooge_do_expire_count)
WHERE env = 'production'
AND status != 'attempt'
```

While the good event would be the outside `WHERE` clause and `WHERE` clause from the percentage function:

```sql
FROM Metric
SELECT sum(scrooge_do_expire_count))
WHERE env='production'
SELECT sum(scrooge_do_expire_count)
WHERE env = 'production'
AND status != 'attempt'
AND status = 'success'
```
Expand All @@ -612,7 +615,7 @@ To create service levels, follow these steps:
```sql
FROM ServerlessSample
SELECT sum(provider.errors.Sum)
WHERE awsAccountId = 'XXX' And provider LIKE 'LambdaFunction%'
WHERE awsAccountId = 'XXX' AND provider LIKE 'LambdaFunction%'
```

Example using `getField()` combined with `getCdfCount()`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Let's get started with creating your application performance benchmarks:
To select an appropriate value for the duration condition, one typical practice is to select the 95 percentile duration of the responses for the last 7 or 15 days. Find this duration threshold using the [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder/), and use it to determine good events for your SLI:

```sql
SELECT percentile(duration, 95) FROM Transaction WHERE entityGuid = '{entityGuid}' since 7 days ago limit max
SELECT percentile(duration, 95) FROM Transaction WHERE entityGuid = '{entityGuid}' SINCE 7 days ago LIMIT MAX
```

<DNT>
Expand Down Expand Up @@ -154,7 +154,7 @@ Let's get started with creating your application performance benchmarks:

```sql
FROM: TransactionError
WHERE: entityGuid = '{entityGuid}' AND error.expected IS FALSE
WHERE: entityGuid = '{entityGuid}' AND error.expected IS false
```

Where `{entityGuid}` is the service's GUID.
Expand Down

0 comments on commit 89573ad

Please sign in to comment.