-
Notifications
You must be signed in to change notification settings - Fork 10
Observability: Sentry Cron #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
97cf4a5
setting up sentry cron observability
AkhileshNegi 68cc418
using cron variable for consistency
AkhileshNegi 011b404
updated with comment
AkhileshNegi 1715ed0
add comments for readability and later reference
AkhileshNegi 9b3b80e
CI fixes
AkhileshNegi 3e1d652
Merge branch 'main' into enhancement/cron-observability
AkhileshNegi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
What are the valid value constraints for Sentry Python SDK crons MonitorConfig interval schedules with type interval value unit minute?💡 Result:
For Sentry Python SDK crons MonitorConfig with schedule type "interval", unit "minute", the "value" is a positive integer representing the number of minutes between executions. No explicit upper or lower bounds are documented in official sources, but practical constraints apply: Sentry limits check-ins to 6 per minute per monitor environment, implying a minimum practical value of 10 minutes (to allow for checkin_margin). Examples use values like 3 or 10 minutes. The value must be a non-negative integer (likely >0), as indicated by type definitions and SDK code references.
Citations:
🏁 Script executed:
Repository: ProjectTech4DevAI/kaapi-backend
Length of output: 1774
🏁 Script executed:
# Check the config file for imports and current validation patterns head -50 backend/app/core/config.pyRepository: ProjectTech4DevAI/kaapi-backend
Length of output: 1586
🏁 Script executed:
Repository: ProjectTech4DevAI/kaapi-backend
Length of output: 322
Add lower bound validation to
CRON_INTERVAL_MINUTESto prevent invalid Sentry monitor config.CRON_INTERVAL_MINUTESis environment-overridable but currently accepts any integer value. Setting it to0or negative values would create invalid Sentry monitor schedule configuration (used as interval "value" and in "max_runtime" calculation). Sentry requires positive interval values.Apply
Field(default=5, ge=1)with the necessary import addition.Suggested fix
from pydantic import ( EmailStr, + Field, HttpUrl, PostgresDsn, computed_field, model_validator, ) @@ - CRON_INTERVAL_MINUTES: int = 5 + CRON_INTERVAL_MINUTES: int = Field(default=5, ge=1)📝 Committable suggestion
🤖 Prompt for AI Agents