26 Dec 2024 11:13 AM - last edited on 30 Dec 2024 08:23 AM by MaciejNeumann
Hello,
We are working on a repo which doesn't have any RestAPI.
Could you suggest how we can get dt.trace_id, dt.span_id in logs using auto instrumentation (oneAgent)
Sample code:
@Scheduled(
timeUnit = TimeUnit.SECONDS,
fixedRateString = "#{@SchedulerProperties.syncLifecycleJobStatusInSeconds}",
initialDelayString = "#{@SchedulerProperties.syncLifecycleJobStatusInitialDelayInSeconds}")
public void sampleScheduler() {
schedulerUtils.executeService(
SchedulerServices.JOB_STATUS,
lifecycleJobStatusService::processLifecycleJobStatus);
}
Thanks in advance.
26 Dec 2024 01:00 PM
You may be able to use custom services. This allows you to monitor scheduled tasks and other non-REST methods. Please check the custom services documentation.
27 Dec 2024 12:07 PM
Hi Sia_h,
Thanks for the response.
We have tried adding custom service,
Q1. Will it enable auto instrumentation automatically?
Q2. Will it enable for all other classes also?
27 Dec 2024 12:23 PM
Since this appears to be Java code, you'll need to restart your application process for the instrumentation to take effect.
Only the classes and methods you have chosen for instrumentation. You can restrict it to certain process groups.
26 Dec 2024 05:14 PM
Hi @sivakumarp
You have an option to instrument the highlighted app through the attached references, it depends on the app technology:
Custom services:
Hoping it adds value.
BR,
Peter