Skip to content

feat: setup SQLCommenter and allow client metadata #3064

Open
AjmeraParth132 wants to merge 1 commit intogoogleapis:mainfrom
AjmeraParth132:feat/sql-commenter
Open

feat: setup SQLCommenter and allow client metadata #3064
AjmeraParth132 wants to merge 1 commit intogoogleapis:mainfrom
AjmeraParth132:feat/sql-commenter

Conversation

@AjmeraParth132
Copy link
Copy Markdown
Contributor

Description

Currently, there's no way to correlate a SQL query back to the LLM tool invocation, client, or distributed trace that triggered it. The observability chain breaks at the Toolbox server boundary.

PR Checklist

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #3061

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces SQLCommenter support to the MCP Toolbox, allowing SQL statements to be annotated with metadata such as trace information, client attributes, and server versions. The changes include a new sqlcommenter package, updates to various database source implementations to append these comments, and new configuration flags to enable the feature. A critical issue was identified in the sqlcommenter implementation where the comment format and separators did not align with the standard SQLCommenter specification or the provided unit tests; specifically, it used colons and semicolons instead of the required equals signs and commas.

Comment thread internal/sources/sqlcommenter/sqlcommenter.go Outdated
Comment thread internal/sources/sqlcommenter/sqlcommenter_test.go Outdated
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@AjmeraParth132 AjmeraParth132 changed the title feat: Set Up SQL Commenter, w Client Data read feat: setup SQLCommenter and allow client metadata Apr 15, 2026
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SQL Commenter to Extend Telemetry for cloudSQL databases

3 participants