The combination @NewSpan/@SpanTag seems not fully working on interface methods - like JPA repo methods.

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.

In contrast the @Observed annotation works quite well on both - normal class methods as well as interface methods.

Tested with latest Spring Boot 3.3.1 release.

Is this topic Spring Boot related or has it been addressed to Micrometer directly?

Comment From: wilkinsona

Have you set management.observations.annotations.enabled to true? Beyond this, the annotations are a Micrometer feature and any problem with their functionality is more likely to lie there.

Comment From: janchristian-haddorp

Yes, management.observations.annotations.enabled is set to true. But as far as I can see the prop has no effect - working same way with or without.

With Spring Boot 3.3.1 is @NewSpan/@SpanTag working quite fine - if added to a class method.

It is a quite specific issue. When tracing JPA repos there is no class, just an interface.

I agree this case might be more Micrometer related. However, Spring Boot (or Spring Data) does the implementation of the interface.

Comment From: wilkinsona

Closing in favor of https://github.com/micrometer-metrics/tracing/issues/763. The annotations are handled by io.micrometer.tracing.annotation.SpanAspect and io.micrometer.tracing.annotation.SpanTagAnnotationHandler, both of which are part of Micrometer Tracing.