{"source":"semconv","version":"1.44.0","attribute":{"id":"db.query.parameter","type":"template[string]","stability":"development","brief":"A database query parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.","note":"If a query parameter has no name and instead is referenced only by index,\nthen `<key>` SHOULD be the 0-based index.\n\n`db.query.parameter.<key>` SHOULD match\nup with the parameterized placeholders present in `db.query.text`.\n\nIt is RECOMMENDED to capture the value as provided by the application\nwithout attempting to do any case normalization or sanitization.\n\nInstrumentations SHOULD NOT capture `db.query.parameter.<key>` by default\nsince values may contain PII or sensitive details.\nApplication operators are expected to enable specific keys depending\non their privacy and security considerations.\n\n`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.\n\nExamples:\n\n- For a query `SELECT * FROM users where username =  %s` with the parameter `\"jdoe\"`,\n  the attribute `db.query.parameter.0` SHOULD be set to `\"jdoe\"`.\n\n- For a query `\"SELECT * FROM users WHERE username = %(userName)s;` with parameter\n  `userName = \"jdoe\"`, the attribute `db.query.parameter.userName` SHOULD be set to `\"jdoe\"`.","examples":["someval","55"],"namespace":"db","definedIn":"model/db/registry.yaml","usedBy":[{"groupId":"span.azure.cosmosdb.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.cassandra.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.mariadb.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.mysql.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.oracledb.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.postgresql.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.sql_server.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"span.db.sql.client","groupType":"span","requirementLevel":"opt_in"},{"groupId":"trace.db.common.full","groupType":"attribute_group","requirementLevel":"opt_in"},{"groupId":"trace.db.common.query","groupType":"attribute_group","requirementLevel":"opt_in"},{"groupId":"trace.db.common.query_and_collection","groupType":"attribute_group","requirementLevel":"opt_in"}]},"history":[{"version":"1.30.0","publishedAt":"2025-01-24T19:11:42Z","kind":"first-seen","detail":"Already present at v1.30.0, the oldest release tracked here (experimental)."},{"version":"1.31.0","publishedAt":"2025-03-11T00:53:13Z","kind":"stability-changed","detail":"Stability label respelled from experimental to development.","severity":"informational"},{"version":"1.33.0","publishedAt":"2025-05-02T19:48:40Z","kind":"undeprecated","detail":"No longer marked deprecated.","severity":"notable"}],"replaces":[]}