chore: Added spans to health check#37980
Conversation
WalkthroughA new class 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
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/HealthSpanCE.java (1)
5-10: LGTM! Consider adding class-level documentation.The constants are well-structured and follow naming conventions. Consider adding a class-level Javadoc to document the purpose of these span constants.
+/** + * Defines span constants for health check monitoring in Community Edition. + * These constants are used to track health metrics for different components. + */ public class HealthSpanCE {app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java (1)
Line range hint
42-55: Consider documenting the timeout duration choice.Redis health check has a 3-second timeout while MongoDB has 1 second. Consider documenting the reasoning behind these different durations.
private Mono<Health> getRedisHealth() { + // Redis health check has a longer timeout (3s) due to potential network latency Function<TimeoutException, Throwable> healthTimeout = error -> {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/HealthSpan.java(1 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/HealthSpanCE.java(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/HealthCheckServiceImpl.java(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/HealthSpan.java
🔇 Additional comments (3)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/HealthCheckServiceImpl.java (1)
12-15: LGTM! Clean constructor implementation.
The addition of ObservationRegistry follows Spring's dependency injection pattern correctly.
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java (2)
27-35: LGTM! Clean field and constructor implementation.
The ObservationRegistry integration follows best practices.
53-55: LGTM! Consistent error handling and monitoring pattern.
The error handling with timeout mapping and observation setup is consistently implemented across both health checks.
Also applies to: 68-70
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced improved health check functionality for Redis and MongoDB, enhancing observability with specific health metrics. - Added constants for health monitoring, including `HEALTH`, `MONGO_HEALTH`, and `REDIS_HEALTH`. - **Bug Fixes** - Enhanced error handling for health checks, ensuring consistent logging and mapping of timeout exceptions. - **Refactor** - Updated constructor signatures to accommodate new dependencies for better service initialization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags=""
🔍 Cypress test results
Caution
If you modify the content in this section, you are likely to disrupt the CI result for your PR.
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
HEALTH,MONGO_HEALTH, andREDIS_HEALTH.Bug Fixes
Refactor