Replies: 4 comments 14 replies
-
Do you really mean ALL methods or all public methods? What about inherited methods? |
Beta Was this translation helpful? Give feedback.
-
@iNikem , I tried the @WithSpan method level but agent 0.14 does not pick a method at all. I am in spring boot application and I have Interface A and Concrete Implementation class but Agent does not seem to pick @WithSpan and does not create span. Is there anything I need to do besides annotation? |
Beta Was this translation helpful? Give feedback.
-
I have 2 springboot applications instrumented with otel javaagent library. with auto instrumentation everything works fine. Springboot A calls SB B. and B intern makes some internal DB calls. All spans and traces I could see in my jaeger backend. Now I want to inject a custom attribute to the existing trace. @RestController
public class AppAController {
@Autowired
private RestTemplate restTemplate;
@RequestMapping("/test-tracing")
@WithSpan
public String entryPointController() {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
HttpEntity<String> entity = new HttpEntity<>(headers);
// Here I am calling SB2, second mS endpoint
String response=restTemplate.exchange("http://opentelemetryappb:9082/service", HttpMethod.GET, entity, String.class).getBody();
return "Response from opentelemetry-app-b => : "+response;
} As per the above discussion, I just added @WIthSpan to this controller mehod. I understand I have to write some code to create a custom span here using OTEL library. Can some one pls help here how do I inject custom attributes to the existing spans here ? Any reference project/code ?? My springboot using embedded tomcat.. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, is this feature implemented? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@WithSpan annotation is only applied to METHOD. Can we change behavior to apply to Class so ALL methods will get instrumented it is very annoying to add for each method?
Beta Was this translation helpful? Give feedback.
All reactions