Commit Graph

567 Commits

Author SHA1 Message Date
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
Tyler Benson fb74c7b4cb Wrap super/parent type matchers in failSafe
To prevent errors on injected classes.
2018-03-09 14:45:08 +10:00
Tyler Benson 286e9d2d00 Add instrumentation to catch additional classloaders.
Still doesn’t work with Spring Boot because the way they structure their Jars.
2018-03-09 14:32:41 +10:00
Andrew Kent 4fffb61a32 Enable bootstrap instrumentation and helper injection. 2018-03-09 14:31:48 +10:00
Tyler Benson c99f10c0d2 Decouple trace flush from collection
Wait until all spans are finished or garbage collected before reporting trace.
2018-03-09 14:31:48 +10:00
Tyler Benson f31632be33 Remove deprecated usage. 2018-03-09 14:31:48 +10:00
Tyler Benson 5d1297f125 Extract a trace out to a specific class
Rather than it just be a list of spans…
This allows for tracking of if the trace was reported or not, and in the future to do so independently of finishing the span.
2018-03-09 14:31:48 +10:00
Tyler Benson 9b1d454eb9 Combine Threadlocal and RefCounting into single Scope
Also added additional tests.
2018-03-09 14:31:48 +10:00
Andrew Kent 5ffd2142e9 Set max stack size in bytebuddy exception handler 2018-03-07 13:14:41 -05:00
Andrew Kent b2af7491a8 Remove Jackson from AWS Helper class 2018-03-02 13:01:31 -05:00
Tyler Benson 4c66bc8ed2 Use nanotime for additional clock resolution
If a start or stop timestamp on a span is provided, the nanotime is ignored.
2018-02-23 13:13:34 +10:00
Tyler Benson 163b285868 Rename to jedis-1.4 since that’s the earliest working version
Also change instrumentation binding for better coverage.
2018-02-23 13:04:46 +10:00
Tyler Benson f4d2e6f600 Merge branch 'master' into jedis 2018-02-22 16:44:44 +10:00
Tyler Benson 574ba6d954
Merge pull request #237 from DataDog/tyler/set-timeout
Set timeouts on all the tests.
2018-02-22 13:16:04 +10:00
Tyler Benson 903248ddf2 Set timeouts on all the tests. 2018-02-21 12:09:57 +10:00
Tyler Benson a3a70e6ea3 Remove unneeded dependency on dd-trace-ot. 2018-02-21 12:08:05 +10:00
gihad 44dd384648 reusing declared values to make tests more roboust 2018-02-18 08:38:47 -05:00
gihad 692b6e7508 removed tabs for spaces 2018-02-18 08:24:54 -05:00
gihad 3613b9bd7d removed unused import 2018-02-17 22:35:45 -05:00
gihad 7c42e2e791 Added jedis instrumentation integration tests with embedded redis 2018-02-17 21:30:18 -05:00
Andrew Kent c118e1b73d Move SpringBootBasedTest to package folder. 2018-02-16 13:42:27 -08:00
Andrew Kent c6e883e042 Move bootstrap prefixes to classloader matcher 2018-02-15 19:17:19 -08:00
Andrew Kent 64e2173bf7 Set bootstrap delegation for osgi classloading 2018-02-15 19:17:19 -08:00
Andrew Kent 1820fbcbfd Bootstrap delegation for wildfly/jboss 2018-02-15 19:17:19 -08:00
Andrew Kent d0982ada9d Skip unsafe classloaders. 2018-02-15 19:17:19 -08:00
Andrew Kent 4a1db505db Enhance logging and cleanup. 2018-02-15 19:17:19 -08:00
Andrew Kent dd19b07017 Spock classloading tests 2018-02-15 19:17:19 -08:00
Andrew Kent a692d42d3c Move DatadogClassloader to bootstrap 2018-02-15 19:17:19 -08:00
Andrew Kent a28a7abd4e Run api classes on bootstrap and core agent on custom classloader 2018-02-15 19:17:19 -08:00
Andrew Kent cfef64b026 Reorganize dd-java-agent subprojects 2018-02-15 18:55:02 -08:00
Tyler Benson c9da16f334 Add resource naming instrumentation for jax-rs 2018-02-14 19:18:01 +10:00
Gihad Murad fb7a81c2bd Removed unused tag, extended Instrumenter.Configurable (disabled by default) 2018-02-13 17:56:36 -05:00
Gihad Murad 7e82985d3c Merge branch 'master' into jedis 2018-02-13 11:58:14 -05:00
Tyler Benson 3ec70ac026 Add instrumentation for spring error handling
Also add additional tests for spring boot
2018-02-13 09:07:53 +10:00
Tyler Benson 1069922233 Add additional tags for aws requests 2018-02-08 15:12:17 +10:00
Tyler Benson 3e57a7a7ea Move servlet tests to individual modules. Fix servlet 2 instrumentation.
Turns out we weren’t actually servlet 2 compatible.  That should be fixed now.  Unfortunately it appears servlet 2 also doesn’t expose the http response code, so we aren’t able to set it as a tag without custom instrumentation for each framework.

I also removed our log4j2 stuff since we’re using logback.
2018-02-08 09:27:04 +10:00
Tyler Benson 1bfceb0d53 Use Field.ERROR_OBJECT instead of string 2018-02-07 12:02:10 +10:00
Andrew Kent b557776bcf
Merge pull request #217 from DataDog/tyler/ipv4-string
Use string instead of int representation for IPv4
2018-02-06 09:25:20 -08:00
Tyler Benson 0ca6082a6e Use string instead of int representation for IPv4 2018-02-06 17:30:44 +10:00
Tyler Benson a311d5f57d Change AWS instrumentation to use constructor
Instead of requiring the builder.
2018-02-06 15:01:50 +10:00
Tyler Benson 7d28a32fba Allow instrumentation to be disabled
By default, instrumentation is enabled, and can be disabled by default by overriding the `defaultEnabled` method. Instrumentation can also be disabled individually or enabled when default is disabled.
2018-02-06 11:20:05 +10:00
Andrew Kent bff9ae2f4e Disable Kafka Instrumentation 2018-02-05 10:42:48 -08:00
Gihad Murad 1d35938996 Merge branch 'master' into jedis 2018-02-05 13:00:13 -05:00
Gihad Murad cef86291e3 Added Redis instrumentation via Jedis client 2.9 and changed spring-boot-jdbc to spring-boot-jdbc-redis 2018-02-05 12:59:42 -05:00
Andrew Kent d703095717 Patch getLogger calls to safe logger. 2018-02-04 12:09:11 -08:00
Tyler Benson 4314f71ab7 Kafka and Kafka Streams instrumentation
This includes propagation and traces for producers and consumers.
2018-02-01 20:04:40 +10:00
Andrew Kent 6f088ddd53 Remove trace decorator yaml config 2018-01-31 16:13:41 -08:00
Andrew Kent 8d53e4703d Set span.type for all integrations. 2018-01-31 16:13:41 -08:00
Andrew Kent 228f896bb6 Move default decorators to code 2018-01-31 13:18:28 -08:00
Andrew Kent 13b0df8aca Apply default decorators in unit tests 2018-01-31 12:22:43 -08:00
Andrew Kent 7920cc9d8e Set span.type tag 2018-01-31 12:22:43 -08:00
Tyler Benson 13c774e7ff Fix AWS integration
Handler was being added on builder return, which was too late.  It appears it would have also failed if an existing handler resulted in a unmodifiable list to be returned.
2018-01-31 10:18:51 +10:00
Tyler Benson 29ffdf7354 Change escape sequence since SQS doesn’t like $ characters. 2018-01-31 08:14:02 +10:00
Tyler Benson c1f73c194e Prevent headers from being added for AWS client calls 2018-01-30 11:20:17 +10:00
Andrew Kent 140c3add96
Merge pull request #205 from DataDog/ark/aws_base_instrumentation
aws base instrumentation
2018-01-25 17:55:41 -08:00
Andrew Kent d731789d38 Remove copy-paste from spring and trace instrumentation 2018-01-25 09:47:14 -08:00
Andrew Kent 839ed9f0cb Use a thread-safe synchronized weak hash map. 2018-01-25 09:47:14 -08:00
Andrew Kent f5d1eef72a Match All AWS Builder subclasses.
Match All AWS Builder subclasses. Also fix bug of potentially
replacing configure request handlers when we add the dd request handler.
2018-01-25 09:39:43 -08:00
Andrew Kent 09d4cc4f6d Use datadog prefix to configure test logger. 2018-01-24 14:01:23 -08:00
Tyler Benson ce9e5dd3de Reenable java 7 and 9 CI
Also try to make it so builds can be rerun independently by not using the workspace.
2018-01-23 15:54:05 -05:00
Tyler Benson 6fbe494934 Exclude tests that are Java 9 incompatible. 2018-01-23 14:59:10 -05:00
Andrew Kent c056a910c2
Merge pull request #199 from DataDog/ark/fix_perftest
Perf test main class rename
2018-01-23 08:58:23 -08:00
Andrew Kent 255309791d Perf test main class rename 2018-01-22 17:54:11 -08:00
Tyler Benson 9acbe5710e
Merge pull request #198 from DataDog/tyler/update
Update dependencies
2018-01-22 16:47:50 -05:00
Andrew Kent b0737e6a88
Merge pull request #196 from DataDog/ark/log_exception_handler
log exception handler
2018-01-22 12:52:57 -08:00
Ark 2d937d89c8 Exception Handler Tests 2018-01-22 12:19:55 -08:00
Ark 157801d742 Custom ByteBuddy advice exception handler 2018-01-22 12:19:55 -08:00
Tyler Benson 53a575dc74 Update dependencies 2018-01-22 15:08:28 -05:00
Tyler Benson 64d39030e5 Use workflows in Circle to test Java 7 and 8
Java 9 is commented out because there are some test failures that will be investigated later.

Some tests had to be excluded from Java 7 because they don’t have a Java 7 compatible version.
2018-01-22 13:46:50 -05:00
Tyler Benson f0d333c2ec Defend against potential NPEs
If `HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE` happens to be missing.
2018-01-19 15:48:12 -05:00
Tyler Benson 111c5ee689 Fix wrong class name being injected 2018-01-17 15:09:42 -05:00
Andrew Kent 11a2d3bdd4 Fix helpers for httpclient, and servlet3 2018-01-16 16:10:28 -05:00
Tyler Benson d68b9703fb Ensure helper classes are injected in a fixed order
This is important if they depend on each other. If the child loads first, the parent could get loaded on the wrong classloader before itself gets injected.
2018-01-16 15:12:34 -05:00
Tyler Benson b2b61e0c8c Changes required for supporting OT 0.31.0
Also updates all the contrib versions that we currently depend on to their 0.31.0 supporting versions.
2018-01-16 09:52:28 -05:00
Tyler Benson 6d3d88987b Rename dd-trace-annotations to dd-trace-api
And move DDTags over to it.
Move some `datadog.trace.api` classes over to `datadog.trace.common`.
Other misc renaming.
2018-01-09 10:07:36 +10:00
Tyler Benson becf2a5862 Lots of renaming
Module:
dd-trace -> dd-trace-ot

Packages:
Standardize on `datadog.trace` and `datadog.opentracing` as the package prefixes.
2018-01-09 10:02:06 +10:00
Tyler Benson eeb17c4522 Move @Trace and JDBC instrumentation to individual modules 2018-01-04 16:20:26 +10:00
Andrew Kent f1fa1370f9
Merge pull request #180 from DataDog/ark/macro-benchmarks
macro benchmarks
2018-01-02 14:04:13 -08:00
Tyler Benson 596a1abc65 Fix types for Intellij
Idea doesn’t like the vararg representation of `TypeDescription.Latent`.  Using an empty list is the same behavior and doesn’t get the errors.
2018-01-03 07:27:46 +10:00
Andrew Kent 905bdb1cc1 sleepTimeMS -> workTimeMS 2018-01-02 12:17:18 -08:00
Andrew Kent 9de6417f87 Allow for run-perf-test.sh custom settings. 2018-01-02 12:17:18 -08:00
Andrew Kent feab10ad9f Update benchmark-integration instructions 2018-01-02 12:17:18 -08:00
Andrew Kent ef3ba8be60 Move dd-java-agent-perftest to dd-java-agent subproject. 2018-01-02 12:17:18 -08:00
Andrew Kent 1a80e4457d Remove unused listener option 2017-12-28 09:46:58 -08:00
Andrew Kent d315f43dad Remove AgentTestRunner custom classloader.
BytebuddyAgent install already handles class retransformation, make
the custom classloader redundant.
2017-12-28 09:46:58 -08:00
Andrew Kent 1c08933bc7 AgentTestRunner doc 2017-12-28 09:46:58 -08:00
Andrew Kent d0658085bf Convert Cassandra IntegrationTest to AgentTestRunner+spock 2017-12-28 09:46:58 -08:00
Andrew Kent ca574071ff New AgentTestRunner to auto-instrument spock tests 2017-12-28 09:46:58 -08:00
Andrew Kent 9d79531f59 Move bytebuddy agent setup into tooling 2017-12-28 09:46:08 -08:00
Andrew Kent 99442cdca7 Agent Testing Project 2017-12-28 09:46:08 -08:00
Andrew Kent 981e660b5e Only add integration dependencies when building agent shadowJar 2017-12-28 09:46:08 -08:00
Andrew Kent 5701601ad9 Fix potential flicker for jms2 test 2017-12-27 18:01:11 -08:00
Tyler Benson eca6d89591 Fix flickering test. 2017-12-26 12:39:09 -08:00
Tyler Benson 5dda6844a5 Change point where servlet instrumentation is applied
This new point will capture responses returned by filters, not just the servlet target.
2017-12-26 12:27:39 -08:00
Tyler Benson 02460060bc Misc cleanup
Remove out of date “async-tracing” example since it’s more about byteman and no longer relevant.

Minor changes to improve the code test coverage…
2017-12-21 16:31:03 -08:00
Tyler Benson 4822c19c5d Remove legacy config references. 2017-12-21 16:28:18 -08:00
Andrew Kent 5acd650efe
Merge pull request #174 from DataDog/ark/instrumentation_modules
Move Helper Classes into their specific instrumentation modules
2017-12-19 17:24:19 -08:00
Tyler Benson d6056a3c27 Fix jersey servlet instrumentation which overrides method
Jersey doesn’t seem to delegate to the original method on HttpServlet, which causes those methods to not be traced properly.

This is impacting dropwizard applications which uses Jersey with embedded Jetty.
2017-12-19 16:53:58 -08:00
Andrew Kent faf63bac9d Don't load classes on agent classloader during injection 2017-12-19 16:52:10 -08:00
Andrew Kent 75edd2bee4 Initialize AgentVersion classes in global tracer init 2017-12-19 16:00:03 -08:00
Andrew Kent f5ecd47379 Remove dead code 2017-12-19 09:06:38 -08:00
Andrew Kent e9b6f5278d Initialize GlobalTracer in TracingAgent 2017-12-19 09:06:38 -08:00
Andrew Kent 069f481884 Don't inject helpers into the same classloader twice 2017-12-18 16:44:12 -08:00
Andrew Kent 887a864118 Automatically pull integrations into the agent 2017-12-18 16:44:12 -08:00
Andrew Kent f68406113a Remove helpers from agent 2017-12-18 16:44:12 -08:00
Andrew Kent 0abf3f342d Use HelperInjector to include instrumentation helper classes.
Move instrumentation helpers out of helpers subproject and into the
appropriate instrumentation module.
2017-12-18 16:44:12 -08:00
Andrew Kent 876ea794e9 Helper Injector Transformer 2017-12-14 18:40:40 -08:00
Andrew Kent 5a57623fb6 Helper Injection test 2017-12-14 18:40:40 -08:00
Andrew Kent b5c2a3af63 reuse class file locator for DDAdvice 2017-12-14 18:40:40 -08:00
Andrew Kent 7f643ab680 Move jar utils to TestUtils 2017-12-14 18:40:40 -08:00
Andrew Kent 9d933d2109 Skip c3p0 proxy classes. 2017-12-11 08:17:59 -08:00
Andrew Kent 95550ac9d6 Save connection info after connection construction. 2017-12-11 08:17:59 -08:00
Andrew Kent 28bc1e703e
Merge pull request #172 from DataDog/tyler/benchmark
Improve benchmarks to highlight more interesting differences
2017-12-10 08:20:37 -08:00
Andrew Kent 9fbe70228f
Merge pull request #171 from DataDog/ark/tracer_init
init global tracer in premain
2017-12-10 08:09:04 -08:00
Tyler Benson e6895e4f6c Improve benchmark and caching optimizations. 2017-12-08 19:17:59 -08:00
Andrew Kent b231306f57 init global tracer in premain 2017-12-08 16:56:43 -08:00
Andrew Kent 394f36d700 Fix idea compile for mongo modules 2017-12-08 14:15:36 -08:00
Tyler Benson 003b7d1caf Extract test classes for benchmark testing. 2017-12-08 12:58:46 -08:00
Andrew Kent 42832e77f5 Add agent's classloader to default instrumentation location strategy
The transformer needs the agent's classloader to resolve advice
classes at transform time. Also stop using reflection to register classloads.
2017-12-08 09:40:14 -08:00
Andrew Kent 6a646009fa Test system class sibling classloader
Test cases where the classloader of the instrumented class cannot
resolve agent advice classes.
2017-12-08 09:34:16 -08:00
Andrew Kent 34791bbdbf Move common instrumentation advice settings into DDAdvice 2017-12-08 09:34:16 -08:00
Tyler Benson 6f985c15bf Remove Byteman now that instrumentation is migrated
At some point, we should refactor the managers since this leaves them in an awkward state.
2017-12-07 13:11:26 -08:00
Tyler Benson 2e6ff44976 misc cleanup 2017-12-07 12:06:58 -08:00
Tyler Benson d933a4049a Move OkHttp instrumentation to byte buddy 2017-12-06 18:07:17 -08:00
Tyler Benson f807a5da18
Merge pull request #163 from DataDog/tyler/jmh-retransform
Add JMH Benchmarks
2017-12-06 08:04:07 -08:00
Tyler Benson 78210d6e42 Add additional cases for benchmarking. 2017-12-05 16:10:29 -08:00
Tyler Benson caf3953360 Add JMH Benchmarks 2017-12-04 17:30:54 -08:00
Andrew Kent 6fa303058f ApacheHttpClient bytebuddy instrumentation and tests. 2017-12-01 10:54:32 -08:00
Andrew Kent b6d9c13d0c Make cassandra matching stricter 2017-11-29 09:11:31 -08:00
Tyler Benson 3ea7ad73ed Fix version scan plugin
Now you can run `./gradlew :dd-java-agent:integrations:datastax-cassandra-3.2::scanVersionsReport -PshowClasses` to show you the classes you can use for that version range.
2017-11-28 18:34:56 -08:00
Andrew Kent 7298b0a31a Convert datastax cassandra instrumentation to bytebuddy 2017-11-28 17:01:04 -08:00
Andrew Kent 47b1eec6da Mongo Async Instrumentation and embedded mongo tests. 2017-11-27 09:18:49 -08:00
Andrew Kent 86a76ec588 Convert Mongo instrumentation to ByteBuddy 2017-11-27 09:18:49 -08:00
Tyler Benson 9ba647a2ac Add instrumentation for MessageListener 2017-11-17 16:02:09 -08:00
Tyler Benson 871ce37f80 Migrate JMS to Byte Buddy and add JMS 1 support
This does not yet include instrumentation for MessageListener.
I think there is actually no difference between the instrumentation so we should combine them.
I also added TEXT_MAP as a format that maps to the HTTP Codec.  There is some remapping inside the instrumentation to remove dashes before setting as a property.  This should also be changed when an official format is defined.

This also currently has a problem with Spring Boot applications as the JMS Util references classes not on the system classpath (it needs to be injected into the child classpath)
2017-11-17 12:06:30 -08:00
Andrew Kent b85b9b0c5d drop opentracing-mongo dependency 2017-11-13 10:34:07 -05:00
Andrew Kent dd8f71e164 MongoHelper query scrubber test 2017-11-13 10:34:07 -05:00
Andrew Kent 9cb097b783 Replace TracingCommandListener with DDTracingCommandListener 2017-11-13 10:34:07 -05:00
Tyler Benson ff4f39779e Fix transitive dependencies
New instrumentation was bringing in their dependencies into the jar, resulting in a much larger jar file.  This should resolve that.
2017-11-10 11:45:00 -05:00
Tyler Benson 66355feddb
Merge pull request #148 from DataDog/tyler/remove-super-matchers
Migrate expensive integrations using super matchers to byte buddy.
2017-11-10 09:42:48 -05:00
Tyler Benson 51f903acd6 Ensure helpers are injected on a classloader that has instrumented code. 2017-11-09 15:34:05 -05:00
Tyler Benson 294320acb5 Add exception handling and supression for advice.
Also centralize classloader matching.
2017-11-09 14:45:03 -05:00
Tyler Benson f61935452b Handle case where SQL is not saved in map properly.
Otherwise this could result in an NPE.
2017-11-08 14:54:32 -05:00
Tyler Benson e96c084b51 Migrate aws instrumentation to byte buddy. 2017-11-06 14:25:28 -08:00
Tyler Benson e5924b3fe9 Migrate servlet instrumentation to byte buddy. 2017-11-06 11:28:06 -08:00
Tyler Benson 4199d123c2 Better null handling for JDBC instrumentation
This also reduces the log noise for transformation issues around synthesized classes.
2017-11-01 11:30:05 -07:00
Tyler Benson e8bbc849bb Set resource name using the route pattern from spring.
This provides a better static resorce name than trying to conjure one out of the original URL.
2017-10-30 13:24:18 -07:00
Tyler Benson cacba43435 Use byte buddy for @Trace instead of byteman. 2017-10-26 14:45:16 -07:00
Tyler Benson 25029b4109 Add integration tests for in-memory jdbc drivers. 2017-10-25 10:37:37 -07:00
Tyler Benson 14b834a358 Ignore generic classes and proxy classes 2017-10-25 10:36:37 -07:00
Tyler Benson 0d64192d91 Set resource name and span type correctly. 2017-10-24 10:28:53 -07:00
Tyler Benson ef5481cc27 Change operation name and set service name. 2017-10-24 10:28:53 -07:00
Tyler Benson b40bcf9973 Add automatic instrumentation for JDBC
This instrumentation creates spans for Statements and PreparedStatements. It also captures the corresponding SQL and additional connection info.  ResultSet could be considered for future instrumentation to capture even more of the DB interaction time.

This integration uses Bytebuddy instead of Byteman as the many methods to instrument would have been messy in Byteman.
2017-10-24 10:28:53 -07:00
Tyler Benson 423b701049 Downgrade byteman library to non-beta version.
This is in effort to reduce some performance problems.
2017-10-24 08:15:37 -07:00
Tyler Benson f2d1f0c209 Capture and report errors and stacktraces 2017-10-13 16:32:13 +02:00
Tyler Benson af5ef5e624 Fix name overloading confusion.
references to entries below were using the wrong instance and thus not being cleaned properly.
2017-10-13 14:08:03 +02:00
Tyler Benson 33308eff80 Change visibility to protected
This should bypass an issue with the parent class being loaded on a different classloader, resulting in an IllegalAccessError.
2017-10-10 16:02:43 -04:00
Tyler Benson cfe36d03a8 Fix headers to match standard DD trace headers
Also prevent NullPointerExceptions in servlet handler if active span somehow missing.
2017-09-27 07:44:43 -07:00
Tyler Benson cffde51b9e Add funky locking to ensure consistent execution for jetty test. 2017-09-21 13:47:28 -07:00
Tyler Benson fb133c8905 Update servlet operation name. 2017-09-21 08:12:44 -07:00
Tyler Benson 30721d00dc Replace tomcat/jetty specific integ with generic servlet integ.
This should also work with things like Weblogic and Websphere with the main requirement being Servlet 2.3 or above compatibility.
2017-09-20 16:39:43 -07:00
Tyler Benson 19af7840fb Adjust logging a bit more. 2017-09-19 10:53:14 -07:00
Tyler Benson 9c39bb64ae Fix aws version in readme, add finals and reformatting 2017-09-18 10:49:08 -07:00
Tyler Benson 4b26b787b8 Improve error logging for defineClass 2017-09-18 10:33:25 -07:00
Tyler Benson b430eedb27 Prevent NPE for double registrations
When using jetty with spring boot, the helper is being called more than once, the second time resulting in null being returned by `addFilter`.  This should prevent an error from being thrown.
2017-09-13 13:00:25 -07:00
Tyler Benson 0b1c7f022a Helper classes also need the slf4j relocation treatment. 2017-09-12 16:02:33 -07:00
Tyler Benson 4e106679a7 Move packages around and rename dd-trace inside agent
This avoids conflicts if the user already has dd-trace included in their app.
2017-09-11 15:00:00 -07:00
Tyler Benson 3bc153241b Abstract core dependencies for central management 2017-09-07 16:38:21 -07:00
Tyler Benson 62c167de16 Inject helper classes into application’s classloader
This is important for things like Spring Boot’s executable jar classloader which keeps all the jars individually rather than on the system classloader.
2017-09-06 11:08:28 -07:00
Tyler Benson c652aa262c Remove dependency on OpenTracing Agent
It brings in a bunch of duplicate and unnecessary dependencies since it also bundles them in its’ jar.  Copying the OpenTracingHelper class to our repo until we can refactor it away.  It also is Apache 2 licensed so I think we should be ok.
2017-09-05 16:48:22 -07:00
Tyler Benson 3df63d9e53 Split up manager responsibility by job
`TraceAnnotationsManager` is responsible for generating the rules for `@Trace`ed methods, `InstrumentationRulesManager` is responsible for our custom built Integrations.
2017-09-05 13:52:11 -07:00
Tyler Benson a8908c06d8 Move helpers to a separate project for future bundling
This will allow us to eventually inject these classes in the correct classpath rather than having them on the system classpath.
2017-09-05 12:19:22 -07:00
Tyler Benson 8ba3c0f156 Fix jacoco for integration tests
Also change slf4j package since it’s important for configuring log levels.
2017-09-05 11:43:37 -07:00
Tyler Benson b85b7aed1d Turns out Byteman doesn’t like $this as a reference
Their docs were misleading.

Also fix the readme’s maven dependency.
2017-09-01 14:22:34 -07:00
Tyler Benson ec08b37757 Use package-renamed Simple SLF4J logger
This will prevent us from respecting any existing SLF4J implementation and just print to the console.  This is important for things like Spring Boot that never put a SLF4J implementation on the system classpath, but instead keep it inside the jar.
2017-08-28 14:57:46 -07:00
Tyler Benson a0d4f2ca76 Report version from main
This allows running the agent as an executable jar to report the version number.

Also repot version scan errors better.
2017-08-28 13:39:19 -07:00
Tyler Benson 9a9da92b59 Add version checking via class/method for jetty 2017-08-24 17:38:16 -07:00
Tyler Benson 59d1be4ea7 Merge pull request #112 from DataDog/tyler/version-verify
Add version scan verification and test in CI
2017-08-24 17:20:48 -07:00
Tyler Benson 1b63a53167 Add version scan verification and test in CI 2017-08-24 17:15:22 -07:00
Tyler Benson 82a9c73c6b Merge pull request #111 from DataDog/tyler/servlet-async
Mark servlet trace filter as async supported
2017-08-24 07:47:15 -07:00
Tyler Benson 233d241e07 Mark servlet trace filter as async supported 2017-08-23 16:01:42 -07:00
Tyler Benson ab7598804e Update dropwizard and spring boot readmes. 2017-08-23 15:35:55 -07:00
Tyler Benson 9ff937557e Ensure rules are loaded on the right classpath for Spring Boot 2017-08-23 14:30:18 -07:00
Tyler Benson db2758af19 Merge branch 'master' into tyler/versions
# Conflicts:
#	dd-java-agent/src/main/java/com/datadoghq/trace/agent/InstrumentationChecker.java
2017-08-23 09:08:40 -07:00
Tyler Benson 55edba486a Order rules alphabetically and ensure matches. 2017-08-22 17:25:45 -07:00
Tyler Benson 34f0922740 Add property to gradle.properties for easier debugging
When using a jar with packages renamed, the line numbers don’t match the classes in the IDE.
2017-08-22 17:23:28 -07:00
Tyler Benson 60cfb392c4 Fix grouping so any rule can allow module to be active. 2017-08-22 10:33:24 -07:00
Guillaume Polaert 1086439da8 log as info level 2017-08-22 15:32:58 +02:00
Guillaume Polaert 78c99f4574 Add more logs to debug 2017-08-21 14:58:08 +02:00
Tyler Benson aad3746c2b Fix tests 2017-08-18 11:12:06 -06:00
Tyler Benson 988a3d0fdf Cleanup plugin and add identifying classes to config
Still missing jetty since that requires method level searching.
2017-08-18 11:11:37 -06:00
Tyler Benson 860df9856c Enable instrumentation to scan for classes for version matching 2017-08-18 11:11:37 -06:00
Tyler Benson 03ca35426c Convert InstrumentationCheckerTest to Spock 2017-08-18 11:11:37 -06:00
Tyler Benson 9b73fed3c5 Add plugin that scans for classes unique to version range
Does not include method signatures yet.  Still a work in progress.

Execute with `./gradlew scanVersions --parallel`.
Using `--parallel` is strongly recommended.
2017-08-18 11:11:37 -06:00
Guillaume Polaert 2f65e93167 Remove OTARULES from OT agent 2017-08-16 11:16:12 +02:00
Tyler Benson 5dff2f1249 Rename google and byteman dependencies
But exclude the ones that cause the tests to fail.
Also add a test to verify the correct version of guava is loaded with the agent running.
2017-08-08 12:29:14 -07:00
Emanuele Palazzetti f1f112ff5a Merge pull request #79 from gpolaert/resource-name
[servlet] resource name for HTTP frameworks
2017-08-03 13:03:50 +02:00
Tyler Benson effe6e8b04 Remove pom dependencies for shadow artifacts. 2017-08-02 12:48:48 -07:00
Emanuele Palazzetti c5c750bd49
[elasticsearch] remove auto instrumentation; will be added later 2017-08-02 17:42:01 +02:00
Guillaume Polaert d46099cbd9 adding tests 2017-08-02 14:22:20 +02:00
Guillaume Polaert 78b2faf03b typo 2017-08-02 13:38:14 +02:00
Guillaume Polaert aef9ebec9a change span.type value 2017-08-02 13:35:37 +02:00
Guillaume Polaert 16aba0ac7a [servlet] change the resource name for servlet integration (404 grouping) 2017-08-02 11:17:05 +02:00
Guillaume Polaert 402e4978e2 [core] cosmetics 2017-08-02 11:07:59 +02:00
Tyler Benson b371b59ce2 Don’t exclude the wrapper jar 2017-08-01 15:09:51 -07:00
Tyler Benson c5f57151c0 Use a factory to create TracingCommandListener
This bypasses the inexplicable change in visibility of the constructor.
2017-08-01 11:44:29 -07:00
Emanuele Palazzetti e236f44b12 [mongo] update the db.statement tag to use the quantized query 2017-08-01 12:28:28 +02:00
Tyler Benson 61c3729f72 Attempt to load config files with both `yaml` and `yml` suffix 2017-07-31 13:08:58 -07:00
Guillaume Polaert dad74d0c63 more robust and recursive 2017-07-28 13:47:56 +02:00
Guillaume Polaert 58cb653d41 improving the normalizer 2017-07-28 12:36:24 +02:00
Guillaume Polaert e830e1b7e6 fix the operation name 2017-07-28 09:20:40 +02:00
Guillaume Polaert f20ed93741 formatting 2017-07-28 09:20:40 +02:00
Guillaume Polaert 7dc170cc6f mongo helper for norm 2017-07-28 09:20:32 +02:00
Guillaume Polaert 864db966f1 Close span when exception exit (#66) 2017-07-27 21:09:25 +02:00
Kent Shultz f3e55d2d69 Update documentation (#67) 2017-07-27 21:08:35 +02:00
Guillaume Polaert a58f797fd1 moving files to dd-trace 2017-07-24 13:41:40 +02:00
Guillaume Polaert 7c5fd24a14 Moving decorators config to the dd-trace project + default service name 2017-07-24 13:36:44 +02:00
Tyler Benson 8e4e9fe0ac Clean up version and include git sha in reported number
Exclude lombok from being included in the shadow jar.
2017-07-21 08:52:17 -07:00
Tyler Benson 8f794f8364 Merge pull request #59 from DataDog/tyler/shadow-artifacts
Fix jar uploading to use shadow jar instead of unbundled jar
2017-07-20 10:11:12 -07:00
Tyler Benson 02d8f153a6 Fix jar uploading to use shadow jar instead of default
Rename default jar to be explicit that no dependencies are embedded.
2017-07-20 09:58:22 -07:00
Tyler Benson d6271d866e Use lombok @Slf4j annotation for declaring loggers 2017-07-19 11:24:41 -07:00
Guillaume Polaert e80b7580c8 Refactoring the logging, use slf4j 2017-07-19 08:16:42 -07:00
Tyler Benson 8420855deb Apply some additional inspections and quick-fixs 2017-07-19 08:09:19 -07:00
Tyler Benson e8dbc34bea Apply consistent formatting to other files 2017-07-19 08:09:19 -07:00
Tyler Benson e1696aeee0 Update link that will automatically download the latest version 2017-07-18 15:53:53 -07:00
Tyler Benson f48f2bbc53 Add link to snapshot repo for beta. 2017-07-18 09:21:45 -07:00
Tyler Benson 24bcb929c4 Merge branch 'master' into gpolaert/es 2017-07-17 11:28:09 -07:00
Guillaume Polaert b5051ae7c0 Disabling ES because the contribution throws a NPE. Waiting for the 0.0.3 release of the ES contrib (it's fixed) 2017-07-13 12:09:21 +02:00
Guillaume Polaert 4edff21599 Add test and support for ES 2017-07-13 11:18:19 +02:00
Tyler Benson 232801ab62 Another pass on improving the docs 2017-07-12 14:30:08 -07:00
Tyler Benson 2d89ee0d54 Apply automatic formatting
via `./gradlew googleJavaFormat`
2017-07-12 07:47:19 -07:00
Tyler Benson d2009ef9da Fix excludes by adding group 2017-07-11 17:12:27 -07:00
Tyler Benson 840ada4650 Enable uploading to local artifactory. 2017-07-11 17:12:27 -07:00
Tyler Benson 8d9bdef4b7 Rename build.gradle scripts to match project name.
This will help in finding build scripts inside the IDE.
2017-07-10 16:12:15 -07:00
Tyler Benson b422ec7663 Apply minimum code coverage assertions
Improved the test coverage slightly in the process.
2017-07-10 14:24:11 -07:00
Tyler Benson 95c7a5ac08 Finish updating gradle and remove maven pom's. 2017-07-06 15:56:32 -07:00
Tyler Benson ca36e9fbc1 Exclude java 9 compiled files from shadow jar. 2017-07-06 12:10:14 -07:00
Guillaume Polaert 78cd9d118d Shading shades too much things (OT Agent for instance) 2017-07-06 11:23:37 +02:00
Guillaume Polaert 73ab3d36ab Keep sync Maven and Gradle 2017-07-04 10:57:47 +02:00
Guillaume Polaert 399c4cab80 Merge branch 'master' into gpolaert/new-shading 2017-07-04 10:15:51 +02:00
Tyler Benson bf15a139d5 Remove tagsKV from @Trace annotation 2017-07-03 16:14:35 -07:00
Tyler Benson 07b23249d7 Merge pull request #27 from DataDog/tyler/add-gradle
Add gradle build scripts.
2017-07-03 10:40:05 -07:00
Guillaume Polaert a150548a72 CircleCi 2017-07-03 10:34:34 -07:00
Guillaume Polaert 1dc7d5a9b7 AutoService is used by the deps, need to compile with maven 2017-07-03 10:34:34 -07:00
Guillaume Polaert 359c0879f0 fix shapping issues and pom refactoring 2017-07-03 10:33:05 -07:00
Guillaume Polaert d3ce6b1a3e shading all stuff and removing from the scope all libs which can crash the app 2017-07-03 10:33:05 -07:00