Skip to content

chore: track sql plugins performance#39903

Closed
vsvamsi1 wants to merge 1 commit intoreleasefrom
test66
Closed

chore: track sql plugins performance#39903
vsvamsi1 wants to merge 1 commit intoreleasefrom
test66

Conversation

@vsvamsi1
Copy link
Contributor

@vsvamsi1 vsvamsi1 commented Mar 25, 2025

Description

Export metrics of sql plugin's performance.

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.All"

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14057952601
Commit: 1654ffb
Cypress dashboard.
Tags: @tag.All
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Tue, 25 Mar 2025 11:14:05 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced monitoring for SQL queries, adding improved tracking for query execution and result processing in database integrations.
  • Chores
    • Made internal updates to support the new observability mechanisms.
  • Tests
    • Updated tests to reflect the improved monitoring setup across database plugins.

These improvements help improve performance tracking and diagnostic insights for database operations.

@vsvamsi1 vsvamsi1 self-assigned this Mar 25, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request introduces new constants for action spans in the ActionSpanCE class and extends the observation capabilities in both the MSSQL and Postgres plugins. The changes update several constructors and execution methods to include an extra ObservationHelper parameter, enabling the creation of spans around SQL query execution and result deserialization. Test files are also updated accordingly to provide the new helper during plugin initialization.

Changes

File(s) Change summary
app/server/appsmith-interfaces/.../ActionSpanCE.java Added two new constants: EXECUTE_QUERY and DESERIALIZE_RESULT to define specific action spans.
app/server/appsmith-plugins/mssqlPlugin/.../MssqlPlugin.java Updated MssqlPluginExecutor constructor to accept an ObservationHelper and inserted span creation/termination steps around query execution and result processing.
app/server/appsmith-plugins/postgresPlugin/.../PostgresPlugin.java Modified PostgresPluginExecutor constructor to include ObservationHelper; added span creation for executing queries and deserializing results; updated imports accordingly.
app/server/appsmith-plugins/postgresPlugin/.../(PostgresDatasourceValidationTest.java, PostgresPluginTest.java) Updated test setups to pass ObservationHelper.NOOP when constructing instances of PostgresPluginExecutor.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant Executor as PluginExecutor
    participant ObsHelper as ObservationHelper
    participant DB as Database

    Client->>Executor: executeCommon()
    Executor->>ObsHelper: startSpan("executeQuery")
    Executor->>DB: execute SQL query
    DB-->>Executor: return query result
    Executor->>ObsHelper: endSpan("executeQuery")
    Executor->>ObsHelper: startSpan("deserializeResult")
    Executor->>DB: process results
    DB-->>Executor: return processed data
    Executor->>ObsHelper: endSpan("deserializeResult")
Loading

Possibly related PRs

Suggested labels

Task, skip-changelog, Query & JS Pod, Integrations Product, Integrations Pod General, ok-to-test, Integrations Pod

Suggested reviewers

  • ApekshaBhosale
  • rajatagrawal
  • sneha122

Poem

In the depths of our code, a fresh tune rings,
Constants and spans now lead the new flings.
Observers join the dance with a trace so neat,
Guiding SQL journeys with every beat.
Code sings in harmony, agile and fleet!


🪧 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@vsvamsi1 vsvamsi1 requested a review from rajatagrawal March 25, 2025 09:54
@vsvamsi1 vsvamsi1 marked this pull request as draft March 25, 2025 09:54
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Mar 25, 2025
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Mar 25, 2025
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Mar 25, 2025
@vsvamsi1 vsvamsi1 closed this Mar 25, 2025
@vsvamsi1 vsvamsi1 deleted the test66 branch March 25, 2025 11:17
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.

1 participant