im using
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
and jaeger to collect and show spans
on screenshot only info myapp-app: get be4eed3
but it makes hard to investigate and find some particular method.
How to customize it to ${method name in controller} and add some additional info ?
You can Inject a SpanHandler bean and change the span name to the controller method name:
@Bean
SpanHandler spanHandler() {
return new SpanHandler() {
@Override
public boolean end(TraceContext traceContext, MutableSpan span, Cause cause) {
String operation = span.tags().getOrDefault("mvc.controller.method", null);
if(operation != null) {
span.name(operation);
}
return true;
}
}