Skip to content

Conversation

@trask
Copy link
Member

@trask trask commented Jan 11, 2026

Part of #12608
Resolves #15718

Currently built on top of #15833

@trask trask force-pushed the db-stored-proc-name branch 3 times, most recently from 2f6effc to 972d306 Compare January 12, 2026 01:07
@trask trask force-pushed the db-stored-proc-name branch from bb54ecd to 75b2745 Compare January 12, 2026 18:35
@trask trask marked this pull request as ready for review January 12, 2026 19:16
@trask trask requested a review from a team as a code owner January 12, 2026 19:16
@trask
Copy link
Member Author

trask commented Jan 13, 2026

@laurit merging as I have a couple of stacked PRs on top of this, but please leave any comments and I'll address, thanks

@trask trask merged commit b5a0b56 into open-telemetry:main Jan 13, 2026
85 checks passed
@trask trask deleted the db-stored-proc-name branch January 13, 2026 01:02
/** Returns the stored procedure name for CALL operations, or null for other operations. */
@Nullable
public String getStoredProcedureName() {
return SQL_CALL.equals(getOperationName()) ? getTarget() : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

}

StringBuilder spanName = new StringBuilder(operationName);
String mainIdentifier = collectionName != null ? collectionName : storedProcedureName;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement db.stored_procedure.name attribute

3 participants