getsentry / getsentry/sentry-java

Improve Stacktrace truncation for StackOverflowError

Aberta
#4,818 1 comentário 0 reações 0 responsáveis Ver no GitHub
Errors Feature Java
Linguagem predominante
Kotlin
Estrelas
1.4k
Forks
478
Merge médio
3d 4h
PRs com merge (30d)
72

Descrição

### Problem Statement

We've had reports of [dropped events in the past](https://github.com/getsentry/sentry-java/issues/2988) and in response implemented a [simple limit of 100 frames](https://github.com/getsentry/sentry-java/blob/b66ccf37e6b3000d423c8162a56173ccaeba1ab9/sentry/src/main/java/io/sentry/SentryStackTraceFactory.java#L62-L65).

This limit only uses 100 frames from one side of the stacktrace, leading to potentially unhelpful information shown in our product.

### Solution Brainstorm

In the next major, we could improve the truncation to:
- only trigger on `StackOverflowError` so we do not lose information on smaller stack traces
- this way we don't butcher other stacktraces
- truncate from the middle, i.e. keep frames on both ends of the stacktrace, hopefully truncating only some of the recurring part but keeping the most important frames, see [relay](https://github.com/getsentry/relay/pull/3905/files)
- keep 500 frames from both ends of the stacktrace, i.e. 1000 total frames to be compatible with relay potentially bumping their limit

NOTE: there is a risk of running out of sync with relays implementation / truncation numbers

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece em sentry/src/main/java/io/sentry/SentryStackTraceFactory.java, especialmente pelo limite existente de 100 frames, e compare a abordagem de truncamento com o pull request referenciado do Relay. Defina o comportamento de truncamento para StackOverflowError, incluindo as contagens de frames em ambas as extremidades e as expectativas de compatibilidade com o Relay, e então verifique se o stacktrace resultante preserva ambas as extremidades sem alterar stacktraces menores que não sejam de overflow.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
devtools
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.