Commit Graph

485 Commits

Author SHA1 Message Date
Jaroslav Bachorik eb272bcc00
Add exception sampling event (#1297) 2020-04-20 16:31:54 +02:00
Tyler Benson ebb9b5da65 Properly handle resource name for nested JAX-RS calls
Previously the last called one was winning.  Now we check if the resource name is already set before applying the new name.
2020-04-16 14:23:16 -04:00
Tyler Benson ce006e1405 Ensure RequestDispatcher span is part of expected trace 2020-04-14 14:56:16 -04:00
Tyler Benson 07f99a98d8
Merge pull request #1221 from DataDog/tyler/trace-processor
Add TraceProcessor and move some existing functionality to rules
2020-04-14 13:33:46 -04:00
Tyler Benson 11c71e1d5d Avoid setting the error tag
and test fixes.
2020-04-14 12:21:51 -04:00
Nikolay Martynov f4c9b73b02 Add thread utils to bootstrap so instumentations could use them 2020-04-14 11:47:40 -04:00
Nikolay Martynov b1589c3819 Fix unit test 2020-04-13 17:51:20 -04:00
Nikolay Martynov eee11f5ce0 Remove Cleaner class 2020-04-13 17:34:31 -04:00
Nikolay Martynov 683477bd60 Simplify WeakMapSuppliers
Also move CleanerTest to PeriodicSchedulingTest
2020-04-13 17:30:31 -04:00
Nikolay Martynov 1fb844ab5f Make `CommonTaskExecutor` periodic tasks safe
* Verify that we can schedule task and catch exceptions.
This should help to avoid additional exceptions on app crash during
  startup.

* Avoid holding strong references from within executor to make sure
  that things can get GCed.
2020-04-13 16:04:31 -04:00
Tyler Benson e7f0d2db12 Alternate fix for #1319
Turns out the issue wasn't with an empty string returning an empty array, but a string with just `,`.
```
jshell> ",".split(",")
$1 ==> String[0] {  }
```
A non-intuitive edge case in my opinion.
2020-04-07 12:35:20 -04:00
Lev Priima a5a5743f7c
WeakCache instead of WeakMap (#1256)
WeakCache abstraction in addition to WeakMap
2020-03-20 00:23:07 -07:00
Tyler Benson a7b327e72e Add check to ensure value isn't empty
Otherwise split on an empty string will return an empty array.
2020-03-13 14:56:45 -07:00
Brian Devins-Suresh a3fbcd6192 They need to fix the suggestions workflow... 2020-03-12 14:47:47 -04:00
Brian Devins-Suresh 9fe9be3f7c
Apply suggestions from code review
Co-Authored-By: Laplie Anderson <randomanderson@users.noreply.github.com>
2020-03-12 14:43:13 -04:00
Brian Devins-Suresh 98f58dbea9 Rework test logic for ignores. Add spring proxy to global ignore list 2020-03-12 14:33:02 -04:00
Laplie Anderson 6cd530a541 Move decorators to bootstrap 2020-03-11 18:41:29 -04:00
Laplie Anderson 0d6328a76e Add toString() for bootstrap placeholder 2020-03-11 18:37:03 -04:00
Tyler Benson 36c063c4b3
Merge pull request #1303 from trask/fix-for-spring-jms-listeners
Fix for Spring JMS listeners
2020-03-10 09:54:54 -07:00
Laplie Anderson 645c4de2c9 Fix ignores for com.google.inject 2020-03-09 17:41:15 -04:00
Trask Stalnaker 7761094280 Fix for Spring JMS listeners 2020-03-08 22:41:58 -07:00
Trask Stalnaker 5834b2cab1 Add comment explaining why keeping delegate check 2020-03-06 13:37:01 -08:00
Trask Stalnaker 0ca384d24c Revert "Remove non-delegating class loader check"
This reverts commit c63c981221.
2020-03-06 13:21:02 -08:00
Trask Stalnaker 7ede895b53 Revert "Cache is not needed anymore"
This reverts commit 166d951a10.
2020-03-06 13:18:08 -08:00
Douglas Q Hawkins 3ff5b99cd6
Merge pull request #1285 from DataDog/dougqh/jar-file-collisions
Avoid temporary Jar file collisions
2020-03-06 15:14:25 -05:00
Nikolay Martynov 46b776f76a Include classloading instrumentation into all tests
Classloading instrument core JDK classes so we should make sure this
doesn't have bad effects on other instrumentations.
2020-03-06 13:50:56 -05:00
Nikolay Martynov 51630ada62 Unignore `org.h2.util.Task` 2020-03-06 13:49:55 -05:00
Nikolay Martynov 18f9c653b9 Exceptions for hppc 2020-03-06 13:49:55 -05:00
Nikolay Martynov a261fb4760 More spring exceptions 2020-03-06 13:49:55 -05:00
Nikolay Martynov 930c1fb4e9 One more exception for h2 2020-03-06 13:49:55 -05:00
Nikolay Martynov fd4257627d Do not ignore org.springframework.util.concurrent. 2020-03-06 13:49:55 -05:00
Nikolay Martynov 74161a5872 Add missng dots 2020-03-06 13:49:55 -05:00
Nikolay Martynov ab8b246553 Remove asm matchers - asm is already matched elsewhere 2020-03-06 13:49:55 -05:00
Nikolay Martynov a8c625b8f0 Fix google http client ignore matchers 2020-03-06 13:49:55 -05:00
Nikolay Martynov e301761dc2 Stop ignoring org.springframework.scheduling.annotation
It has some runnables and it is not very big
2020-03-06 13:49:55 -05:00
Nikolay Martynov 0d34aa2e96 Stop skipping cassandra core instrumentation
Looks like it has lots of runnables sprinkled all over the place
2020-03-06 13:49:55 -05:00
Nikolay Martynov c1c9ffa571 Fix couchbase ignores 2020-03-06 13:49:55 -05:00
Tyler Benson ca043a67b5
Merge pull request #1298 from DataDog/tyler/classloader-matcher
ClassLoader matcher cleanup
2020-03-05 20:00:09 -08:00
Tyler Benson d25ace6627
Merge pull request #1292 from DataDog/tyler/add-test-retrys
Attempt to improve test reliability
2020-03-05 14:40:41 -08:00
Tyler Benson 372ba221d2 Invert the classloader matcher to remove the double negative. 2020-03-05 10:14:33 -08:00
Tyler Benson ee5cf2cf24 Attempt to improve test reliability
Add timeouts (to avoid a gradle level timeout) and retries (since we're doing it manually anyway).

I realize this is a band aid...
2020-03-04 19:02:41 -08:00
dougqh 7a183e755e Switching to per-injection temp dir to avoid race
Upon review, we realized that there was a race not just between processes but also with multiple threads in the same process.

This race happens because of the effort to proactively clean-up directories.

This left two choices...
- assume per-process exclusivity -- and resolve the race with reference counting
- move to a temp dir per injection

This change uses the later strategy which is potentially more expensive but safest.
2020-03-04 15:14:07 -05:00
Trask Stalnaker 166d951a10 Cache is not needed anymore 2020-03-04 09:47:15 -08:00
Trask Stalnaker c63c981221 Remove non-delegating class loader check
This is not needed anymore now that loadClass() is being instrumented to
deal with non-delegating class loaders.
2020-03-04 09:46:20 -08:00
dougqh 4ad51dd9fa Introducing TempDir helper
Introduces a TempDir helper class

This was done to help handle an oversight in the prior per-process temp dir change.  The fallback mode is to use the shared java.io.tmpdir directly.

When using java.io.tmpdir, we don't want to be creating and destorying, since it may be shared.

The new TempDir object is constructed knowing whether the TempDir is per-process or shared -- and the behavior of its prepare and cleanup method change accordingly.

When using a per-process temp dir, the dir is creating and deleted regularly.  When using a shared temp dir, those methods become nops.

Creating TempDir also made it easy to avoid repeatedly calling deleteOnExit in the event that delete fails, so I made that change as well.
2020-03-03 16:08:37 -05:00
dougqh d2ecce477e Switching to per-process temp dir
Switching to create a per-process temp dir as protection against file name collisions.  This is done by introduced TEMP_DIR which is calculated during class initialization.

The current selection process generates a random directory name and sees if that name is availabe in java.io.tmpdir.  If it is that name is selected; otherwise, another name is generated.

If no unique name is found after 10 rounds of generation, the code falls back to the old behavior of writing directly to java.io.tmpdir.
2020-03-03 16:08:29 -05:00
dougqh c50899f184 Creating helper methods for injection
Create helper methods injectBootstrapClassLoader & injectClassLoader.

The directory creation and retry logic that will be added to the handling of the bootstrap will complicated the code.

To keep the code readable, I broke the bootstrap handling into its own method.  To keep the level abstraction consistent, I did the same with injectClassLoader.
2020-03-03 16:08:19 -05:00
dougqh 3417fd8940 Improving debuggability by requestingName
This change adds a requestingName field to help in diagnosing the source of any injection failures.

Usually, the requestingName is the simple class name of the Instrumenter; however, this change doesn't propagate the Instumeneter named through FieldBackedProvider.
2020-03-03 16:08:09 -05:00
Nikolay Martynov a62db5bcad Ignore more spring 2020-03-03 14:51:25 -05:00
Nikolay Martynov 9f1c821d37 Ignore javax.el 2020-03-03 14:51:25 -05:00