Skip to content

Hibernate: set span name only on method entry - #3603

Merged
iNikem merged 1 commit into
open-telemetry:mainfrom
laurit:hibernate-entity-name
Jul 26, 2021
Merged

Hibernate: set span name only on method entry#3603
iNikem merged 1 commit into
open-telemetry:mainfrom
laurit:hibernate-entity-name

Conversation

@laurit

@laurit laurit commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

This pr removes updating span name on method exit, we don't need to inspect the return value of method to know what entity is being operated on. Also instead of trying to figure out whether the first argument of a method is String representing requested entity name or an Object representing entity make things a bit more explicit by using method descriptor. If we know that the first argument of method is a String use it as entity name, if it is an Object then it must be an entity and ask hibernate what its name is.

@trask trask left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

public static void endMethod(
@Advice.Thrown Throwable throwable,
@Advice.Return(typing = Assigner.Typing.DYNAMIC) Object entity,
@Advice.Origin("#m") String name,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@Advice.Origin("#m") String name,

@iNikem
iNikem merged commit 3555c25 into open-telemetry:main Jul 26, 2021
@laurit
laurit deleted the hibernate-entity-name branch August 24, 2021 07:50
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.

3 participants