Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To use the Go agent methods for writing log and audit files, see [log.go on the

## Logrus integration example [#logrus]

New Relic offers an [integration for the Logrus logging system](https://github.com/newrelic/go-agent/blob/master/_integrations/nrlogrus/nrlogrus.go). Here is an example of using the New Relic Logrus integration in an application:
New Relic offers an [integration for the Logrus logging system.](https://github.com/newrelic/go-agent/blob/master/v3/integrations/nrlogrus/nrlogrus.go) Here is an example of using the New Relic Logrus integration in an application:

1. Import both `github.com/sirupsen/logrus` and `github.com/newrelic/go-agent/v3/integrations/nrlogrus`.
2. Set the log level and assign the Logger output to Logrus. For example:
Expand Down
28 changes: 23 additions & 5 deletions src/content/docs/nrql/nrql-syntax-clauses-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2181,13 +2181,31 @@ SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago
<Collapser
className="freq-link"
id="func-uniqueCount"
title={<InlineCode>uniqueCount(attribute)</InlineCode>}
title={<InlineCode>uniqueCount(attribute, [, attribute [, ...]] [, precision: number])</InlineCode>}
>
Use the `uniqueCount()` function to return the number of unique values recorded for an attribute over the time range specified.

<Callout variant="tip">
To optimize query performance, this function returns approximate results for queries that inspect 256 or more unique values.
</Callout>
Use the `uniqueCount()` function to get the number of unique values recorded for an attribute over a specified time range. This function provides an exact result for up to 256 unique values when you call it without the `precision` argument. For more than 256 unique values, the result is approximate. You can specify a `precision` value within the range of 256 to 50,000 to increase the threshold for exact results. When unique values exceed the set threshold, the function uses the [HyperLogLog probabilistic data structure](https://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf) to provide an approximate result.

Use the `uniqueCount()` function by specifying the attributes and optionally set the precision argument as follows:

```sql
uniqueCount(attribute, [, attribute [, ...]] [, precision: number])
```
* **Attribute(s)**: Attributes for which you want to count unique values.
* **Precision**: A numeric argument that sets the threshold for exact results. You can set a value up to 50,000.

Query example without a `precision` argument:

```sql
SELECT uniqueCount(accountId) FROM Transaction SINCE 1 day ago
```

Query example with a `precision` argument:

```sql
SELECT uniqueCount(foo, bar, baz, precision: 1000) FROM Transaction SINCE 1 day ago
```

</Collapser>

<Collapser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ The general pattern is to configure the Collector with a processor which detects

While Collector requirements and configuration will vary, it comes with a variety of receivers and processors which make it popular for Kubernetes monitoring.
Getting all the required telemetry requires scraping various Kubernetes APIs using multiple receivers with differing permission requirements, so to keep things simple for you, we built a helm chart that uses our custom distribution of the collector [nrdot-collector-k8s](https://github.com/newrelic/nrdot-collector-releases/tree/main/distributions/nrdot-collector-k8s) under the hood.
For more details on how to get started, please refer to [OpenTelemetry for Kubernetes](/docs/kubernetes-pixie/kubernetes-integration/installation/k8s-otel/).
For more details on how to get started, please refer to [OpenTelemetry for Kubernetes](/docs/kubernetes-pixie/k8s-otel/intro/).
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Nested variables let you create dynamic, dependent relationships between variabl
## Use case [#use-case]
Imagine you've created an `Env` variable to select an environment (for example, production and staging). You want to update a `Machine` variable with a list of machines based on the selected environment. Directly embedding the Env variable in a `WHERE` condition for `Machine` isn't supported in a standard setup.

<Callout variant="important">The nested variables feature is available only to <DNT>Pro</DNT>, <DNT>Enterprise</DNT>, and <DNT>Core Compute customers</DNT>. To learn more about our pricing model, editions, and buying programs, refer to the [pricing](/docs/accounts/accounts-billing/new-relic-one-pricing-billing/new-relic-one-pricing-billing/) documentation.</Callout>

**Example:**
- `Variable Env` = `production` or `staging`
- `Variable Machine` = `SELECT uniques(machine) FROM Table WHERE env in ({{Env}})`
Expand Down Expand Up @@ -44,4 +46,4 @@ When you use nested variables, be aware of the following limitations:
- **Parent variable selection required for child definition:** Make sure your `env` variable has selected values when you define your `machine` variable. Otherwise, the `machine` query will return no results.
- **Variable selection required for widget usage:** Ensure the variable has selected values when you use it inside widgets. Otherwise, the widget's query will return no results.
- **Deletion impact:** If your `env` variable is deleted, your `machine` variable may show errors when loading.
- **Cleared values:** If your `env` variable's values are cleared, your `machine` variable will continue to show values based on `env`'s previous selections.
- **Cleared values:** If your `env` variable's values are cleared, your `machine` variable will continue to show values based on `env`'s previous selections.