newrelic / newrelic/newrelic-java-agent

Additional options for passing attributes to `noticeError`, specifically a way to pass a string for `error_class`

Open
#3,033 1 comment 0 reactions 1 assignee View on GitHub

@obenkenobi is already working on this.

Since Aug 4, 2026.

feature request
Dominant language
Java
Stars
240
Forks
170
Avg merge
3d 2h
Merged PRs (30d)
21

Description

Is your feature request related to a problem? Please describe.

Our current Java API has a number of iterations of noticeError(), each passing different attributes. You can pass an error message as a string, a boolean for ‘expected’ or ‘not expected’, a map of custom attributes, and a throwable exception object. However, it isn’t possible to fully populate an error manually, passing strings for all common attributes (error_class, error_message, stack trace, status code, etc.)

Feature Description

An update to our noticeError API to add additional attributes, such as title and all other common error attributes. This will require updates to the agent spec.

Describe Alternatives

There has been workarounds mostly creating a throwable object and adding it to the noticeError API. This approach has flaws such as not being able capture the thrown exception as it is being thrown.

Additional context

JIRA Ticket NR-201065

Priority

Nice to Have

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.