Implement db.stored_procedure.name stable semconv attribute#15836
Implement db.stored_procedure.name stable semconv attribute#15836trask merged 1 commit intoopen-telemetry:mainfrom
db.stored_procedure.name stable semconv attribute#15836Conversation
2f6effc to
972d306
Compare
bb54ecd to
75b2745
Compare
|
@laurit merging as I have a couple of stacked PRs on top of this, but please leave any comments and I'll address, thanks |
| /** Returns the stored procedure name for CALL operations, or null for other operations. */ | ||
| @Nullable | ||
| public String getStoredProcedureName() { | ||
| return SQL_CALL.equals(getOperationName()) ? getTarget() : null; |
There was a problem hiding this comment.
mssql uses either EXECUTE or EXEC instead of CALL https://learn.microsoft.com/en-us/sql/relational-databases/stored-procedures/execute-a-stored-procedure?view=sql-server-ver17
| } | ||
|
|
||
| StringBuilder spanName = new StringBuilder(operationName); | ||
| String mainIdentifier = collectionName != null ? collectionName : storedProcedureName; |
There was a problem hiding this comment.
It feels a bit weird to split main identifier into collection name and procedure name and then later merge them back. I guess this could be useful if the naming rules were different between collections and procedures.
One thing to note is that we aren't probably going to be able to accurately tell whether the target is a table or stored procedure as databases may support selecting from a function https://www.postgresql.org/docs/7.3/xfunc-tablefunctions.html
Part of #12608
Resolves #15718
Currently built on top of #15833