Skip to content

Commit

Permalink
Update dashboard-template-variables rules
Browse files Browse the repository at this point in the history
We received a GTSE related to Variables (https://new-relic.atlassian.net/browse/NR-265923) which was actually related to documentation.
We want to make sure the usage of uniques and their limits are clear for customers and refer them to the `uniques` documentation if needed.
  • Loading branch information
chmartinez committed May 7, 2024
1 parent bbf616b commit 0d0ad46
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,22 @@ As discussed in the [section on defining template variables](#step1), there are
Note that this is a different topic than writing queries that make use of a template variable.
</Callout>

Here are some rules and guidance on creating a query-type variable:
* Queries must use the `uniques` or `keyset` syntax. Uniques return up to 10,000 results. Check [`uniques`](/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/#func-uniques) and the [`keyset`](/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/#keyset). Here's a couple of query examples:
Here are some rules and guidance on creating a query-type variable:
* Queries must use the `uniques` or `keyset` syntax.
* The same syntax and limits of both functions are applicable here. Examples:

```sql
From PageAction select uniques(countryCode)
From PageAction select uniques(countryCode) --> this will return up to 1k results
```

```sql
From PageAction select uniques(countryCode, 10000) --> this will return up to 10k results
```

```sql
From PageView select keyset() SINCE 1 day ago
```
Please, check [`uniques`](/docs/nrql/nrql-syntax-clauses-functions/#func-uniques) and the [`keyset`](/docs/nrql/nrql-syntax-clauses-functions/#keyset) for more info.

* You can use almost any NRQL query as long as the `uniques` and `keyset` components return a list of values.
* Nested variables are not supported: there can't be variables within variables.
Expand Down

0 comments on commit 0d0ad46

Please sign in to comment.