-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore(sqs): Better logs #16776
chore(sqs): Better logs #16776
Conversation
WalkthroughThe pull request introduces modifications to two components: the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
apps/services/user-notification/src/app/modules/notifications/notifications.controller.ts
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16776 +/- ##
==========================================
+ Coverage 35.69% 35.89% +0.20%
==========================================
Files 6939 6919 -20
Lines 147080 146870 -210
Branches 41832 42106 +274
==========================================
+ Hits 52497 52719 +222
+ Misses 94583 94151 -432
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 173 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 34 Total Test Services: 0 Failed, 32 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
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
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: 1
🧹 Outside diff range and nitpick comments (2)
libs/message-queue/src/lib/nest/queue.service.ts (1)
10-10
: Consider making queueName readonlyThe queueName property should be immutable since it's initialized once in the constructor and shouldn't change during the service lifecycle.
- queueName: string + readonly queueName: stringapps/services/user-notification/src/app/modules/notifications/notifications.controller.ts (1)
Line range hint
96-100
: Consider using Array.reduce for better readabilityThe args flattening logic could be more concise using Array.reduce.
- const flattenedArgs: Record<string, string> = {} - for (const arg of body.args) { - flattenedArgs[arg.key] = arg.value - } + const flattenedArgs = body.args.reduce<Record<string, string>>( + (acc, { key, value }) => ({ ...acc, [key]: value }), + {} + )
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
apps/services/user-notification/src/app/modules/notifications/notifications.controller.ts
(1 hunks)libs/message-queue/src/lib/nest/queue.service.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/services/user-notification/src/app/modules/notifications/notifications.controller.ts (2)
Pattern apps/services/**/*
: "Confirm that the code adheres to the following:
- NestJS architecture, including modules, services, and controllers.
- Dependency injection patterns and service encapsulation.
- Integration and unit testing coverage and practices."
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
libs/message-queue/src/lib/nest/queue.service.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (3)
libs/message-queue/src/lib/nest/queue.service.ts (1)
10-14
: Verify the usage of queueName property
Let's verify how this new property is being used across the codebase to ensure it meets the logging improvement objectives.
✅ Verification successful
No issues found with queueName property addition
The queueName property is appropriately used for queue creation and configuration, with proper logging in place. The property is:
- Used internally by the QueueService for queue creation and management
- Referenced in dead letter queue configuration
- Logged appropriately during queue creation via ClientService
- Not used in any problematic contexts
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for direct usage of queueName property
echo "=== Direct queueName property usage ==="
rg -t typescript "\.queueName" --no-filename
# Search for logging related to queue names
echo -e "\n=== Queue name logging patterns ==="
rg -t typescript "log.*queue.*name" --no-filename
Length of output: 344
Script:
#!/bin/bash
# Search for direct usage of queueName property without file type restriction
echo "=== Direct queueName property usage ==="
rg "\.queueName"
# Search for logging related to queue names
echo -e "\n=== Queue name logging patterns ==="
rg "log.*queue.*name"
# Find all TypeScript files that might be related to queues
echo -e "\n=== Queue-related TypeScript files ==="
fd -e ts -e tsx queue
Length of output: 132621
Script:
#!/bin/bash
# Search for queueName property usage in TypeScript files
echo "=== queueName property usage ==="
ast-grep --pattern 'queueName' -l ts
# Search for queue-related logging patterns
echo -e "\n=== Queue logging patterns ==="
rg -l "log.*queue" -g "*.ts"
# Find all queue-related TypeScript files
echo -e "\n=== Queue-related files ==="
fd -e ts -e tsx -p "queue|Queue"
Length of output: 1864
Script:
#!/bin/bash
# Check the content of queue.service.ts to understand queueName usage
echo "=== queue.service.ts content ==="
rg -A 5 -B 5 "queueName" libs/message-queue/src/lib/nest/queue.service.ts
# Check for references to queueName in logging contexts
echo -e "\n=== Queue name in logging contexts ==="
rg "log.*queueName|queueName.*log" -A 2 -B 2
# Check client.service.ts for queue name usage in logging
echo -e "\n=== Client service queue name usage ==="
rg "queue.*name" libs/message-queue/src/lib/nest/client.service.ts
Length of output: 1794
apps/services/user-notification/src/app/modules/notifications/notifications.controller.ts (2)
Line range hint 1-24
: LGTM! Follows NestJS architectural patterns
The implementation adheres to NestJS best practices with proper separation of concerns, dependency injection, and API documentation.
108-109
: LGTM! Improved log structure enhances observability
The changes improve log clarity by:
- Removing redundant args
- Adding queue context for better filtering
This aligns well with the PR objective of enhancing logging clarity.
Currently logging raw args as list of key/value objects.
Summary by CodeRabbit
New Features
queueName
to improve queue management in the service.Bug Fixes
Documentation