Commit Graph

219 Commits

Author SHA1 Message Date
Laplie Anderson ac2087eb4a Use .isolated instead of .jar 2019-08-30 14:06:51 -04:00
Laplie Anderson 5994fa8734 Change packaging of internal jars to be exploded in a subfolder 2019-08-29 16:04:10 -04:00
Laplie Anderson 7b023ca95a Always use reflection to get VM args 2019-08-06 16:12:43 -04:00
Laplie Anderson ff0cd73381 Getting the -javaagent parameter is necessary in some cases 2019-08-05 13:53:38 -04:00
Laplie Anderson ba6ff678db Change agent jar inclusion in tests that launch a process
The tests were the main problem. By using a different approach to pass in the agent jar, the TracingAgent code can be much simpler
2019-08-05 12:06:43 -04:00
Laplie Anderson a9d0d2cbbe Use CodeSource instead of javaagent arg
Check both TracingAgent.class and DatadogClassloader.class for code source
2019-08-05 10:41:05 -04:00
Laplie Anderson 8d41e60182 Simple test to check loading of bootstrap in a launched vm 2019-08-02 15:39:36 -04:00
Laplie Anderson 1381e718fe More complicated logic to reflectively get VM args on different jdks
Support the differences between IBM and Oracle jdks along with differences between 8 and 12
2019-08-02 10:27:45 -04:00
Laplie Anderson a6ba2d25fe A more reliable way to get the agent jar without breaking logging 2019-08-01 12:45:17 -04:00
Laplie Anderson 273feafa94 Use the bootstrapProxy to load jars. Better bootstrap url algo 2019-07-30 19:50:16 -04:00
Laplie Anderson cf98110991 JMXFetch loading threw permission errors 2019-07-30 16:56:49 -04:00
Laplie Anderson c41536cbe2 Fix failing tests
Add TracingAgent to list of bootstrap class
Fix renaming tests
Fix JMXFetch path splitting
2019-07-30 15:27:47 -04:00
Laplie Anderson c275143eae Shadow the bootstrap jar into the main agent jar 2019-07-29 17:01:55 -04:00
Laplie Anderson a1f8cad2e8 Tooling and jmxfetch temp jars removed
Enhanced the DatadogClassloader to work with jars inside other jars.  No need to create the jars in a temp directory anymore
2019-07-29 17:01:55 -04:00
Laplie Anderson 7e1266b39f Use try with resources to read agent version
More compact and gets rid of warnings
2019-07-29 17:01:55 -04:00
Nikolay Martynov a9a623d1dc Configure system logger to log timestamp
Also add an 'identifying marker' to tracing log lines so we could
potentially automatically parse them.
2019-06-17 12:56:19 -04:00
Tyler Benson d6719ed5cd Replace Mongo tests with updated tests. 2019-06-13 10:44:42 -07:00
Nikolay Martynov 8fa14ad33e Remove DDJavaAgentInfo - it doesn't seem to be used 2019-06-07 22:56:32 -04:00
Nikolay Martynov 78d014cf91 Fix DDInfoTest
This test was not marked as `Specification` and therefor was not run
during builds. Some time ago some code got moved around and this test
got broken - so fixing it.
2019-06-07 22:56:32 -04:00
Tyler Benson fd43210e07 Add task timeout for tests. 2019-05-23 17:13:40 -07:00
Tyler Benson 4d01f52b67 Change JMXFetch config keys
`agent.conf.d` -> `jmxfetch.config.dir`
`jmxfetch.configs` -> `jmxfetch.config`

Enabling bundled JMXFetch configs:
`dd.integration.<integration>.enabled=true` -> `dd.jmxfetch.<integration>.enabled=true`
2019-05-23 15:00:46 -07:00
Nikolay Martynov c0bb6f4a36 Fix minor typo 2019-05-09 09:44:42 -04:00
Tyler Benson 793627c167 Fix tests 2019-04-30 15:55:12 -07:00
Tyler Benson ac734ac6ee More classloading issues with Glassfish
Glassfish’s WebappClassLoader caches when a resource or class load fails, so we can’t load as a resource first to see if it is available.

Also add additional logging.
2019-04-30 12:38:54 -07:00
Nikolay Martynov bddee3d6e2 Make sure span is opened and closed with scope in Mongo 2019-04-05 11:13:53 -04:00
Nikolay Martynov 63e0c0f032 Support Unix Domain Socket proxy to send traces 2019-03-15 11:36:44 -07:00
Tyler Benson 472262149c Apply timeout and retry to test
This test seems to hang a lot in java 7.
2019-03-14 15:44:32 -07:00
Tyler Benson c500d4b236 Migrate OkHttp Instrumentation to Decorators 2019-03-08 15:12:29 -08:00
Tyler Benson 133460a79a Stop making hard references in HelperInjector
Also make awaitGC interruptable.
2019-02-27 19:09:01 -08:00
Nikolay Martynov 15bca28539 Remove unused testing function 2019-02-26 10:31:31 -05:00
Tyler Benson 7e82f5b197 Remove unnecessary license checker 2019-02-22 13:42:43 -08:00
Tyler Benson 8512b841e6 Fix how we evaluate if customlogger is on classpath
Resources must replace `.` -> `/` and add `.class` to the end.
2019-02-15 15:00:25 -08:00
Tyler Benson 4414dc2ad5 JMXFetch bundled integrations disabled by default
Enable each individually by setting `-Ddd.integration.<integration_name>.enabled=true`.
2019-02-06 13:00:52 -08:00
Tyler Benson 88d190d95b Test for customlogmanager=false 2019-01-31 14:53:58 -08:00
Tyler Benson e293ed477d Fix tests. 2019-01-31 14:25:19 -08:00
Tyler Benson f7abb2ac04 Initialize JMXFetch if configured log manager is on sys classpath
Some applications set java.util.logging.manager but never actually initialize the logger.
Check to see if the configured manager is on the system classpath.
If so, it should be safe to initialize jmxfetch which will setup the log manager.
2019-01-31 13:31:48 -08:00
Tyler Benson c89b00f682 Elaborate on comment. 2019-01-31 11:14:06 -08:00
Tyler Benson ea0dedcee7 Allow setting dd.app.customlogmanager=false to disable jboss check 2019-01-31 10:53:20 -08:00
Tyler Benson ee8a26d4dc Replace jboss classpath check with ENV check for jmxfetch delay
Some applications seem to have this jboss class on the classpath, but don’t actually use it.  When coupled with not actually using JUL, this means that we may never actually start JMXFetch.

Checking for JBOSS_HOME instead should be safer.
2019-01-31 10:42:43 -08:00
Tyler Benson bb2fbb30b8 Add logging to JMXFetch initialization delay
Otherwise it’s difficult to determine why JMXFetch isn’t being initialized.
2019-01-30 10:39:29 -08:00
Tyler Benson 03bcdc97cc Move awaitGC to common utility package 2019-01-25 10:32:09 -08:00
Nikolay Martynov 04fbb5085f Improve OSGi class loader instrumentation
It turns out that Eclipse's OSGi implementation has two problems:
* It doesn't respect system properties by default
* It has tricky classloader implementation that loads bootstrap
  classes from the classloader-has-delegation-to-bootstrap check but
  doesn't load bootstrap classes from 'normal' code.

This should address second problem and make Eclipse's OSGi
implementation 'safe' by default.
2019-01-25 08:52:07 -05:00
Andrew Kent af306f376b Comments explaining jmxfetch delay 2019-01-18 10:56:21 -08:00
Andrew Kent 097c557651 Delay jmxfetch init when custom log manager is used by client's app 2019-01-16 12:18:29 -08:00
Andrew Kent 4c4b12e1d6 Expand custom logman tests to handle three different logman cases 2019-01-16 10:06:41 -08:00
Andrew Kent 3295739e28 Fix race conditions in custom log manager test
Fix two race conditions in the custom log manager test.

- Remove possibility of false positives by blocking until jmx thread
  sends statsd metrics
- Disable logging in test to avoid deadlock in jmxfetch which can
  occur when the JVM shuts down too quickly
2019-01-16 08:57:59 -08:00
Tyler Benson 6a09f6e2b9 Moves all ittests to be tests under dd-java-agent.
This was weird having it as a separate project.  Reduces the number of top level directories.

There weren’t any existing tests in dd-java-agent’s test directory, so this seemed like a good place to put them.
2019-01-04 15:25:36 -08:00
Nikolay Martynov 403040bac0 Use JMXFetch as a library 2018-10-18 09:46:44 -04:00
Tyler Benson 51919a77bb Apply formatter on java files. 2018-07-31 12:07:43 +10:00
Nikolay Martynov c844501bc5 Fixes for some minor checkstyle complaints 2018-07-23 10:04:53 -04:00