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.

Follow Up on: Support scheduled tasks #418

See original GitHub issue

Is your feature request related to a problem? Please describe. APM Server: 6.8.0 APM agent: 1.7.0 In elastic/apm-agent-java#418 support for the @Scheduled Annotations was added to the agent to create transactions when a scheduled task is being run. As we needed more flexibility we did not use the @Scheduled annotations and used org.springframework.scheduling.quartz.QuartzJobBean:

public class MyJob extends QuartzJobBean {
   @Override
   protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
      doJobWork();//<--Job is implemented here
   }
}

The configuration is done in the Spring XML config:

	<bean id="detailJob1" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">		
  		<property name="jobClass" value="com.mycompany.MyJob "/>
  		<property name="name" value="Job1" />
	</bean>
	<bean id="triggerJob1" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
	    <property name="jobDetail" ref="detailJob1"/>
		<property name="repeatInterval" value="60000"/>
		<property name="group" value="my-group-name" />
		<property name="startDelay" value="2500"/>
	</bean>
	<bean id="scheduler" class="rg.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false">
		<property name="startupDelay" value="30" />
	    <property name="triggers" >   
	        <list>	  
				<ref bean="triggerJob1"/>     
            </list>
	    </property> 
	</bean>

This seems to be not yet(1.7.0) supported.

Describe the solution you’d like It would be great if you could recognise calls to classes implementing org.quartz.Job (org.springframework.scheduling.quartz.QuartzJobBean implements that) and create a Transaction for each call. The transaction name should be the combination of group name and job name which can be read using context.getJobDetail().getKey().toString().

Describe alternatives you’ve considered Currently, we are creating transactions using the public API.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wolframhaussigcommented, Jun 25, 2019

it works :+1

0reactions
eyalkorencommented, Jun 25, 2019

Ahhh…, just handled that, didn’t merge yet though. Can you merge #688?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support scheduled tasks · Issue #418 · elastic/apm-agent-java
As a follow-up, creating spans for @Async annotated methods would also be cool, but requires on #145, which I'm currently working on.
Read more >
schedule task last result "0x80" - TechNet - Microsoft
After that scheduled task is giving "0x80" error. I doubt WinScp418 doesn't support Windows 2008 64bit edition. Please help. Event Type: Error
Read more >
Activity reverts from state "Started" to "Scheduled" after 1 hour
The activity (called “ManualTaskActivity”) is set up to return errResultPending . Once the workflow is started and calls ExecuteActivity(.
Read more >
Scheduled Tasks Follow-Up | ITPro Today
The most confusing thing about the Scheduled Task Wizard is the message Enter the name and password of a user. The task will...
Read more >
WASHINGTON STATE CHILD SUPPORT SCHEDULE
Child support schedule: means the standards, economic table, ... Determination of net income: The following expenses shall be.
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