getsentry / getsentry/sentry-java

@SentryCheckIn on @Scheduled methods should support monitor upsert via cron expression

Aberta
#5,467 2 comentários 0 reações 0 responsáveis Ver no GitHub
Bug Checks Java Platform: Java
Linguagem predominante
Kotlin
Estrelas
1.4k
Forks
478
Merge médio
3d 4h
PRs com merge (30d)
72

Descrição

### Integration

sentry

### Java Version

21

### Other Error Monitoring Solution

No

### Other Error Monitoring Solution Name

_No response_

### Version

8.41.0 (sentry-spring-boot-4, sentry-spring-7)

### Steps to Reproduce

I am using Spring Boot: 4.0.6

1. Annotate a @Scheduled method with @SentryCheckIn("my-monitor-slug") — do not pre-create the monitor in Sentry
2. Deploy and run the application
3. The scheduled method fires and a check-in is sent

### Expected Result

Since the method is already annotated with @Scheduled(cron = "0 0 4 * * *", zone = "Europe/Berlin"), the Spring integration has all the information needed to auto-create (upsert) the monitor on first check-in. The 6-field Spring cron should be converted to the 5-field Sentry cron format and included in the check-in payload as a MonitorConfig.

### Actual Result

Check-ins fail with the following error in Sentry:

> A check-in was sent for a monitor that does not exist.
If you meant to create a new monitor via upsert, please provide
a valid monitor configuration in the check-in payload.

Additionally, even when creating the monitor manually in the Sentry UI, the cron expression cannot be copied directly from @Scheduled — Spring uses a 6-field cron format (prepended seconds field, e.g. 0 0 4 * * *) while Sentry only accepts the standard 5-field Unix cron format (e.g. 0 4 * * *). This is an undocumented mismatch that requires the developer to know about and manually convert the expression.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Localize a integração do Spring que trata métodos com @Scheduled e @SentryCheckIn e, em seguida, inspecione como os payloads de check-in e o MonitorConfig são construídos. Reproduza o caso de monitor ausente e verifique se um cron do Spring de seis campos, como "0 0 4 * * *", é convertido para o formato de cinco campos do Sentry e incluído no upsert do monitor.

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

Avaliação

Stack de tecnologia
java, spring-boot
Domínio
backend
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
58/100

Receba novas issues na sua caixa de entrada

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