Skip to content
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: Refactor Codebase to Remove Telemetry from CE #39421

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

subhrashisdas
Copy link
Member

@subhrashisdas subhrashisdas commented Feb 24, 2025

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="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13515594569
Commit: 79794e5
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Tue, 25 Feb 2025 07:48:37 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Deployed an updated server implementation offering improved security, refined request handling, and robust API route integration.
    • Introduced a centralized configuration system that streamlines settings for performance, administration, and integrations with external services.
  • Refactor / Chores

    • Simplified internal observability by streamlining tracing and span management.
    • Cleaned up legacy instrumentation to enhance system efficiency and maintainability.
    • Removed deprecated configuration properties to consolidate settings and improve clarity.

@subhrashisdas subhrashisdas self-assigned this Feb 24, 2025
@subhrashisdas subhrashisdas requested a review from a team as a code owner February 24, 2025 12:56
Copy link
Contributor

coderabbitai bot commented Feb 24, 2025

Walkthrough

This PR introduces a new server implementation in the RTS package with a dedicated CE server that mounts various API routes and enhanced logging. The EE server now imports this new CE server, and the legacy RTS server file has been removed. Additionally, multiple Java files have been updated to simplify span management by removing an unnecessary boolean parameter from tracing methods. Several metrics and observability configurations have also been removed or simplified, and new properties files have been added to consolidate server configuration.

Changes

File(s) Change Summary
app/client/packages/rts/src/ce/server.ts
app/client/packages/rts/src/ee/server.ts
app/client/packages/rts/src/server.ts
Introduces a new CE server with configurable logging and route mounting; EE server now imports the CE implementation; legacy server implementation removed.
app/client/packages/rts/src/instrumentation.ts Removed OpenTelemetry tracing and instrumentation setup code.
app/server/appsmith-git/.../FileUtilsCEImpl.java
app/server/appsmith-git/.../FileOperationsCEv2Impl.java
app/server/appsmith-server/.../UpdateLayoutServiceCEImpl.java
app/server/appsmith-server/.../OnLoadExecutablesUtilCEImpl.java
app/server/appsmith-server/.../ConsolidatedAPIServiceCEImpl.java
Removed the boolean parameter (true) from startSpan and endSpan method calls in several methods, simplifying span handling.
app/server/appsmith-interfaces/.../ObservationHelper.java
app/server/appsmith-server/.../ObservationHelperImpl.java
Updated method signatures to remove the unused isDetail boolean parameter and associated conditional logic in span management.
app/server/appsmith-server/.../ConditionalOnMicrometerMetricsEnabled.java
app/server/appsmith-server/.../CommonConfig.java
app/server/appsmith-server/.../ReactorNettyConfiguration.java
Removed the custom Micrometer metrics annotation and related conditional checks; configuration properties related to metrics and tracing details were removed or applied unconditionally.
app/server/appsmith-server/.../application-ce.properties
app/server/appsmith-server/.../application-ee.properties
app/server/appsmith-server/.../application.properties
Introduced a new CE properties file with comprehensive server settings; updated EE properties to import the CE configuration; removed numerous legacy configuration entries from the properties file.

Possibly related PRs

Suggested labels

Bug, Task

Suggested reviewers

  • ApekshaBhosale
  • rajatagrawal
  • dvj1988

Poem

In code we trust, a server reborn,
With traces clear from dusk to morn.
Metrics simplified, paths realigned,
Bugs and clutter left behind.
Cheers to changes, shining bright! 🚀🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d4f98b and 79794e5.

📒 Files selected for processing (18)
  • app/client/packages/rts/src/ce/server.ts (1 hunks)
  • app/client/packages/rts/src/ee/server.ts (1 hunks)
  • app/client/packages/rts/src/instrumentation.ts (0 hunks)
  • app/client/packages/rts/src/server.ts (1 hunks)
  • app/client/packages/rts/src/test/server.test.ts (1 hunks)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java (4 hunks)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (5 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java (0 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java (0 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/resources/application-ce.properties (1 hunks)
  • app/server/appsmith-server/src/main/resources/application-ee.properties (1 hunks)
  • app/server/appsmith-server/src/main/resources/application.properties (1 hunks)
💤 Files with no reviewable changes (3)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java
  • app/client/packages/rts/src/instrumentation.ts
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java
✅ Files skipped from review due to trivial changes (1)
  • app/client/packages/rts/src/test/server.test.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • app/client/packages/rts/src/ee/server.ts
  • app/server/appsmith-server/src/main/resources/application-ee.properties
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java
  • app/client/packages/rts/src/server.ts
  • app/client/packages/rts/src/ce/server.ts
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java
  • app/server/appsmith-server/src/main/resources/application-ce.properties
  • app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: client-build / client-build
🔇 Additional comments (1)
app/server/appsmith-server/src/main/resources/application.properties (1)

1-1: Ensure Proper External Configuration Import

The line spring.config.import=application-ee.properties has been added to shift configuration management externally, aligning with the telemetry removal in CE. Please confirm that all necessary properties previously defined in this file (like server settings, database connections, logging, and observability configurations) are now correctly maintained in the imported application-ee.properties (or cascaded via application-ce.properties if applicable).


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@subhrashisdas subhrashisdas added ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog and removed ok-to-test Required label for CI labels Feb 24, 2025
@github-actions github-actions bot removed the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Feb 24, 2025
@subhrashisdas
Copy link
Member Author

/build-deploy-preview

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13498590050.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 39421.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
app/server/appsmith-server/src/main/resources/application-ce.properties (2)

53-55: Verify telemetry settings align with CE requirements.

Telemetry is disabled by default (disable.telemetry = true), but segment key configurations are still present. Consider removing unused telemetry-related properties if they won't be used in CE.

-segment.writeKey=${APPSMITH_SEGMENT_KEY:}
-segment.ce.key = ${APPSMITH_SEGMENT_CE_KEY:}
-logging.verbose.enabled = ${APPSMITH_VERBOSE_LOGGING_ENABLED:false}

58-62: Consider removing Sentry configuration from CE.

Since this PR aims to remove telemetry from CE, consider if Sentry error tracking should also be removed.

-sentry.dsn=${APPSMITH_SERVER_SENTRY_DSN:}
-sentry.send-default-pii=true
-sentry.debug=false
-sentry.environment=${APPSMITH_SERVER_SENTRY_ENVIRONMENT:}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55a00b1 and 6d4f98b.

📒 Files selected for processing (17)
  • app/client/packages/rts/src/ce/server.ts (1 hunks)
  • app/client/packages/rts/src/ee/server.ts (1 hunks)
  • app/client/packages/rts/src/instrumentation.ts (0 hunks)
  • app/client/packages/rts/src/server.ts (1 hunks)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java (4 hunks)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (5 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java (0 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java (0 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/resources/application-ce.properties (1 hunks)
  • app/server/appsmith-server/src/main/resources/application-ee.properties (1 hunks)
  • app/server/appsmith-server/src/main/resources/application.properties (1 hunks)
💤 Files with no reviewable changes (3)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java
  • app/client/packages/rts/src/instrumentation.ts
✅ Files skipped from review due to trivial changes (5)
  • app/client/packages/rts/src/ee/server.ts
  • app/server/appsmith-server/src/main/resources/application-ee.properties
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java
  • app/client/packages/rts/src/server.ts
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java
👮 Files not reviewed due to content moderation or server errors (2)
  • app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java
🧰 Additional context used
🧠 Learnings (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (2)
Learnt from: rishabhrathod01
PR: appsmithorg/appsmith#37001
File: app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java:149-150
Timestamp: 2024-11-12T08:11:36.416Z
Learning: In the `UpdateLayoutServiceCEImpl` class in `UpdateLayoutServiceCEImpl.java`, when the `Span` starts before the `try-catch` and ends after the `try-catch` block, there's no need to add `endSpan` in a `finally` block unless `startSpan` is called within the `try` block.
Learnt from: rishabhrathod01
PR: appsmithorg/appsmith#37001
File: app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java:136-138
Timestamp: 2024-11-12T08:11:36.416Z
Learning: When a `Span` is started before a `try-catch` block and ended after it, there is no need to end the span inside the catch block.
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: server-spotless / spotless-check
  • GitHub Check: server-unit-tests / server-unit-tests
🔇 Additional comments (14)
app/client/packages/rts/src/ce/server.ts (2)

25-25: LGTM! Good security practice.

The x-powered-by header is properly disabled to prevent information disclosure.


35-36: Verify timeout values are sufficient for your use case.

The header timeout (61s) and keep-alive timeout (60s) values are set to standard values, but verify these are sufficient for your application's needs.

app/server/appsmith-server/src/main/resources/application.properties (1)

1-1: LGTM! Clean separation of configurations.

Good modularization by moving configurations to separate CE/EE property files.

app/server/appsmith-server/src/main/resources/application-ce.properties (1)

105-105: Verify secure handling of internal password.

Ensure the internal password is properly encrypted/hashed when stored and transmitted.

app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java (1)

47-49: LGTM! Simplified span management.

The removal of the isDetail parameter and associated conditional logic makes the code cleaner and more maintainable while preserving the core functionality.

Also applies to: 52-54

app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (1)

138-138: LGTM! Consistent with simplified span management.

The span management calls have been updated correctly to match the new method signatures.

Also applies to: 149-149

app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1)

231-231: LGTM! Aligned with simplified span management.

The span management calls have been updated correctly to match the new method signatures.

Also applies to: 239-239

app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java (1)

18-18: LGTM! Simplified metrics configuration.

The metrics configuration has been simplified by removing conditional checks, making it consistent with the overall telemetry removal changes.

app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java (3)

86-86: LGTM! Clean removal of telemetry details.

The changes consistently remove the isDetail parameter from span management calls across all methods while maintaining the core functionality.

Also applies to: 94-94, 106-106, 112-112, 125-125, 134-134, 292-292, 299-299


86-86: LGTM! Consistent simplification of span tracking.

The changes align with the PR objectives by removing unnecessary telemetry parameters across all methods.

Also applies to: 94-94, 106-106, 112-112, 125-125, 134-134, 292-292, 299-299


86-86: LGTM! Consistent removal of unused telemetry parameter.

The changes align with the PR objectives by simplifying telemetry-related code. The modifications are consistent across all methods, and the functionality remains unchanged.

Also applies to: 94-94, 106-106, 112-112, 125-125, 134-134, 292-292, 299-299

app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java (3)

10-12: LGTM! Clean interface simplification.

The interface has been streamlined by removing the unused isDetail parameter while maintaining backward compatibility.

Also applies to: 14-14


10-12: LGTM! Clean interface simplification.

The removal of the unused isDetail parameter streamlines the interface while maintaining functionality.

Also applies to: 14-14


10-12: LGTM! Interface simplified by removing unused parameter.

The interface changes are consistent with the implementation changes and align with the PR objectives.

Also applies to: 14-14

@subhrashisdas subhrashisdas changed the title Refactor Codebase to Remove Telemetry from CE chore: Refactor Codebase to Remove Telemetry from CE Feb 24, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Feb 24, 2025
@subhrashisdas subhrashisdas added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Feb 24, 2025
@subhrashisdas subhrashisdas enabled auto-merge (squash) February 25, 2025 04:36
@rajatagrawal rajatagrawal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Feb 25, 2025
@subhrashisdas subhrashisdas merged commit 72a8fa1 into release Feb 25, 2025
85 of 87 checks passed
@subhrashisdas subhrashisdas deleted the feature/telemetry-ce branch February 25, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants