-
Notifications
You must be signed in to change notification settings - Fork 19
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
(Sentinel) DAL request traffic checker #2078
Conversation
Warning Rate limit exceeded@nick-bisonai has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 40 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughWalkthroughThe recent updates enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 5
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- node/pkg/checker/dal/app.go (4 hunks)
- node/pkg/checker/dal/types.go (1 hunks)
Additional comments not posted (3)
node/pkg/checker/dal/types.go (2)
9-19
: Ensure SQL query security.The
TrafficCheckQuery
constant contains a raw SQL query. Ensure that the query is safe from SQL injection and that inputs are properly sanitized.
21-28
: Consider buffering channel sizes.The
wsChan
andwsMsgChan
channels have large buffer sizes (30000 and 10000, respectively). Ensure these sizes are appropriate for your application's expected load and memory usage.node/pkg/checker/dal/app.go (1)
94-97
: Ensure secret retrieval is reliable.The retrieval of
DAL_DB_CONNECTION_URL
from secrets is crucial. Ensure that the secrets management system is reliable and that the application can handle scenarios where the secret is temporarily unavailable.
node/pkg/checker/dal/types.go
Outdated
WsPushThreshold = 5 * time.Second | ||
TrafficCheckQuery = `select count(1) from rest_calls where | ||
timestamp > current_timestamp - INTERVAL '10 seconds' AND | ||
api_key NOT IN (SELECT key from keys WHERE description IN ('test', 'sentinel', 'orakl_reporter'))` |
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.
the hard coded values can get lost easily. I wonder if it's possible to filter these in a more dynamic way... but cannot think of a better way atm. But I guess shouldn't be a problem to leave them like this either 🤔
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.
For now const with those specified keys can be declared and used to generate query, will make an update
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.
lgtm!
left a minor comment
Description
if request count for last 10 seconds exceeds 100, sends slack message
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Deployment