Commit Graph

323 Commits

Author SHA1 Message Date
Laplie Anderson 6b6554996a
Merge pull request #1155 from DataDog/landerson/muzzle-scan-classloader-matcher
Add classloader matcher to muzzle scan
2019-12-30 10:12:59 -05:00
Pawel Chojnacki 65c701dd51
Merge pull request #1128 from DataDog/pawel/add_rmi_support
Add RMI support
2019-12-23 14:38:46 +01:00
Laplie Anderson f181fa721f Add classloader matcher to muzzle scan 2019-12-20 16:17:08 -05:00
Pawel Chojnacki 832605a01a [rmi] Add distributed context propagation
The flow for context propagation is as follows.

 * <p>We inject into StreamRemoteCall constructor used for invoking remote tasks and performs a
 * backwards compatible check to ensure if the other side is prepared to receive context propagation
 * messages then if successful sends a context propagation message
 *
 * <p>Context propagation consist of a Serialized HashMap with all data set by usual context
 * injection, which includes things like sampling priority, trace and parent id
 *
 * <p>As well as optional baggage items
 *
 * <p>On the other side of the communication a special Dispatcher is created when a message with
 * DD_CONTEXT_CALL_ID is received.
 *
 * <p>If the server is not instrumented first call will gracefully fail just like any other unknown
 * call. With small caveat that this first call needs to *not* have any parameters, since those will
 * not be read from connection and instead will be interpreted as another remote instruction, but
 * that instruction will essentially be garbage data and will cause the parsing loop to throw exception
 * and shutdown the connection which we do not want
2019-12-19 17:21:07 +01:00
Pawel Chojnacki 0ee80a0b95 [rmi] Instrumentation for RMI 1.2 and later
includes instrumentation of client and server endpoints
currently missing passing of execution context from client to server
2019-12-19 17:20:50 +01:00
kfujita b707a3aab9 move multi-value aware logic to Extractor. 2019-12-19 13:33:08 +09:00
Laplie Anderson d2db6b6fd9
Merge pull request #1098 from DataDog/tyler/jax-rs-annotation-inheritance
Support JAX-RS Annotation Inheritance
2019-12-06 13:49:46 -05:00
Laplie Anderson 42ac5fc024 Remove synchronization and static helper map 2019-12-04 15:43:28 -05:00
Laplie Anderson 7640e68337 The same classwalking is necessary for @Path 2019-11-20 13:07:04 -05:00
Tyler Benson 393a88585a First pass at supporting annotations inheritance for JAX-RS
[skip ci]
2019-11-15 11:53:16 -08:00
Laplie Anderson 251ceeb978 Print all instrumentation names when muzzled 2019-11-13 14:12:26 -05:00
Nikolay Martynov 2789324cd5
Merge pull request #1084 from DataDog/mar-kolya/fix-agent-for-zulu8
fix agent for zulu8
2019-11-07 14:39:03 -05:00
Douglas Q Hawkins 599d1e0fab
Merge pull request #1082 from DataDog/dougqh/sisu-exclusion
Excluded classes generated by Eclipse Sisu
2019-11-06 14:41:36 -05:00
Nikolay Martynov 42cece67c2 Fix namespace clashes
Using `datadog.trace.agent` to hold agent class causes problems due to
shadowing into this package of other classes.
2019-11-06 13:58:20 -05:00
Nikolay Martynov 15c1e67334 Fix agent on latest zulu8
The problem was that on zulu8 loading OkHttp touches JFR which in turn
touches log manager - which would break things like JBOSS.

The fix is to delay installing agent (and writer) until log manager
things have settled down - in way similar to jmxfetch.

Unfortunately for 'main' agent this turns out to be more involved
because of classloader shenanigans.
2019-11-06 10:09:50 -05:00
dougqh 270a440162 Excluded classes generated by Eclipse Sisu
This change excludes classes generated by Eclipse Sisu (part of Equinox DS).

These classes are created by https://github.com/eclipse/sisu.inject/blob/master/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/CloningClassSpace.java
2019-11-05 15:20:52 -05:00
Nikolay Martynov 7f5b270c67 Call class loading callbacks from onComplete
This should make things more clear
2019-11-05 13:08:21 -05:00
Tyler Benson 425156115c Add new integration for Servlet Filters, HttpServlet, and RequestDispatcher
Disabled by default, and only creates a span if existing trace detected.

To enable all of them:
* System Property: `-Ddd.integration.servlet.enabled=true`
* Environment Variable: `DD_INTEGRATION_SERVLET_ENABLED=true`

(They have independent configs as well.  If needed, view the source below.)
2019-10-25 14:47:48 -07:00
Tyler Benson fa80fee15d Refactor JAX-RS Annotation and Spring Controller/Handler Instrumentation
For spring:
* Move more logic to the decorator.
* Use a fixed operation name, but set the resource name.
* Rename the root span instead of the parent span (If there are other spans in between this could make a difference.)  Not sure what impact this would have if multiple controllers are called (ie, forward/include).

For Jax-rs:
* Rename the root span instead of the parent span (same concern as above with spring)
2019-10-25 10:19:25 -07:00
Trask Stalnaker d45b571996 Remove unused code 2019-10-24 20:53:13 -07:00
Trask Stalnaker b0c5b2cd78 Remove deprecated methods 2019-10-19 16:52:43 -07:00
Trask Stalnaker f67e3b98db Migrate base decorators to new agent api 2019-10-19 16:40:52 -07:00
Tyler Benson 126dc67181 Update AgentApi to OT 0.32.0 2019-10-17 14:11:07 -07:00
Laplie Anderson c8f3a26312
Merge pull request #1045 from DataDog/landerson/decorator-errors
Skip `@Decorator` classes when instrumenting
2019-10-17 16:02:54 -04:00
Laplie Anderson 8971040a45 Supertypes are not always available. Only check the current class for decorator 2019-10-17 13:42:38 -04:00
Laplie Anderson 6e0af7cdeb Dont instrument `@Decorator`s or CDI breaks 2019-10-16 18:26:06 -04:00
Tyler Benson 61151d425a Changes requested in review 2019-10-15 16:03:02 -07:00
Tyler Benson 757961e014 Initial implementation of agent internal API. 2019-10-15 15:40:44 -07:00
Nikolay Martynov ecc57ffcc5 `DDCachingPoolStrategy.size()` is not precise, use `find` instead 2019-10-11 09:00:16 -04:00
Tyler Benson 4679b07bb3 Decrease cache size and make soft values
Attempt to reduce memory overhead requirements.  Based on feedback, it seems 10k was overly agressive.  In memory constrained environments, use soft values to ensure the cache isn’t pushing usage over the limit.
2019-10-10 18:19:41 +02:00
Tyler Benson 9ef3332140 Extract base test class and move Config class changes there. 2019-10-07 18:51:25 +02:00
Nikolay Martynov 8e75eeb506 Update bytebuddy to 1.10.1 2019-10-07 08:27:13 -04:00
Laplie Anderson d564ff937a Cleaner test timeout was too low 2019-09-18 18:06:27 -04:00
Tyler Benson e895d7c3a7
Merge pull request #983 from DataDog/tyler/cache-soft-refs
Optimize DDCachingPoolStrategy
2019-09-11 09:41:48 -07:00
Tyler Benson 988b03b2f3 Optimize DDCachingPoolStrategy
Reduce default cache size in EvictingCacheProvider, and return a NoOp CacheProvider when classloader is going to be skipped.
2019-09-10 15:52:37 -07:00
Tyler Benson 42545a0906 Remove synchronization from RateByServiceSampler
This change avoids lock contention in a hot code path.

I also added double check locking in ClassLoaderMatcher to reduce the need of locking there.
2019-09-10 12:44:13 -07:00
Tyler Benson df017e044a
Merge pull request #975 from DataDog/tyler/split-by-tag
Add new setting to allow renaming service by tag
2019-09-05 14:24:20 -07:00
Tyler Benson 82f5076716 Add new setting to allow renaming service by tag
This is a more generic form of the previous `split-by-domain` and `split-by-instance`.

(Note: evaluation is done when a tag is set, so If multiple tags are configured, the last tag set will take precidence.)

For example, this setting can be used to rename `aws-sdk` spans to be identified with the corresponding `aws.service` tag:

```
-Ddd.trace.split-by-tags=aws.service
```

There are some slight differences with this setting compared with`dd.trace.http.client.split-by-domain` and `dd.trace.db.client.split-by-instance`.  `split-by-tags` applies to every span, where `split-by-domain` and `split-by-instance` only apply to http and db client spans respectively.
2019-09-03 16:55:47 -07:00
dougqh 4851cc9069 Re-running format through gradle
Need to figure out why IntelliJ and gradle are behaving differently for import order
2019-09-03 16:16:13 -04:00
dougqh 3e2ef885a5 Ensure "client" spans do not set the language tag
The core changes are in Config and ServerDecorator.

Moved default tagging from Config::getRuntimeTags to Config::getLocalRootSpanTags.  This changes the result of Config::getMergedJmxTags as well.

To preserve language for servers changed ServerDecorator::afterStart.

Other changes are in tests - the most complicated part is in TagsAssert::defaultTags.  This now contains a bit too much conditional logic for my liking.
2019-09-03 13:20:50 -04:00
Laplie Anderson d03d583e85
Merge pull request #966 from DataDog/landerson/wrap-instrumentation-install
Wrap instrumentation installation with a try/catch
2019-08-30 14:02:13 -04:00
Laplie Anderson f3bb22d8df Revert addition of tests. Too many issues 2019-08-29 18:20:09 -04:00
Laplie Anderson ae9f8e15dd Add test. Address other PR concerns 2019-08-29 17:48:29 -04:00
Laplie Anderson 08de0b02fd Wrap instrumentation installation with a try/catch 2019-08-28 17:33:11 -04:00
Tyler Benson 09ad2374cf Disable Grizzly instrumentation by default
Otherwise it can interfere with the more common Servlet instrumentation (changing the root span name).

Unify attribute/property name for saving span on a request/context.
Also add tests for embedded GlassFish.
2019-08-27 13:27:57 -04:00
Laplie Anderson 3f29e72317
Merge pull request #960 from DataDog/landerson/module-reference-fix
Ensure injected modules can read helper class modules
2019-08-27 12:42:34 -04:00
Laplie Anderson d170984f72 Use weak references for the helper modules so ClassLoaders can be GC'd 2019-08-27 10:56:04 -04:00
Laplie Anderson 7b66a31d80 Ensure injected modules can read the helper class module 2019-08-23 19:14:10 -04:00
Tyler Benson e69edaec14 Remove project config centrally defined and other misc cleanup 2019-08-22 12:43:13 -07:00
Tyler Benson 95d056da5d More CR tweaks. 2019-08-21 16:48:52 -07:00