Commit Graph

2094 Commits

Author SHA1 Message Date
Tyler Benson 14b5576cd8
Merge pull request #1201 from DataDog/tyler/upgrade-okhttp
Upgrade OkHttp client to 3.12.8
2020-02-04 15:55:36 -08:00
Tyler Benson cab139e905 Upgrade OkHttp client to 3.12.8 2020-02-04 15:06:44 -08:00
Laplie Anderson a811c027ce
Merge pull request #1188 from DataDog/landerson/finatra
Finatra Instrumentation
2020-02-04 17:36:47 -05:00
Tyler Benson daae198b08 Set dispatcher span on request instead of clear
Clearing the span caused traces to be broken up and reported independently when calling forward/include.
2020-01-30 21:55:16 -05:00
Douglas Q Hawkins 53d32b4324
Merge pull request #1189 from DataDog/dougqh/type-caching2
Revised type cache
2020-01-30 18:47:02 -05:00
Laplie Anderson ed12af6994 Assume parent span is netty 2020-01-30 18:21:49 -05:00
dougqh faeb069424 Adjusting capacity check again 2020-01-30 18:08:49 -05:00
dougqh 235a6470fb googleJavaFormat 2020-01-30 17:45:40 -05:00
dougqh 0f095f0adb Final clean-up
- Removed unused method from earlier version
- Corrected previously overlooked comments that were remnant of prior version
2020-01-30 17:44:24 -05:00
Laplie Anderson 37a279069b Add server tests 2020-01-30 15:23:26 -05:00
Blinkingor 8d83172128 clazz -> segment rename 2020-01-29 18:41:29 +01:00
Blinkingor db485d10da final configString 2020-01-28 16:20:02 +01:00
Blinkingor 811051d111 Remove overlapping tests and fix failing unit test 2020-01-28 16:06:23 +01:00
Blinkingor 10b963d277 Codenarc fixes 2020-01-28 15:35:39 +01:00
Blinkingor cf876b5e67 Fix import order 2020-01-28 15:21:50 +01:00
Blinkingor 1e390984c1 Fix potential StackOverFlowError on regexp 2020-01-28 10:28:37 +01:00
dougqh 176f826a44 Adjusting approximateSize check to be more reliable 2020-01-27 17:44:39 -05:00
dougqh 4c7a0ba7a7 Fixing muzzle?
MuzzlePlugin groovy checks that no threads are spawned because this holds the ClassLoader live.

This was breaking with the caching change because the cache no longer uses the Cleaner service.

This caused a problem because the Thread behind the cleaner is created lazily when the first task is created, but without the cache the creation was delayed.

To solve this, I addressed the original cause of the leak.  The newly created Thread automatically inherits the contextClassLoader of its parent, but that's unnecessary for a cleaner thread.

So I changed the ThreadFactory for cleaner to explicitly null out the contextClassLoader.

We should probably null out contextClassLoader in other thread factories and also reduce our use of contextClassLoaders in general, but that will left to another PR.
2020-01-27 17:14:17 -05:00
dougqh d50f901f39 googleJavaFormat, codeNarcTest, and test reliability 2020-01-27 12:34:39 -05:00
dougqh fb871611b5 Replacing ID generation with WeakReference reuse
First pass at replacing ID generation with WeakReference reuse

In this first version, the Cache<ClassLoader, ID> was replaced with Cache<ClassLoader, WeakReference<ClassLoader>>.

The core cache is still of Cache<TypeCacheKey, TypePool.Resolution> and TypeCacheKey logically remains a composite key of ClassLoader, class name.

The removal of ID assignment means ID exhaustion is no longer na issue, so there's never a need to rebuild the cache.  For that reason, CacheInstance has removed and the core caching logic has been moved into DDCachingPoolStrategy.

While TypeCacheKey remains conceptually the same, the internals have changed somewhat.  The TypeCacheKey now has 3 core fields...
- loaderHash
- loadeRef
- class name

Since loader refs are recycled, the fast path for key equivalence can use reference equivalence of the reference objects.

This change ripples through the CacheProvider-s which also have to store loaderHash and loaderRef.

It may be worth going a step further and switching to a Cache<Loader, TypePool> as well.  That still avoid the creation of many WeakReference-s, since the underlying CacheProvider will hold a canonical WeakReference per ClassLoader.
2020-01-27 12:03:44 -05:00
dougqh cf877f67e5 Working around muzzle quirk
Muzzle doesn't like creation of SecureClassLoader-s, so switching to a URLClassLoader for my placeholder loader in tests
2020-01-27 09:47:36 -05:00
Brian Devins-Suresh 660041636a
Merge pull request #1190 from DataDog/devinsba/hibernate-null-entity-check
Add null check to hibernate decorator
2020-01-24 14:55:11 -05:00
Brian Devins-Suresh 3daad0009d Add null check to hibernate decorator 2020-01-24 10:58:52 -05:00
Laplie Anderson 8ff985afdb Cleaner way to skip netty executor's tasks 2020-01-23 12:04:56 -05:00
dougqh 984d77e44c googleJavaFormat & codeNarc 2020-01-23 11:15:39 -05:00
dougqh 726236bd64 Type cache overhaul
This change overhauls the core type cache

The new approach aims to achieve several things...
1 - cache is strictly bounded -- no variance for number of classes of ClassLoaders
2 - cache is significantly smaller
3 - cache doesn't compromise start-up time
4 - primary eviction policy isn't driven by time
5 - primary eviction policy isn't driven by GC

There are some slight compromises here.
In practice, start-up does increase slightly in a memory rich environment; however, start-up improves considerably in a memory poor environment.

The basic approcach is to have a single unified Guava cache for all ClassLoaders -- nominally keyed a composite of ClassLoader & class name

The ByteBuddy CacheProvider are simply thin wrappers around the Guava cache associated to a particular ClassLoader

However rather than having a large number of WeakReferences floating around.  The cache assigns an ID to each ClassLoader.

To further avoid, consuming memory the cache only preserves a small map of Loader / ID assignments.  This means a ClassLoader may have more than one active ID.

This introduce the possibility for ID exhaustion.  That unlikely case is handle by retiring the internal CacheInstance and starting anew.
2020-01-23 10:55:16 -05:00
Laplie Anderson 68e52497d6 Move to versioned folder name 2020-01-23 10:51:38 -05:00
dougqh 17af9b752c Fix typo in test name 2020-01-23 10:40:48 -05:00
Nikolay Martynov 950389587c Simplify groovy/scala/kotlin compile dependency hack 2020-01-23 09:40:15 -05:00
Laplie Anderson 4e58643bd0 Initial finatra instrumentation 2020-01-22 18:09:10 -05:00
Tyler Benson f9e43516ad Set timeouts on individual tests and increase overall test timeout. 2020-01-22 09:06:03 -08:00
Laplie Anderson 64ed09d76c
Merge pull request #1179 from DataDog/landerson/internal-jar-memory
Use streams directly in DatadogClassLoader
2020-01-16 10:51:42 -05:00
Laplie Anderson 6766e12597
Merge pull request #1173 from DataDog/landerson/weakmap-computeifabsent
Synchronized audit: WeakMap computeIfAbsent
2020-01-15 14:51:29 -05:00
Laplie Anderson 607c8f277e Don't copy to byte[], return input stream directly 2020-01-15 13:38:44 -05:00
Laplie Anderson 68ed1da9c6 Don't call `map.get()` in the `put(..)` case 2020-01-15 12:41:01 -05:00
Laplie Anderson a0b1cd4a75 WeakMap computeIfAbsent 2020-01-15 12:26:15 -05:00
Tyler Benson e31cbd6c89 Add Builder to DDTracer
Deprecate previous constructors.
2020-01-14 17:44:34 -08:00
Tyler Benson a52a1420db
Merge pull request #1165 from DataDog/tyler/servlet
Add servlet integrations for request and response dispatch back in.
2020-01-13 13:17:29 -08:00
Tyler Benson d42e72b683
Merge pull request #1171 from DataDog/tyler/bb-filter
Remove more declared method filtering for optimization
2020-01-13 13:05:28 -08:00
Tyler Benson ef6cd9c52c
Merge pull request #1170 from DataDog/tyler/couchbase
Adjust version compatibility to only 2.x
2020-01-13 13:04:57 -08:00
Tyler Benson 5fe26f004b Remove more declared method filtering for optimization
Same logic that was applied in #1169
2020-01-13 12:52:41 -08:00
Nikolay Martynov 6bf1e159b0
Merge pull request #1167 from DataDog/mar-kolya/upgrade-jmxfetch
Upgrade jmxfetch to latest version
2020-01-13 15:45:12 -05:00
Tyler Benson 77cdd210c6 Also update latestDepTest ranges. 2020-01-13 12:31:38 -08:00
Nikolay Martynov cb7faee63f Remove logging config from jmxfetch setup
It already uses slf4j
2020-01-13 15:23:04 -05:00
Tyler Benson 603155f56f
Merge pull request #1169 from DataDog/tyler/remove-filter
Optimize HasSuperMethodMatcher logic
2020-01-13 12:11:27 -08:00
Tyler Benson a0f0d45c74 Adjust version compatibility to only 2.x
They recently released 3.0.0 which is not compatible with our instrumentation.
2020-01-13 12:10:57 -08:00
Nikolay Martynov dcc5726797 Fix jmxfetch log level and log location config
Looks like this got lost in b505c60543
2020-01-13 15:05:45 -05:00
Nikolay Martynov d55d13e239 Exclude some dependencies from jmxfetch 2020-01-13 14:45:19 -05:00
Nikolay Martynov 8b5d89501b Upgrade jmxfetch to latest version 2020-01-13 14:19:03 -05:00
Tyler Benson 25397fd128 Fix formatting and add test. 2020-01-13 11:18:45 -08:00