-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: Add organizationId
in MDC logs to ease debugging in multi-org setup
#40211
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
Conversation
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Request
participant MDCFilter
participant UserOrgHelper as UserOrganizationHelper
participant MDCContext as MDC Logging Context
Request->>MDCFilter: Incoming HTTP Request
MDCFilter->>UserOrgHelper: getCurrentUserOrganizationId()
UserOrgHelper-->>MDCFilter: organizationId
MDCFilter->>MDCFilter: Combine principal & organizationId (zipWith)
MDCFilter->>MDCContext: addRequestHeadersToContext(request, context, user, organizationId)
MDCContext-->>MDCFilter: Updated logging context
MDCFilter->>Request: Continue filter chain
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Graph Analysis (1)app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (6)
🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java
(5 hunks)app/server/appsmith-server/src/main/resources/application-ce.properties
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/constants/ce/FieldNameCE.java (1)
FieldNameCE
(3-212)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: server-spotless / spotless-check
- GitHub Check: server-unit-tests / server-unit-tests
🔇 Additional comments (6)
app/server/appsmith-server/src/main/resources/application-ce.properties (1)
35-35
: Logging pattern updated to include organization IDThe update adds the organization ID to the logging pattern, which will enhance debugging in multi-organization environments. This change aligns well with the PR objectives.
app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java (5)
5-5
: Added UserOrganizationHelper dependencyThis import is necessary for retrieving the organization ID.
21-21
: Added ORGANIZATION_ID constant importAppropriate use of a constant for the organization ID field name from FieldNameCE.
32-32
: Added constructor injection for UserOrganizationHelperThe dependency is properly injected via constructor, following Spring best practices.
Also applies to: 44-46
68-68
: Method signature updated to include organizationIdThe method signature has been properly updated to accept the organization ID parameter.
77-79
: Added organization ID to context mapThe organization ID is correctly added to the context map with null check.
Description
Sample log:
/test Sanity
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14387773115
Commit: e345a8d
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Thu, 10 Apr 2025 19:11:45 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit