Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Spring scheduled annotation #502

Closed
gamefundas opened this issue Jan 2, 2019 · 5 comments
Closed

Add support for Spring scheduled annotation #502

gamefundas opened this issue Jan 2, 2019 · 5 comments
Milestone

Comments

@gamefundas
Copy link

gamefundas commented Jan 2, 2019

According to #416 support for @scheduled was added to spring plugin but I cant seem to find in the latest version of Glowroot.

Also adding the following didn't work for me. No errors in glowroot logs. config.json shows the instrumentation configuration appended at the end of the file.

{
"className": "",
"classAnnotation": "org.springframework.stereotype.Component",
"methodName": "",
"methodAnnotation": "org.springframework.scheduling.annotation.Scheduled",
"methodParameterTypes": [
".."
],
"captureKind": "transaction",
"transactionType": "Background",
"transactionNameTemplate": "Spring scheduled: {{this.class.simpleName}}#{{methodName}}",
"traceEntryMessageTemplate": "Spring scheduled: {{this.class.name}}.{{methodName}}()",
"timerName": "spring scheduled"
}

I must be missing something. Please advice.

@trask
Copy link
Member

trask commented Jan 3, 2019

Hi @gamefundas, thanks for posting! It looks like I never added this to glowroot.

I will correct this, but first let's figure out why the above instrumentation isn't working for you.

Can you confirm that your class is annotated with @org.springframework.stereotype.Component and that your method (in that class) is annotated with @org.springframework.scheduling.annotation.Scheduled?

And also just want to confirm that you hit "Apply changes without restart" or restarted, and there's no "Spring scheduled: ..." transactions in the left-hand sidebar under Background transactions?

Thanks,
Trask

@gamefundas
Copy link
Author

@trask my bad on the manual configuration. Was using a Service class so changing from Component to Service did the trick. But yea I guess this can be bundled along with the spring plugin and can apply to Spring component, service and event controller/rest controller.

Appreciate your quick response on this.

Thanks
Andy

@trask trask closed this as completed in 7dbf11e Jan 3, 2019
@trask trask added this to the v0.13.0 milestone Jan 3, 2019
@trask
Copy link
Member

trask commented Jan 3, 2019

Hi @gamefundas, this should be available now in the latest snapshot release glowroot-agent-0.13.0-SNAPSHOT-dist.zip.

@gamefundas
Copy link
Author

Tested, works fine. Thx @trask

@trask
Copy link
Member

trask commented Jan 4, 2019

👍

@trask trask changed the title @Scheduled jobs in Spring 5 not appearing in transaction view Add support for Spring scheduled annotation Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants