elastic / elastic/apm-agent-java

Add public API method for customising captured exceptions

Aperta
#853 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
api enhancement
Lingua principale
Java
Stelle
594
Fork
338
Merge medio
1g 13h
PR unite (30g)
25

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.