Commit Graph

2543 Commits

Author SHA1 Message Date
Tyler Benson 54287fa548 Add comment and consistency. 2019-04-29 12:21:05 -07:00
Tyler Benson 6414de82d9 Add support for HystrixObservableCommand
This change is slightly breaking for existing hystrixCommand code since the resource name changes from run->execute and getFallback->fallback.  The fallback span is also now a child of the execute span.
2019-04-29 12:04:27 -07:00
Tyler Benson 25d109753d
Merge pull request #809 from DataDog/tyler/httpasyncclient
Add instrumentation for Apache HttpAsyncClient
2019-04-29 08:14:11 -07:00
Tyler Benson 68a68f1057 Ensure that http.url tag doesn’t have query params set
Make handling of it more consistent in decorator.
2019-04-26 09:48:34 -07:00
Tyler Benson 69e8aab4b1
Merge pull request #812 from DataDog/tyler/bb-upgrade
Upgrade Byte Buddy to 1.9.12
2019-04-26 08:01:44 -07:00
Tyler Benson 20df3aa18e Add HttpAsyncClient to Elasticsearch for verification. 2019-04-25 17:27:06 -07:00
Tyler Benson 179b9b69cb Upgrade Byte Buddy to 1.9.12
and a few other minor code changes.
2019-04-25 10:36:35 -07:00
Tyler Benson 9ad06a6791 Add instrumentation for Apache HttpAsyncClient
Extract http client tests to shared class.
2019-04-23 17:10:40 -07:00
Tyler Benson 03f44bd8b9
Merge pull request #807 from DataDog/tyler/exclude-config
Add config allowing classes to be excluded from transformation
2019-04-23 10:37:01 -07:00
Luca Abbati 8dd76debcc
Merge pull request #805 from DataDog/labbati/rebrand-priority-sampling
Rebrand priority sampling while being BC with legacy approach to set it
2019-04-23 18:18:23 +02:00
Luca Abbati 0d0fa55f21
Sort decorators factory list alphabetically 2019-04-23 11:52:37 +02:00
Tyler Benson 4c79f38a4d A couple other minor changes… 2019-04-19 10:41:13 -07:00
Tyler Benson ec91a75848 Add config allowing classes to be excluded from transformation
Add the following system property or corresponding environment variable:
```
dd.trace.classes.exclude=some.packagename.*,some.classname.MyClass$NestedClass
```
2019-04-19 10:41:13 -07:00
Tyler Benson 746c423199
Merge pull request #775 from darylrobbins/twilio
Twilio SDK Instrumentation
2019-04-19 09:18:40 -07:00
Luca Abbati 6e825afef2
Move from ForcedSampling tags to standard DDTags based tags 2019-04-19 16:21:35 +02:00
Luca Abbati 6cbdc2005e
Restore erroneously removed getTags method from span context 2019-04-19 10:42:36 +02:00
Luca Abbati 4faca0cf5a
Merge branch 'master' of github.com:DataDog/dd-trace-java into labbati/rebrand-priority-sampling 2019-04-19 09:54:11 +02:00
Luca Abbati 19e9fb83bb
Remove obsolete forced tracing method from span context 2019-04-19 09:20:17 +02:00
Tyler Benson 799db6581b
Merge pull request #798 from DataDog/tyler/peer-tags
Server tags should report peer, not self hostname/port
2019-04-18 10:49:34 -07:00
Luca Abbati d6a5255e8f
Keep tag decorators count in tests up to date 2019-04-18 14:22:09 +02:00
Luca Abbati fc5b72f86b
Fixed indentations based on google style rules 2019-04-18 13:17:21 +02:00
Luca Abbati 7e157e0561
Move implementation of manual sampling via tag from span to decorators 2019-04-18 13:11:33 +02:00
Tyler Benson 2acaeb3dfb Revert minor changes. 2019-04-17 16:23:15 -07:00
Luca Abbati 9b705fee2f
Fix code styles errors 2019-04-17 16:46:18 +02:00
Luca Abbati 762930bebd
Run code formatter 2019-04-17 15:19:10 +02:00
Luca Abbati bff7ac8174
Simplify business logic to set force tracing as a tag 2019-04-17 14:39:54 +02:00
Luca Abbati f92e2bbdf6
Rebrand priority sampling while being BC with legacy approach to set it 2019-04-17 14:31:39 +02:00
Tyler Benson e74941a4d5 Merge branch 'master' into twilio 2019-04-16 17:44:36 -07:00
Tyler Benson b9207133d6 Split async and sync advice and misc cleanup. 2019-04-16 13:56:44 -07:00
Daryl Robbins 315ae67fd2 Merge branch 'twilio' of github.com:darylrobbins/dd-trace-java into twilio
* 'twilio' of github.com:darylrobbins/dd-trace-java:
  Updates to handle async calls, which have broken all tests
  Missed Gradle file
  WIP Twilio SDK Instrumentation

# Conflicts:
#	dd-java-agent/instrumentation/twilio/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java
#	dd-java-agent/instrumentation/twilio/src/main/java/datadog/trace/instrumentation/twilio/TwilioInstrumentation.java
#	dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy

Merge branch 'twilio' of github.com:darylrobbins/dd-trace-java into twilio
Improved unit testing

* 'twilio' of github.com:darylrobbins/dd-trace-java:
  Updates to handle async calls, which have broken all tests
  Missed Gradle file
  WIP Twilio SDK Instrumentation

# Conflicts:
#	dd-java-agent/instrumentation/twilio/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java
#	dd-java-agent/instrumentation/twilio/src/main/java/datadog/trace/instrumentation/twilio/TwilioInstrumentation.java
#	dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy

Fix sleep times and choose Java7-friendly test dependencies

Corrected test assertion
2019-04-16 13:56:44 -07:00
Daryl Robbins 13aa267d84 WIP Twilio SDK Instrumentation
Missed Gradle file

Updates to handle async calls, which have broken all tests
2019-04-16 13:56:44 -07:00
Daryl Robbins e3d97b0984 WIP Twilio SDK Instrumentation
Missed Gradle file

Updates to handle async calls, which have broken all tests

Fixed instrumentation and augmented tests
2019-04-16 13:46:43 -07:00
Tyler Benson 0315c976af Fixes for ratpack. 2019-04-16 13:29:26 -07:00
Tyler Benson 216ecaa05e
Merge pull request #804 from DataDog/tyler/partial-flush-default
Set default value for partial trace flush to 1k
2019-04-16 10:57:26 -07:00
Tyler Benson b343fe4551 Split peer connection details different generic argument 2019-04-16 08:34:43 -07:00
Tyler Benson bf05984208 Server tags should report peer, not self hostname/port
Previously this was not obvious and incorrect.
2019-04-16 08:21:01 -07:00
Tyler Benson dc2e435de9
Merge pull request #797 from DataDog/tyler/ratpack
Update ratpack instrumentation and remove default disabled.
2019-04-16 08:14:10 -07:00
Luca Abbati 9bd741ca0b
Merge pull request #795 from DataDog/labbati/gclib-conflict
Make trace agent to work nicely with cglib library
2019-04-16 17:13:51 +02:00
Luca Abbati f4a17ba4c5
Remove tests that relied on inner knowledge of the class. Feature still tested with cglib test. 2019-04-12 17:12:50 +02:00
Luca Abbati ff021f34db
Add minor fixes to comments and typos as per code reviewer suggestions 2019-04-12 16:51:49 +02:00
Tyler Benson b872e7fa9b Set default value for partial trace flush to 1k
This should help reduce memory impact of large traces and reduce risk if scope is opened and never closed.
2019-04-11 14:40:44 -07:00
Luca Abbati c6863f0ca3
Use groovy class reference style in Spock tests 2019-04-11 16:06:46 +02:00
Luca Abbati e8435b165d
Fixed typo in comment 2019-04-11 15:49:10 +02:00
Luca Abbati 3a6fedda14
Add context getter/setter methods to an object only if not already defined
Class `FieldBackedProvider` uses ByteBuddy to add a field and its respective getters and setters to store the context object.
Assuming that we have a class `A` that implements runnable and that we wrap with a `FieldBackedProvider`
`Runnable` interfaces, if later on we use a cglib's `Enancher` class on `A` then the our mechanism will kick in again and try
to add the methods again. This causes a `java.lang.ClassFormatError: Duplicate method name "get__datadogContext$java$lang$Runnable" with signature "()Ljava.lang.Object;"`
to be thrown because CGLIB already copied over those methods from the original class `A` to the newly created class.

With this commit we now check that method were not previously defined before adding them, and if they were then we avoid adding them
again.

The reason why it wasn't faiing before is that we only checked on context field existence, not methods and cglib do not copy over fields, it copies only methods. E.g.

```
public class Main {

    public static class A {
        private String name = "hey";
        public String getName() {
            return this.name;
        }
    }

    public static void main(String[] args) {
        System.out.println("----- 'A' declared fields -----");
        A s = new A();
        for (Field f : s.getClass().getDeclaredFields()) {
            System.out.println("field: " + f.getName());
        }
        for (Method m : s.getClass().getDeclaredMethods()) {
            System.out.println("method: " + m.getName());
        }

        System.out.println("----- Proxy declared fields -----");
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(A.class);
        enhancer.setCallback((FixedValue) () -> null);
        A proxy = (A) enhancer.create();
        for (Field f : proxy.getClass().getDeclaredFields()) {
            System.out.println("field: " + f.getName());
        }
        for (Method m : proxy.getClass().getDeclaredMethods()) {
            System.out.println("method: " + m.getName());
        }
    }
}
```

Results in:

```
----- 'A' declared fields -----
field: name
method: getName
----- Proxy declared fields -----
field: CGLIB$BOUND
field: CGLIB$FACTORY_DATA
field: CGLIB$THREAD_CALLBACKS
field: CGLIB$STATIC_CALLBACKS
field: CGLIB$CALLBACK_0
field: CGLIB$CALLBACK_FILTER
method: equals
method: toString
method: hashCode
method: clone
method: getName
method: newInstance
method: newInstance
method: newInstance
method: setCallbacks
method: CGLIB$SET_STATIC_CALLBACKS
method: CGLIB$SET_THREAD_CALLBACKS
method: getCallback
method: getCallbacks
method: CGLIB$STATICHOOK1
method: CGLIB$BIND_CALLBACKS
method: setCallback
```
2019-04-11 15:45:43 +02:00
Tyler Benson c4ac5b94ec Fix span relationships and other review issues. 2019-04-10 17:31:22 -07:00
Nikolay Martynov 3b3f6856e3
Merge pull request #799 from DataDog/mar-kolya/fix-aws-instrumentation-warning
Fix AWS instrumentation warning in Idea
2019-04-09 16:00:04 -04:00
Nikolay Martynov e41769232e Fix AWS instrumentation warning in Idea
Idea complains about duplicates root because we run latest dep tests
and 'later version' tests from the same dir. This is ultimately
TestSetd plugin bug by the looks of it, but we can work around it by
swapping old and new version tests.

Also run both old and new version tests under 'test' task.
2019-04-09 10:50:07 -04:00
Tyler Benson a11b888d7a Update ratpack instrumentation and remove default disabled. 2019-04-08 18:26:08 -07:00
Tyler Benson cfef546823
Merge pull request #796 from DataDog/tyler/jmx-log-level
Fix JMXFetch log level
2019-04-08 17:14:14 -04:00
Tyler Benson 229e8ef51b Fix JMXFetch log level 2019-04-08 09:48:49 -07:00