Skip to content

docs(sdk): add database query params to data-collection spec#18570

Open
ericapisani wants to merge 6 commits into
masterfrom
ep/data-collection-db
Open

docs(sdk): add database query params to data-collection spec#18570
ericapisani wants to merge 6 commits into
masterfrom
ep/data-collection-db

Conversation

@ericapisani

@ericapisani ericapisani commented Jun 26, 2026

Copy link
Copy Markdown
Member

Adds database.queryParams as a new configuration option to the SDK data-collection spec. This covers the ability for SDKs to include or omit parameters passed to database queries, consistent with how queryParams works for HTTP and how genAI inputs/outputs are handled.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Fixes PY-2562

Within the Python SDK, the existing `send_default_pii` gates the inclusion
of database parameters in spans and events for integrations such as `pymongo`,
`redis`, and `clickhouse_driver`.

There were previously no parameters within the spec that allowed for
control over the inclusion or filtering of these values, so introducing
these changes to close that gap.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Jun 29, 2026 4:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Preview Jun 29, 2026 4:03pm

Request Review

@github-actions github-actions Bot added the sdk-develop-docs PRs touching develop-docs/sdk label Jun 26, 2026
@ericapisani ericapisani requested review from cleptric and s1gr1d June 26, 2026 18:58
@linear-code

linear-code Bot commented Jun 26, 2026

Copy link
Copy Markdown

PY-2562

Comment on lines +653 to +655
database: {
queryParams: false,
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we add this, this should also be a required part of the commented out docs/on-boarding snippet. We should add a section to this page for this, currently it's userInfo, httpBodies and now this.

For naming, databaseQueryParams might be better, not sure we need the namespace.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For naming, databaseQueryParams might be better, not sure we need the namespace.

I considered something like this but opted for the dict to make it easier to extend in the future should we need to for whatever reason - I didn't want to take the chance and require us to introduce an unnecessary breaking change if something needed to e added when we could've done this at the beginning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@cleptric could you give me some more clarification on which sections you're referring to in:

If we add this, this should also be a required part of the commented out docs/on-boarding snippet.

The database setting has been added the example code snippets already, and in terms of other potential sections - there's a couple possible ones that I think you're referring to and I want to make sure I'm not missing anything/updating the right spots. The ones that I think you're referring to are:

  • Setup Snippet Opt-out Comment (include database option)
  • Creating a new section alongside the "Request and Response Bodies", "Cookies and Query Params", etc. that explains what's captured by the database setting.

Is there anything else?

| `queryParams` | Key-value collection | `{ mode: "denyList" }` | 0.1.0 | Collect URL query parameters. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `graphql` | `{ document?, variables? }` | Both `true` | 0.5.0 | For `document`: Collect the GraphQL document. <br /><br /> For `variables`: Collect the variables that are passed to GraphQL operations. |
| `genAI` | `{ inputs?, outputs? }` | Both `true` | 0.1.0 | For `inputs`: Include the content of generative AI inputs (e.g. prompt text, tool call arguments). <br /><br /> For `outputs`: Include the content of generative AI outputs (e.g. completion text, tool call results). Metadata such as model name and token counts is always collected regardless of these settings. |
| `database` | `{ queryParams? }` | `true` | 0.6.0 | Include parameters/arguments passed to database queries. Setting this to false will either omit the value altogether, or replace the value with '[Filtered]'. |

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.

Bug: The default value for the database option is documented as true, which is inconsistent and ambiguous compared to other nested options like graphql.
Severity: LOW

Suggested Fix

Update the default value column for the database option to be consistent with other nested options. For example, change true to queryParams: true to clarify the default applies to the nested field. Also, clarify the description to explicitly mention queryParams.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: develop-docs/sdk/foundations/client/data-collection/index.mdx#L561

Potential issue: In the options table, the `database` option's default value is
documented as `true`. This is ambiguous and inconsistent with how similar nested options
like `graphql` and `genAI` are documented, which use `Both true` to clarify that their
nested properties default to `true`. This could lead SDK implementors to misinterpret
the API. The accompanying description, "Setting this to false...", is also unclear about
whether "this" refers to the parent `database` object or the nested `queryParams` field.
While the pseudocode section is correct, the table should be self-consistent to avoid
confusion.

Did we get this right? 👍 / 👎 to inform future reviews.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d1e4b2b. Configure here.

| `queryParams` | Key-value collection | `{ mode: "denyList" }` | 0.1.0 | Collect URL query parameters. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `graphql` | `{ document?, variables? }` | Both `true` | 0.5.0 | For `document`: Collect the GraphQL document. <br /><br /> For `variables`: Collect the variables that are passed to GraphQL operations. |
| `genAI` | `{ inputs?, outputs? }` | Both `true` | 0.1.0 | For `inputs`: Include the content of generative AI inputs (e.g. prompt text, tool call arguments). <br /><br /> For `outputs`: Include the content of generative AI outputs (e.g. completion text, tool call results). Metadata such as model name and token counts is always collected regardless of these settings. |
| `database` | `{ queryParams? }` | `true` | 0.6.0 | Include parameters/arguments passed to database queries. Setting this to false will either omit the value altogether, or replace the value with '[Filtered]'. |

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.

Boolean false behavior contradicts spec

Medium Severity

The new database option description says queryParams: false may omit values or replace them with [Filtered], but the Boolean Options section defines false as not collecting the category at all. SDKs can implement incompatible opt-out behavior for the same setting.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d1e4b2b. Configure here.

| `queryParams` | Key-value collection | `{ mode: "denyList" }` | 0.1.0 | Collect URL query parameters. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `graphql` | `{ document?, variables? }` | Both `true` | 0.5.0 | For `document`: Collect the GraphQL document. <br /><br /> For `variables`: Collect the variables that are passed to GraphQL operations. |
| `genAI` | `{ inputs?, outputs? }` | Both `true` | 0.1.0 | For `inputs`: Include the content of generative AI inputs (e.g. prompt text, tool call arguments). <br /><br /> For `outputs`: Include the content of generative AI outputs (e.g. completion text, tool call results). Metadata such as model name and token counts is always collected regardless of these settings. |
| `database` | `{ queryParams? }` | `true` | 0.6.0 | Include parameters/arguments passed to database queries. Setting this to false will either omit the value altogether, or replace the value with '[Filtered]'. |

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.

Bug: The description for database.queryParams when false is ambiguous, stating it could either omit the value or replace it with '[Filtered]', contradicting the spec's definition for boolean options.
Severity: MEDIUM

Suggested Fix

Update the description for database.queryParams when set to false to align with the standard behavior for boolean options. It should clearly state that setting it to false means the data category will not be collected, removing the 'either omit... or replace' ambiguity.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: develop-docs/sdk/foundations/client/data-collection/index.mdx#L561

Potential issue: The documentation for `database.queryParams` provides an ambiguous
definition for when the option is set to `false`. It states the value will be 'either
omit the value altogether, or replace the value with '[Filtered]''. This conflicts with
the general specification for boolean options, which dictates that `false` should mean
'Do not collect this data category'. This ambiguity could lead to different SDKs
implementing the feature inconsistently, defeating the purpose of a unified
specification.

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

Labels

sdk-develop-docs PRs touching develop-docs/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants