Skip to content

Commit

Permalink
Merge pull request #13323 from brnhensley/patch-6
Browse files Browse the repository at this point in the history
Update minimum agent versions for new api params/methods
  • Loading branch information
zuluecho9 committed Jun 1, 2023
2 parents af68401 + b665390 commit fb4a6dd
Showing 1 changed file with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,15 +784,19 @@ New Relic's Node.js agent includes additional API calls.
`customAttributes` is an optional object of any custom attributes to be displayed in the New Relic UI.

`expected` is an optional boolean to classify the error as an error you expect. If an error collected with `noticeError` is `expected`, it will be collected and reported, but will not affect `Apdex` or error rate metrics. By default, `expected` is `false`.

<Callout variant="important">
The `expected` parameter requires [Node.js agent version 9.12.1](/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-9-12-1) or higher.
</Callout>

**Example:**
```js
try {
performSomeTask();
} catch (err) {
} catch(err) {
newrelic.noticeError(
err,
{extraInformation: "error already handled in the application"},
{ extraInformation: "error already handled in the application" },
true
);
}
Expand All @@ -813,14 +817,18 @@ New Relic's Node.js agent includes additional API calls.

Provided functions must return a string, and receive an object as an argument. The object contains information related to the error that occurred, and has the following format:

```
<Callout variant="important">
Use of `setErrorGroupCallback` requires [Node.js agent version 9.14.0](/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-9-14-0/) or higher.
</Callout>

```js
{
customAttributes: object,
'request.uri': string,
'http.statusCode': string,
'http.method': string,
error: Error,
'error.expected': boolean
"customAttributes": object,
"request.uri": string,
"http.statusCode": string,
"http.method": string,
"error": Error,
"error.expected": boolean
}
```

Expand Down Expand Up @@ -857,6 +865,10 @@ New Relic's Node.js agent includes additional API calls.
newrelic.setUserID(string)
```
This method gives you a way to associate a unique identifier with a transaction event, transaction trace and errors within transaction. A new property, `enduser.id`, will be added to the error and reported to errors inbox.

<Callout variant="important">
The `setUserID` API requires [Node.js agent version 9.13.0](/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-9-13-0/) or higher.
</Callout>

</Collapser>

Expand Down

0 comments on commit fb4a6dd

Please sign in to comment.