Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate: set span name only on method entry #3603

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jul 16, 2021

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.

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

👍

@@ -72,7 +78,6 @@ public static void startMethod(
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void endMethod(
@Advice.Thrown Throwable throwable,
@Advice.Return(typing = Assigner.Typing.DYNAMIC) Object entity,
@Advice.Origin("#m") String name,
Copy link
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.

None yet

3 participants