Commit Graph

134 Commits

Author SHA1 Message Date
Tyler Benson 6414de82d9 Add support for HystrixObservableCommand
This change is slightly breaking for existing hystrixCommand code since the resource name changes from run->execute and getFallback->fallback.  The fallback span is also now a child of the execute span.
2019-04-29 12:04:27 -07:00
Tyler Benson 179b9b69cb Upgrade Byte Buddy to 1.9.12
and a few other minor code changes.
2019-04-25 10:36:35 -07:00
Tyler Benson e74941a4d5 Merge branch 'master' into twilio 2019-04-16 17:44:36 -07:00
Daryl Robbins e3d97b0984 WIP Twilio SDK Instrumentation
Missed Gradle file

Updates to handle async calls, which have broken all tests

Fixed instrumentation and augmented tests
2019-04-16 13:46:43 -07:00
Nikolay Martynov c104be1fa7 Add compile dep on scala to make Idea happy 2019-04-03 13:59:25 -04:00
Nikolay Martynov 65cb8af873 Fix tests that verify that cancelling job cancels continuation 2019-02-28 18:44:39 -05:00
Tyler Benson 50279d64fe Span type should only be an attribute and not inherited
Previously we were inheriting from the parent and also often setting as a tag.

Apply default span assertion to verify the spanType is being checked properly. (Include error state too.)
2019-02-28 12:39:51 -08:00
Tyler Benson d53d3fe4c8 Add @Retry to tests that fail randomly in CI.
Should eventually revisit this to try and remove them.

Latest failure was on:
```
at ExecutorInstrumentationTest.#poolImpl '#name' reports after canceled jobs(ExecutorInstrumentationTest.groovy:202)
```
2019-02-27 20:56:47 -08:00
Tyler Benson c46909e59f Migrate JDBC instrumentation to Decorator 2019-02-26 11:16:35 -08:00
Nikolay Martynov bae2d7dde8 Allow non-wrapped tasks in disabled executors
Some executors cannot handle tasks that have been wrapped into
`{Runnable,Callable}Wrapper` because they require certain subclass of
`{Callable,Runnable}` in order to work. We have a test that
effectively disables instrumentation for such executors.

This change makes sure that tasks that do not need to be
wrapped (which essentially means anything that is not lambda) still
get traced in such executors. One notable example of affected executor
type is `ScheduledThreadPoolExecutor`.
2019-02-11 11:47:34 -05:00
Nikolay Martynov 3a0a471dd5 Close future's continuation on cancel even if future itself was not cancelled 2019-02-08 20:13:32 -05:00
Nikolay Martynov f8aed7aec7 Provide seprate instrumentation names for Akka and Scala ForkJoin instrumentations 2019-01-28 11:29:59 -05:00
Nikolay Martynov f7844f763c Instrument Akka and Scala ForkJoinTask and ForkJoinPool 2019-01-25 16:15:48 -05:00
Nikolay Martynov 6ab5b121f5 Handle ForkJoinTask in concurrent instrumentation 2019-01-24 17:28:00 -05:00
Nikolay Martynov af15b17f1c Remove unnecessary helper from FutureInstrumentation 2019-01-23 22:31:59 -05:00
Marco Ferrer 5096ac35b6 address ci errors 2019-01-21 14:12:44 -05:00
Marco Ferrer d7319cd76d add tests for kt cancellation and channels 2019-01-21 11:59:54 -05:00
Marco Ferrer 63c28cef31 add kotlin test config to java-concurrent project 2019-01-09 19:20:31 -05:00
Marco Ferrer a31abc67e9 add support for instrumenting kotlin coroutine schedulers 2019-01-09 19:04:42 -05:00
Nikolay Martynov 354cbfcb2d Concurent instrumentation tests: block thread before starting tracing
Otherwise blocking thread is pretty much useless since we may still
get spans if threads are executed quickly enough.
2019-01-08 12:30:18 -05:00
Nikolay Martynov 06bd670f0a Remove unused class 2019-01-08 12:30:10 -05:00
Tyler Benson 7da0cc7f50
Merge pull request #645 from DataDog/tyler/instrumenter-signature
Apply proper generic signature for Instrumenter.Default transformers()
2019-01-07 14:18:52 -08:00
Tyler Benson c18b299606 Also exclude test coverage from instrumentation 2019-01-04 15:25:36 -08:00
Tyler Benson fe52180bfc Apply proper generic signature for Instrumenter.Default transformers()
Previously it was missing the MethodDescription portion.
2019-01-04 15:25:12 -08:00
Nikolay Martynov 2e9b20ceb5 Remove unused variable from AsyncChild classes 2018-12-05 11:53:19 -05:00
Nikolay Martynov 2e8dc9d08f Fix Ratpack tests that got broken by ExecutorInstrumentation refactoring
It turns out closing continuation also closes parent span. This is not
very good in cases when we end up not using continuation if
continuation in a state has already been setup.

This patch provides way to close continuation in a way that doesn't
affect parent scope.
2018-11-29 15:21:46 -08:00
Nikolay Martynov 4ec5ca394c Add code to wrap future returned by submit(Runnable) call 2018-11-29 15:18:46 -08:00
Nikolay Martynov ad98ebc01f Add some comments and some other minor CR tweaks 2018-11-29 15:18:46 -08:00
Nikolay Martynov 118a61cc67 Add field backed context provider 2018-11-29 15:18:46 -08:00
Nikolay Martynov b89e73b3c0 Switch executor instrumentation to use context storage 2018-11-29 15:18:46 -08:00
Tyler Benson 468ccab99a Improve error handling for ThreadPoolExecutorInstrumentation
If other exceptions are thrown when trying to test the queue, it generates lots of log noise.  This should handle it better.
2018-11-27 11:28:44 -08:00
Tyler Benson cbb29069fe Apply component tag more consistently 2018-11-14 11:31:40 -08:00
Nikolay Martynov 9c652cc5b2 Remove duplicate class names from ExecutorInstrumentation 2018-11-05 12:55:32 -05:00
Nikolay Martynov b8276ac70b Specify Scala dependency in single place 2018-11-05 12:55:32 -05:00
Nikolay Martynov aba0c3377d Use offer instead of add when trying to test-insert element into the queue on ThreadPoolExecutor instrumentation 2018-10-24 15:13:40 -04:00
Tyler Benson 432ce89a07 Add assertTraces to AgentTestRunner with implied argument
This will also help with auto complete when writing tests.
2018-10-15 10:19:00 +10:00
Nikolay Martynov f71192266c Rework the way multi-jvm tests work
To allow some JVMs runs only subset of tests
2018-10-02 13:20:19 -04:00
Nikolay Martynov 55c2935a19 Remove some hacks that were made for Gradle 4.10.1 2018-10-01 13:40:17 -04:00
Tyler Benson 2174f21d61 Allow executor tracing to flow across distinct executors
Otherwise any async work is lost after the first executor jump.
2018-09-21 11:12:19 +10:00
Tyler Benson 72b2873ec1 ScheduledThreadPoolExecutor doesn’t actually work separately
It was only working because it extends from ThreadPoolExecutor, but it uses a backing queue type that is incompatible.  Scheduled execution submits to the work queue directly and will bypass the exisiting instrumentation.
2018-09-20 16:33:49 +10:00
Tyler Benson 3d78afbc2c Disable Executor instrumentation ThreadPoolExecutor instances
If we can’t add generic runnables to the queue.

This won’t solve the problem for all cases, but it will help with some.

Tests forthcoming.
2018-09-20 16:06:01 +10:00
Tyler Benson ebcc2ef052 Add work around for scala compile issue. 2018-09-19 15:13:42 +10:00
Tyler Benson 6732110f28 Handle connection failures for Jersey and Resteasy
CXF and other client frameworks will still lose the span and miss the error.
2018-09-12 10:10:31 +10:00
Tyler Benson 898647e000 Allow trace to persist across netty connect.
Also create span with error on connection failure.

Add tests for connection failure.
2018-08-22 09:45:33 +10:00
Tyler Benson 3f2ec7dc48 Move to separate packages 2018-08-16 12:24:27 +10:00
Tyler Benson 4583d12b31 Cleanup method signatures and servlet 2 instrumentation
adding the abstract servlet instrumentation reduces code duplication and makes it more similar to servlet 3 instrumentation.
2018-08-13 15:14:10 +10:00
Nikolay Martynov 6bc1d1ab8e Implement `saveHasSuperType` and use it instead of `hasSuperType`
The idea is to just 'trim' type hierarchy 'up-trees' that we cannot
resolve dring instrumentation instead of failing to instrument completely.
2018-07-31 20:13:59 -04:00
Tyler Benson 51919a77bb Apply formatter on java files. 2018-07-31 12:07:43 +10:00
Tyler Benson bc3af56b08 Apply formatter on scala files. 2018-07-31 12:07:30 +10:00
Tyler Benson b5c8a8b8fc Apply formatter on gradle files. 2018-07-31 12:04:00 +10:00
Nikolay Martynov 44b364332a Remove unused field and method 2018-07-26 10:11:20 -04:00
Andrew Kent 02a3e6a5d3 New Instrumentation API 2018-07-06 17:17:32 -04:00
Nikolay Martynov 9cc99bafbf Simplify Jacoco configuration 2018-06-20 17:13:30 -04:00
Nikolay Martynov e070a9be4a Fix jacoco excluded classes concatenation 2018-06-20 17:05:16 -04:00
Nikolay Martynov 93a41b5064 Fix some typos 2018-06-06 20:47:49 -04:00
Nikolay Martynov 7a280d7e13 Fix some code formatting 2018-06-06 17:11:17 -04:00
Nikolay Martynov ca6fabfd64 Move code from `WrapAdviceUtils` to `DatadogWrapper` 2018-06-06 16:42:23 -04:00
Nikolay Martynov 5f82776fc5 Use assertTraces api in slick tests 2018-06-06 16:41:03 -04:00
Nikolay Martynov d6aaee1bee Check for java concurrent classes prefixes match only if class was not whitelisted already 2018-06-06 15:51:30 -04:00
Nikolay Martynov bbcc2882ab Use test set instead of submodule for Slick tests 2018-06-06 15:49:39 -04:00
Nikolay Martynov f92af7d860 Fix Scala Slick instrumentation 2018-06-06 10:43:23 -04:00
Nikolay Martynov b8fdb4acd5 Added Scala Slick test that fails due to executor wrapping problems 2018-06-06 10:43:19 -04:00
Andrew Kent 1641c54448 Skip instrumenting slick thread pool 2018-05-18 11:17:27 -07:00
Tyler Benson d5d24c50c7 Replace @Unroll’s with a rule to always unroll. 2018-05-10 15:24:59 +10:00
Tyler Benson 9a52303376 Apply jacoco to every java project
Some projects have ignores/whitelists, but generally coverage is pretty high.

AFAIK, this doesn’t really capture instrumentation test coverage though.
2018-05-04 16:23:32 +10:00
Tyler Benson f35e2e6ebe Remove various warnings and other cleanup
Also upgrade some plugins.
2018-05-04 14:05:06 +10:00
Tyler Benson 7c4d42ef8a Add additional test task for testing latest versions of a dependency 2018-05-04 14:04:30 +10:00
Tyler Benson 0f77ccd797
Merge pull request #297 from DataDog/tyler/kafka
Add null check to kafka
2018-05-02 08:06:37 +10:00
Andrew Kent 3c7d4f5b13 Enable executor instrumentation by default
Executor instrumentation does not need to be turned off by default
because the instrumentation will not apply unless the TraceScope is
activated.
2018-04-30 17:27:51 -07:00
Tyler Benson 63d308e50d Misc cleanup/minor changes 2018-05-01 10:24:14 +10:00
Andrew Kent d594d6e8db Don't create continuations when async propagation is off 2018-04-11 13:32:58 -07:00
Andrew Kent a0a11a51d0 Use ScopeManager to enable/disable low level async instrumentation. 2018-04-11 13:32:58 -07:00
Andrew Kent 0d7aa022db Refactor ContinuableScope 2018-04-11 13:32:58 -07:00
Andrew Kent 6e62b79b8f Separate executor and scala future tests 2018-04-11 13:32:58 -07:00
Andrew Kent 3eac216a04 Use defaultTransformers in all instrumentation 2018-03-20 15:59:11 -07:00
Andrew Kent 714afba71b Akka actor instrumentation 2018-03-20 09:31:54 -07:00
Andrew Kent c529c06801 Ignore failures to instrument proxy classes 2018-03-19 16:07:45 -07:00
Andrew Kent 5a97c1e5bb Copied scala tests over from integration tests 2018-03-19 16:07:45 -07:00
Andrew Kent 428e304164 Rename ContextPropagator to TraceScope 2018-03-12 10:29:50 -07:00
Andrew Kent 45aff57740 Assert on executor span relationships 2018-03-09 12:59:12 -08:00
Andrew Kent 21180530ea Remove opentracing from dd-trace-api 2018-03-09 11:50:39 -08:00
Andrew Kent 81b70fb0e4 Disable async instrumentation by default. 2018-03-09 11:50:39 -08:00
Andrew Kent 4a11fc6d96 Whitelist Executor Instrumentation 2018-03-09 11:50:39 -08:00
Andrew Kent 9a83413141 Executor Instrumentation for Scala 2018-03-09 11:50:39 -08:00