Skip to content

docs: SQL commenter and telemetry attributes#3281

Closed
AjmeraParth132 wants to merge 2 commits into
googleapis:mainfrom
AjmeraParth132:feat/docs-update
Closed

docs: SQL commenter and telemetry attributes#3281
AjmeraParth132 wants to merge 2 commits into
googleapis:mainfrom
AjmeraParth132:feat/docs-update

Conversation

@AjmeraParth132

Copy link
Copy Markdown
Contributor

Description

Documentation Update for added SQLCommenter support, and telemetry_attributes exposure for client SDKs

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

@AjmeraParth132 AjmeraParth132 requested a review from a team as a code owner May 22, 2026 22:21

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

Copy link
Copy Markdown
Contributor

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 documentation for per-call telemetry attributes in the Python SDK and a new SQL Commenter feature that propagates application context into database query logs. Feedback focused on improving technical accuracy and consistency, specifically by using 'prepending' instead of 'appending' to describe SQL comment placement and ensuring tool names follow the required snake_case convention. Additionally, suggestions were made to refine attribute descriptions with the correct metadata prefixes and project-specific terminology.

* **[Telemetry](telemetry/index.md)**: Learn how to configure logging levels and understand the core metrics and traces emitted by the Toolbox server.
* **[Export Telemetry](export_telemetry.md)**: Discover how to deploy and configure an OpenTelemetry (OTel) Collector. No newline at end of file
* **[Export Telemetry](export_telemetry.md)**: Discover how to deploy and configure an OpenTelemetry (OTel) Collector.
* **[SQL Commenter](sql_commenter.md)**: Propagate application context into database query logs by appending SQLCommenter-format comments to executed SQL statements. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the implementation and the detailed documentation, 'prepending' should be used instead of 'appending'. Additionally, tool names must be in snake_case, so 'SQL Commenter' should be 'sql_commenter'.

Suggested change
* **[SQL Commenter](sql_commenter.md)**: Propagate application context into database query logs by appending SQLCommenter-format comments to executed SQL statements.
* **[sql_commenter](sql_commenter.md)**: Propagate application context into database query logs by prepending sql_commenter-format comments to executed SQL statements.
References
  1. Tool names must be in snake_case.

type: docs
weight: 10
description: >
Propagate application context into database query logs by appending SQLCommenter-format comments to executed SQL statements.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The implementation and the example on line 57 show that the comment is prepended to the SQL statement, but the description uses the word 'appending'. For accuracy and consistency with line 51, 'prepending' should be used. Also, the tool name should be snake_case ('sql_commenter').

Suggested change
Propagate application context into database query logs by appending SQLCommenter-format comments to executed SQL statements.
Propagate application context into database query logs by prepending sql_commenter-format comments to executed SQL statements.
References
  1. Tool names must be in snake_case.

Comment on lines +10 to +11
convention that propagates application context into the database by appending a
structured comment to every SQL statement before it is executed. The comment is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the description in the frontmatter, 'prepending' is more accurate here as the comment is added to the beginning of the statement.

Suggested change
convention that propagates application context into the database by appending a
structured comment to every SQL statement before it is executed. The comment is
convention that propagates application context into the database by prepending a
structured comment to every SQL statement before it is executed. The comment is

Comment on lines +68 to +71
| `client` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.name"]` + `["client.version"]`. | Identifies the SDK or application that initiated the MCP request. |
| `client.model` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.model"]`. | The LLM model that produced the tool call. |
| `client.user.id` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.user.id"]`. | End-user identifier supplied by the client. |
| `client.agent.id` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.agent.id"]`. | Agent identifier supplied by the client. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The descriptions for the client-supplied attributes should include the params. prefix for the _meta field to be consistent with the explanation on line 75 and the MCP specification. Additionally, the description for the client attribute should clarify that the name and version are joined by a / separator, and use the project-specific term 'ADK' instead of 'SDK'.

Suggested change
| `client` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.name"]` + `["client.version"]`. | Identifies the SDK or application that initiated the MCP request. |
| `client.model` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.model"]`. | The LLM model that produced the tool call. |
| `client.user.id` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.user.id"]`. | End-user identifier supplied by the client. |
| `client.agent.id` | MCP client `_meta["dev.mcp-toolbox/telemetry"]["client.agent.id"]`. | Agent identifier supplied by the client. |
| client | MCP client params._meta["dev.mcp-toolbox/telemetry"]["client.name"] and/or ["client.version"] (joined by /). | Identifies the ADK or application that initiated the MCP request. |
| client.model | MCP client params._meta["dev.mcp-toolbox/telemetry"]["client.model"]. | The LLM model that produced the tool call. |
| client.user.id | MCP client params._meta["dev.mcp-toolbox/telemetry"]["client.user.id"]. | End-user identifier supplied by the client. |
| client.agent.id | MCP client params._meta["dev.mcp-toolbox/telemetry"]["client.agent.id"]. | Agent identifier supplied by the client. |
References
  1. Verify project-specific terminology and acronyms (such as 'ADK' for client orchestration frameworks) before assuming they are typos for more common terms (such as 'SDK').

| `--telemetry-gcp` | bool | Enable exporting directly to Google Cloud Monitoring. Default is `false`. |
| `--telemetry-otlp` | string | Enable exporting using OpenTelemetry Protocol (OTLP) to the specified endpoint (e.g. "127.0.0.1:4318"). To pass an insecure endpoint here, set environment variable `OTEL_EXPORTER_OTLP_INSECURE=true`. |
| `--telemetry-service-name` | string | Sets the value of the `service.name` resource attribute. Default is `toolbox`. |
| `--sql-commenter` | bool | Enable appending [SQLCommenter](../sql_commenter.md)-format comments to executed SQL statements. Default is `false`. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the implementation and the detailed documentation, 'prepending' should be used instead of 'appending'. Also, tool names must be in snake_case ('sql_commenter').

Suggested change
| `--sql-commenter` | bool | Enable appending [SQLCommenter](../sql_commenter.md)-format comments to executed SQL statements. Default is `false`. |
| --sql-commenter | bool | Enable prepending [sql_commenter](../sql_commenter.md)-format comments to executed SQL statements. Default is false. |
References
  1. Tool names must be in snake_case.

@anubhav756 anubhav756 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@AjmeraParth132 Thanks for the PR!

Could you PTAL at the GCA comments?

I feel the prepend vs append make sense, because we seem to be actually prepending and not appending?

I also think this comment could be relevant as well? WDYT?

@anubhav756 anubhav756 added the docs: deploy-preview Label to trigger Github Action docs preview. label May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Preview Ready!

🔎 View Preview: https://pr-3281.toolbox-docs-6xc.pages.dev

(Note: Subsequent pushes to this PR will automatically update the preview at this same URL)

@anubhav756

Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756

Copy link
Copy Markdown
Contributor

Closing this in favour of #3458

@anubhav756 anubhav756 closed this Jun 16, 2026
averikitsch pushed a commit that referenced this pull request Jun 17, 2026
## Description

Documentation update for added SQLCommenter support, and
`telemetry_attributes` exposure for client SDKs

> [!NOTE]
> This PR supercedes the previous PR
#3281 to update that with
the latest changes from
#3387.

## PR Checklist

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/mcp-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/mcp-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change


🛠️ Fixes #3061

---------

Co-authored-by: Parth Ajmera <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: deploy-preview Label to trigger Github Action docs preview.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SQL Commenter to Extend Telemetry for cloudSQL databases

3 participants