-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Copied from @laurit's #3798 (comment)
Getting a span name from an object is also used in other instrumentations so it would be nice if someone figured out how to do this properly. The problem here is that handler could be anything. For example SpringWebFluxTestApplication when you add
@Component("greetingHandlerFunction")
@Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
static class GreetingHandlerFunction implements HandlerFunction<ServerResponse> {
private final GreetingHandler greetingHandler
GreetingHandlerFunction(GreetingHandler greetingHandler) {
this.greetingHandler = greetingHandler
}
@Override
Mono<ServerResponse> handle(ServerRequest request) {
return greetingHandler.defaultGreet()
}
}
and change the start of greetRouterFunction to
@Bean
RouterFunction<ServerResponse> greetRouterFunction(GreetingHandler greetingHandler, HandlerFunction<ServerResponse> greetingHandlerFunction) {
return route(GET("/greet"), greetingHandlerFunction
Then span name is
SpringWebFluxTestApplication$GreetingHandlerFunction$$EnhancerBySpringCGLIB$$d662c0c3.handle
When you change scope annotation to
@Scope(value = "prototype", proxyMode = ScopedProxyMode.INTERFACES)
then span name is
$Proxy119.handle
If we'd assume that handler is a spring bean we could try to unwrap it with something like spring-projects/spring-framework@efe3a35
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request