Clarify `db.query.summary` for stored procedures (#2218)

Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
This commit is contained in:
Trask Stalnaker 2025-05-02 12:28:08 -07:00 committed by GitHub
parent 899a326c3e
commit 7f6471212c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 3 deletions

22
.chloggen/2218.yaml Normal file
View File

@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: db
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Clarify `db.query.summary` for stored procedures
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [ 2218 ]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

View File

@ -449,8 +449,19 @@ name or target).
the corresponding `db.query.summary` is `SELECT "song list" 'artists'`.
- Stored procedure is executed using convenience API such as one available in
[Microsoft.Data.SqlClient](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlcommand.commandtype):
- Stored procedure is executed using a convenience API such as one available in
[JDBC](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#prepareCall-java.lang.String-):
```java
connection.prepareCall("{call some_stored_procedure}");
```
the corresponding `db.query.summary` is `call some_stored_procedure`,
`db.query.text` is not populated. Note that `CALL` is the SQL standard
keyword to invoke a stored procedure.
- Stored procedure is executed using Microsoft SQL Server driver's convenience API
[Microsoft.Data.SqlClient](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlcommand.commandtype):
```csharp
var command = new SqlCommand();
@ -458,7 +469,10 @@ name or target).
command.CommandText = "some_stored_procedure";
```
the corresponding `db.query.summary` is `EXECUTE some_stored_procedure`, `db.query.text` is not populated.
the corresponding `db.query.summary` is `EXECUTE some_stored_procedure`,
`db.query.text` is not populated. Note that Microsoft SQL Server does not
support the SQL Standard `CALL` keyword, but uses instead `EXECUTE`
to invoke a stored procedure.
Semantic conventions for individual database systems or specialized instrumentations
MAY specify a different `db.query.summary` format as long as produced summary remains