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

@NewSpan/@SpanTag not working on Java interface methods #763

Open
janchristian-haddorp opened this issue Jul 2, 2024 · 1 comment
Open

Comments

@janchristian-haddorp
Copy link

The combination @NewSpan/@SpanTag seems not fully working on interface methods - like Spring Data JPA repo methods (tested with latest Spring Boot 3.3.1 release).

Instead of creating a new span for the actual repo call and parent span is getting duplicated. All declared span tags are also added to parent span.

Not sure if this is really a Micrometer topic or if it is more Spring Boot related? Already asked there - first feedback was that most of the functionality comes from Micrometer.

However, I didn't find a hint on the Micrometer docs if/how @NewSpan/@SpanTag annotation can be added to Java interfaces.

@shakuzen
Copy link
Member

shakuzen commented Jul 8, 2024

Based on the tests and the corresponding documentation, it appears to be a known limitation that @NewSpan doesn't work on interfaces, though I'm not sure why that would be without looking into it more.

// In Sleuth @NewSpan and @ContinueSpan annotations would be taken into
// consideration. In Micrometer Tracing due to limitations of @Aspect
// we can't do that. The @SpanTag annotation will work well though.

We'll have to take a look and make sure the aspect-related code is in-sync between the Micrometer repo (where I believe this kind of thing works) and the tracing repo.

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

No branches or pull requests

2 participants