You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the problem that currently stands is that these zones aren't supported and thus cause Sentry to show an invalid monitor configuration error for new cron jobs.
Solution Brainstorm
I believe that Sentry should parse Luxon zones in the automatic cron instrumentation, before sending them to the API. While I do mention providing system (which is also the default if not provided), It's still a limitation to what can be provided. I have included a link to the documentation along with an image for such.
As for code, I make use of classes and TypeScript decorators to work with my codebase. However, if I had to compact it all down to be minimal and to show it here, this is what it would be:
The cron jobs themselves work fine and cron jobs that I had existing before explicitly setting the timezone to system also get monitored as expected. This is why I know that it's not a problem with my code but rather Sentry not parsing the Luxon zone and getting the TZ/IANA timezone from it.
Lastly, I know omitting the timezone or providing a TZ/IANA timezone will resolve the issue. I believe Sentry should still support parsing Luxon's zones.
@SerenModz21 got it, I'll raise this in the team (but tbh I'm not sure if we'll add Luxon support here). Meanwhile you'll need to parse it yourself and provide the TZ timezone for the config.
Activity
chargome commentedon Sep 27, 2024
Hi @SerenModz21! Could you provide a code snippet for an invalid configuration?
SerenModz21 commentedon Sep 27, 2024
Hi @chargome,
Here is the JSON that the Sentry UI shows when hovering over
check-in(I have just added the double quotes so that it would be valid JSON):{ "check_in_id": "2d5df2bbab174379a7766da9bb009110", "contexts": { "trace": { "trace_id": "c4efe303546241a2bbba5018c036f97b" } }, "environment": "production", "monitor_config": { "schedule": { "type": "crontab", "value": "0 */3 * * *" }, "timezone": "system" }, "monitor_slug": "update-leveling", "status": "in_progress" }As for code, I make use of classes and TypeScript decorators to work with my codebase. However, if I had to compact it all down to be minimal and to show it here, this is what it would be:
The cron jobs themselves work fine and cron jobs that I had existing before explicitly setting the timezone to
systemalso get monitored as expected. This is why I know that it's not a problem with my code but rather Sentry not parsing the Luxon zone and getting the TZ/IANA timezone from it.Lastly, I know omitting the timezone or providing a TZ/IANA timezone will resolve the issue. I believe Sentry should still support parsing Luxon's zones.
chargome commentedon Sep 27, 2024
@SerenModz21 got it, I'll raise this in the team (but tbh I'm not sure if we'll add Luxon support here). Meanwhile you'll need to parse it yourself and provide the TZ timezone for the config.