Make MongoDB query text opt-in and audit database-specific query attribute exclusions
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- java, mongodb
- Ambito
- databases, observability-sre
Direzione di ricerca
Start with MongoDbAttributesGetter.getDbQueryText() in MongoDbAttributesGetter.java and trace how the shared database extractor records it. Compare agent and library instrumentation for synchronous and Reactive Streams clients, then audit the listed database exclusions against Java instrumentation. Check the MongoDB conformance scenario and document the opt-in configuration and migration; done means excluded query attributes default off where requested, other databases retain convention-appropriate behavior, and MongoDB summary generation remains absent.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
MongoDB instrumentation records the sanitized BSON command as db.query.text by default. The MongoDB-specific semantic conventions exclude both db.query.text and db.query.summary from the inherited database client span attributes.
Track making MongoDB query capture explicitly opt-in, and audit other database instrumentations for the same default-capture mismatch. The existing sanitization option controls whether values are masked, not whether query text is collected.
Steps to reproduce
Run a MongoDB scenario from open-telemetry/semantic-conventions-conformance#136, with stable database semantic conventions enabled as configured by the scenario:
otel-conformance scenarios/database/java/mongodb/sync/opentelemetry-javaagent
Inspect a find client span. It contains db.query.text with the sanitized command, without an explicit query-capture opt-in. The linked PR also covers library instrumentation and the Reactive Streams driver.
Expected behavior
MongoDB should omit the excluded query attributes by default. Preserve its existing query-text capture through explicit opt-in, with sanitization enabled by default when capture is enabled. Apply the behavior consistently to agent and library instrumentation, including synchronous and Reactive Streams clients.
Audit the database-specific exclusions below against Java instrumentation. Keep query text enabled where the applicable conventions recommend it and their sanitization conditions are met. Do not apply a blanket default-off policy to all databases. Document the configuration and migration from the existing MongoDB default.
Actual behavior
MongoDbAttributesGetter.getDbQueryText() returns the sanitized command, and the shared database extractor records it unconditionally. MongoDB currently leaves db.query.summary unset; the audit should preserve that default rather than introduce summary generation.
Javaagent or library instrumentation version
2.33.1, as reported by the linked conformance PR. Default query-text capture is also present in source at e4f28d52cd0d26b3619de8c61b2ebc3ce9e831f6.
Environment
JDK: N/A for the source and semantic-convention audit.
OS: N/A for the source and semantic-convention audit.
MongoDB synchronous and Reactive Streams drivers, using Javaagent or opentelemetry-mongo-3.1 library instrumentation. The conformance scenarios enable stable database semantic conventions.
Additional context
Raised by this review discussion on open-telemetry/semantic-conventions-conformance#136. That PR no longer requires exact serialized command text.
An audit of semantic conventions v1.45.0 found these explicit exclusions from database client span refinements:
| Database | db.query.text |
db.query.summary |
|---|---|---|
| MongoDB | Excluded | Excluded |
| CouchDB | Excluded | Excluded |
| HBase | Excluded | Excluded |
| Redis | Retained | Excluded |
| Azure Cosmos DB | Retained | Excluded |
| Elasticsearch | Retained | Excluded |
Cassandra, generic SQL, MariaDB, MySQL, PostgreSQL, Oracle Database, and Microsoft SQL Server do not remove either query attribute in their span refinements. DynamoDB uses separate AWS client span refinements rather than inheriting the general database client span model.
unref removes an attribute from the system-specific convention; it is not itself an explicit MUST NOT emit it. This issue tracks the requested opt-in default for excluded attributes, separately from the general query-text guidance, which recommends parameterized or adequately sanitized query text where applicable.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
- Lingua principale
- Java
- Stelle
- 2.7k
- Fork
- 1.2k
- Merge medio
- 1g 38m
- PR unite (30g)
- 337
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-telemetry/opentelemetry-java-instrumentation
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
open-telemetry/opentelemetry-java-instrumentation#21429 ·
I maintainer di solito rispondono entro 1 giorno
-
java-http-client: context injection is silently dropped when the request already has a propagation header in a different case (e.g. `Traceparent`)Forse già presa @mymindinsane l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-java-instrumentation#21422 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Decide and document how changelog entries identify affected librariesForse già presa @trask l’ha presa 26 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
open-telemetry/opentelemetry-java-instrumentation#20899 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
open-telemetry/opentelemetry-java-instrumentation#20107 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
influxdb-2.4: capture db.operation.batch.size for BatchPoints writesForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
open-telemetry/opentelemetry-java-instrumentation#19264 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di open-telemetry/opentelemetry-java-instrumentation
Issue simili
-
hermes-queue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
chrisalunlloyd2-sudo/mindpalace#430 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
unitycatalog/unitycatalog#2363 ·
I maintainer di solito rispondono entro 1 giorno
-
area: editor P3 type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
halisonworks/mod-codeling#290 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
CVE-2026-63402 i18nextApertaarea/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni