question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize naming of span for Spring MVC

See original GitHub issue

The span name for a RestController is the name of the method. It would be nice to be able to configure it to something like ClassName#methodName. The name would help to distinguish the same method name but from different controllers.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zouyxcommented, Aug 27, 2019

@chengchen use code to init strategy as below

@Bean
    public List<HandlerInterceptorSpanDecorator> initSpanDecorators() {
        return Arrays.asList(HandlerInterceptorSpanDecorator.STANDARD_LOGS,
                HandlerInterceptorSpanDecorator.HANDLER_SPRING_WEB_METHOD_OPERATION_NAME);
    }
1reaction
wuyupengwoainicommented, Aug 26, 2019

@chengchen I got it.We should provided the better HandlerInterceptorSpanDecorator as default span name naming strategy. This PR has provided the RequestMapping naming strategy. https://github.com/opentracing-contrib/java-spring-web/pull/115

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the Span Name for a REST Endpoint with ...
You can modify the Span using a SpanHandler : see the docs or inject the tracer, get the current span and change the...
Read more >
Using Spring Cloud Sleuth
1. Span Lifecycle with Spring Cloud Sleuth's API · start: When you start a span, its name is assigned and the start timestamp...
Read more >
[Custom Tags] Dynamic Variable Name // Spring MVC
I am having a problem with a tag, i try to make a dynamic select tag that is reuseable, the problem is that...
Read more >
Add possibility to set the operation name after the span has ...
Span name is always required, but if it needs to be set later you can pass empty string to the builder.
Read more >
Custom Instrumentation for Spring Boot | Sentry Documentation
@SentrySpan can be configured with custom description property. If not defined, operation will be resolved from the class, and the method name. @SentrySpan...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found