-
Notifications
You must be signed in to change notification settings - Fork 324
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
First "MVP" support for Spring @Scheduled / EJB @Schedule annotation #569
First "MVP" support for Spring @Scheduled / EJB @Schedule annotation #569
Conversation
This is a very basic implementation of elastic#418
if (active == null) { | ||
transaction = tracer.startTransaction(TraceContext.asRoot(), null, clazz.getClassLoader()) | ||
.withName(signature) | ||
.withType("scheduled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a good choice for "type"? I did not find anything besided "request" in the current code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
A few minor comments.
...co/elastic/apm/agent/spring/scheduled/SpringScheduledTransactionNameInstrumentationTest.java
Outdated
Show resolved
Hide resolved
...co/elastic/apm/agent/spring/scheduled/SpringScheduledTransactionNameInstrumentationTest.java
Outdated
Show resolved
Hide resolved
...co/elastic/apm/agent/spring/scheduled/SpringScheduledTransactionNameInstrumentationTest.java
Outdated
Show resolved
Hide resolved
...co/elastic/apm/agent/spring/scheduled/SpringScheduledTransactionNameInstrumentationTest.java
Outdated
Show resolved
Hide resolved
...ava/co/elastic/apm/agent/spring/scheduled/SpringScheduledTransactionNameInstrumentation.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #569 +/- ##
============================================
- Coverage 64.63% 62.09% -2.54%
Complexity 68 68
============================================
Files 187 186 -1
Lines 7524 7029 -495
Branches 927 812 -115
============================================
- Hits 4863 4365 -498
+ Misses 2402 2388 -14
- Partials 259 276 +17
Continue to review full report at Codecov.
|
I'm not sure why, but it seems to make the integration tests fail. |
Hmm the TomcatIT failed first and now JBossIT failed.. Are they known to be flaky? |
Tests are green now, seems to be flakiness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! ❤️
Can the container annotations Schedules
come alone, or do they always contain several Schedule
annotations? If they are only used as containers- can we overlook them?
Either way, if you can add a test for each of the Schedules
annotation, that would be great.
Thanks!
...main/java/co/elastic/apm/agent/spring/scheduled/ScheduledTransactionNameInstrumentation.java
Outdated
Show resolved
Hide resolved
I wrote test for the repeatable / container annotations and it turned out that we actually need to declare them in the method matcher. |
That is because the compiler turns
into
|
This is a very basic implementation of #418
This has been tested in a unit test and with a local application against an elastic cloud cluster.
I am happy to iterate on this further.