Skip to content

Commit

Permalink
Merge pull request #18766 from newrelic/update-screenshot-errors-inbox
Browse files Browse the repository at this point in the history
Update screenshot errors inbox
  • Loading branch information
akristen authored Sep 27, 2024
2 parents dee427f + de88db4 commit 3548347
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 33 deletions.
137 changes: 104 additions & 33 deletions src/content/docs/errors-inbox/error-users-impacted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,59 @@ redirects:
freshnessValidatedDate: never
---

You can now see the number of users impacted by an error group which allows you to focus your effort on the
highest impacting error groups. Users impacted are listed next to the occurrences metric in the list view.
You can also [set up Alerts](/docs/errors-inbox/error-users-impacted/#alerting-on-users-impacted) for error groups impacting more than a certain number of users.
New Relic agents automatically capture data about user impact. When you organize by error group, you can see how many users are affected by errors. This helps you prioritize where to focus your debugging efforts by showing you the errors with the highest numbers of users affected.

<img
title="An image showing how to navigate users impacted"
alt="This is an image of the main errors inbox users impacted"
src="/images/errors-inbox_screenshot-full_users-impacted.webp"
title="An image showing how to navigate users impacted"
alt="This is an image of the main errors inbox users impacted"
src="/images/errors-inbox_screenshot-full_users-impacted.webp"
/>
<figcaption>
Go to **[one.newrelic.com](https://one.newrelic.com) > APM & Services > Errors (errors inbox) > Triage**: You can find users impacted in the second column of the **Error groups** table, located beneath the **Error count** and **Error rate** time series.
</figcaption>

## Getting started [#getting-started]
## Custom attributes to track users impacted [#custom-attributes]

User impact metrics are collected automatically if your error events have an attribute identifying the end user.
For agents that don’t natively support adding a user identifier to telemetry, we recommend adding a custom attribute and following [OpenTelemetry's](/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-introduction) convention attribute for identity attributes, which is `enduser.id`. The process of sending custom attributes to New Relic is detailed [here](/docs/data-apis/custom-data/custom-events/collect-custom-attributes/#enabling-custom).
In some cases, an error event may not have attributes that identify the end user affected by that error event. You can manually add custom attributes so our agents capture user-identifying metadata at the time of ingest.

## Attribute conventions to capture users impacted [#attributes]
For cases where you need to add a custom attribute, we recommend reviewing [OpenTelemetry's attribute conventions](/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-introduction) because there are multiple common conventions for naming end user attributes.

There are multiple common conventions for naming end user attributes.
First, we'll check for `enduser.id` according to the [OpenTelemetry standard](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/span-general/#general-identity-attributes). Then we'll use the following attributes in order of priority:
For example, [OpenTelemetry standards](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/span-general/#general-identity-attributes) uses the following attributes in order of priority:

* `userId`
* `user`
* `userId`
* `user`

### Querying for users impacted [#alerts]
You can review how New Relic processes custom attributes by reading our doc about [collecting custom events](/docs/data-apis/custom-data/custom-events/collect-custom-attributes/#enabling-custom).

## Query for users impacted [#query]

The number of users impacted on an error group is recorded as a [Metric data type](/docs/data-apis/understand-data/metric-data/metric-data-type/) with the name `newrelic.error.group.userImpact`. You can use this metric with the following NRQL string:

```sql
SELECT uniqueCount(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact'
```
```sql
SELECT uniqueCount(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact'
```

The metric captures the approximate number of unique users in the time period selected. Additional attributes provided by the `userImpact` metric which can be used in a `FACET` clause are `error.group.guid`, `entity.guid`.

## Alerting on users impacted
## Alert on users impacted [#alert]

By creating an [NRQL alert condition](/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-alert-conditions/), developers can trigger <InlinePopover type="alerts"/> when the amount of users impacted by errors exceeds a threshold.

Creating this alert requires determining the [NRQL query](/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/) which measures the amount of users impacted in a way which best captures your use case.

As an example, the following NRQL query measures the amount of unique users which have been impacted by an [error group](/docs/errors-inbox/errors-inbox/#groups) coming from a specific entity:

```sql
SELECT uniqueCount(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact'
AND entity.guid='RXxCUk9XU9182nNEFQUExJQ0FLsU9OfDgzNzgwNw' FACET error.group.guid TIMESERIES
```
```sql
SELECT uniqueCount(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact'
AND entity.guid='RXxCUk9XU9182nNEFQUExJQ0FLsU9OfDgzNzgwNw' FACET error.group.guid TIMESERIES
```

Read more about using the [`uniqueCount()`](/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions/) function, [how to find the entity GUID](/docs/new-relic-solutions/new-relic-one/core-concepts/what-entity-new-relic/#find) for your entities.

Similarly, the following NRQL query measures the total number of users impacted by errors from all entities under the account in the last hour:

```sql
SELECT count(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact' SINCE 1 hour ago TIMESERIES
```sql
SELECT count(newrelic.error.group.userImpact) FROM Metric WHERE metricName='newrelic.error.group.userImpact' SINCE 1 hour ago TIMESERIES
```

Once you have decided on a NRQL query, it can be used to create a [NRQL alert condition](/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions/#create).
Expand All @@ -68,11 +69,81 @@ To improve the signal to noise ratio of your triggered alerts see [alert creatio

You can use an agent method to identify an end user. See implementation details for each agent below:

* [Java](/docs/apm/agents/java-agent/attributes/java-agent-attributes/#user-attributes)
* [Go](/docs/apm/agents/go-agent/api-guides/guide-using-go-agent-api/#user-tracking)
* [.Net](/docs/apm/agents/net-agent/net-agent-api/itransaction/#setuserid)
* [Node.js](/docs/apm/agents/nodejs-agent/api-guides/nodejs-agent-api/#setUserID)
* [Python](/docs/apm/agents/python-agent/python-agent-api/setuserid-python-agent-api/)
* [Ruby](/docs/apm/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/#user-tracking)
* [Browser](/docs/browser/new-relic-browser/browser-apis/setuserid/)
* [Mobile](/docs/data-apis/custom-data/custom-events/report-mobile-monitoring-custom-events-attributes/#track-user)
<table>
<thead>
<tr>
<th>
Agent
</th>
<th>
Method to identify an end user
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Browser
</td>
<td>
[`newrelic.setUserId(value: string|null)`](/docs/browser/new-relic-browser/browser-apis/setuserid/)
</td>
</tr>
<tr>
<td>
Go
</td>
<td>
[`txn.SetUserID("example user ID")`](/docs/apm/agents/go-agent/api-guides/guide-using-go-agent-api/#user-tracking)
</td>
</tr>
<tr>
<td>
Java
</td>
<td>
[`NewRelic.setUserId(String userId);`](/docs/apm/agents/java-agent/attributes/java-agent-attributes/#user-attributes)
</td>
</tr>
<tr>
<td>
Mobile
</td>
<td>
[`setUserId`](/docs/data-apis/custom-data/custom-events/report-mobile-monitoring-custom-events-attributes/#track-user)
</td>
</tr>
<tr>
<td>
.NET
</td>
<td>
[`SetUserId`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#setuserid)
</td>
</tr>
<tr>
<td>
Node.js
</td>
<td>
[`setUserID(id)`](https://newrelic.github.io/node-newrelic/API.html#setUserID)
</td>
</tr>
<tr>
<td>
Python
</td>
<td>
[`newrelic.agent.set_user_id(user_id)`](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/setuserid-python-agent-api)
</td>
</tr>
<tr>
<td>
Ruby
</td>
<td>
[`NewRelic::Agent.set_user_id`](/docs/apm/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/#user-tracking)
</td>
</tr>
</tbody>
</table>
Binary file modified static/images/errors-inbox_screenshot-full_users-impacted.webp
Binary file not shown.

0 comments on commit 3548347

Please sign in to comment.