elastic / elastic/apm-agent-java

Add public API method for customising captured exceptions

Offen
#853 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api enhancement
Vorherrschende Sprache
Java
Sterne
593
Forks
337
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
25

Beschreibung

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

Some exceptions may include additional information that is not part of the exception's message or type. Users currently have no means of capturing this information.

**Describe the solution you'd like**

The [exception schema](https://www.elastic.co/guide/en/apm/server/current/error-api.html) supports recording an error code (string or number), as well as arbitrary key/value attributes. We should provide an API for users to set these for captured exceptions.

Ideally users could register a callback that will be invoked for exceptions of a given type or type-hierarchy. The callback would have the opportunity to set an error code and/or attributes. For reference, the Go agent provides two top-level functions:

- https://godoc.org/go.elastic.co/apm#RegisterErrorDetailer
- https://godoc.org/go.elastic.co/apm#RegisterTypeErrorDetailer

**Describe alternatives you've considered**

The agent could also (or alternatively) provide an API for capturing an exception without immediately sending it; it would return an object that could be customised, and a have a method for sending it when done.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reviewing the exception schema linked in the issue and the referenced Go APIs, RegisterErrorDetailer and RegisterTypeErrorDetailer. Determine how a Java public API should support callbacks for exception types or hierarchies and customization of error codes and attributes; the design should also account for the alternative of customizing an exception before sending it. Done means the chosen API is specified and implemented with coverage for the supported customization behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.