Commit Graph

74 Commits

Author SHA1 Message Date
Tyler Benson d86cb51aaa Fix more tests and extract timeout values to constant 2020-03-16 09:10:06 -07:00
Tyler Benson 25464456d3 Add tests for http clients
- dropped request
- non-routable request
- https request

Unfortunately I wasn't able to figure out a clean way to test some of these scenarios without making a remote request.
I was also not able to configure everything consistently, so I had to disable that test for several integrations.
2020-03-13 15:05:16 -07:00
Anubhaw Arya 0344cff386 Remove hostname and port from HttpClientDecorator 2020-03-13 10:47:10 -07:00
Laplie Anderson 6411ee358f Remove Http*Decorators from method signatures in tests 2020-03-12 13:13:17 -04:00
Laplie Anderson 6cd530a541 Move decorators to bootstrap 2020-03-11 18:41:29 -04:00
Tyler Benson bd82166b58 Rename methods that don't require disambiguation. 2020-02-24 08:35:19 -08:00
Tyler Benson f70c35842d Move matchers to separate package and split matcher classes out 2020-02-24 08:31:12 -08:00
Nikolay Martynov b6d374e3a0 Avoid calling superclass matcher where possible
Saves about 100ms of startup time on test app
2020-02-21 15:08:39 -05:00
Laplie Anderson d45ead1284 split matching into safeExtendsClass and safeHasInterface 2020-02-19 21:22:17 -05:00
Laplie Anderson 9023c6e1c7 Fix a couple tests using the wrong arguments 2020-02-11 11:44:46 -05:00
Tyler Benson 51bffa2e8a Move agent api classes to bootstrap package so they're not analyzed by muzzle
Also move jdbc classes to bootstrap to reduce size and complexity of those reference checkers.

These changes reduce the total file size of these instrumentation classes by 635k, which should also result in decent memory savings.
2020-02-10 15:09:15 -08:00
Tyler Benson ded28674d3 Add option for muzzle validation on the specific JDK version
This is still useful to validate various aspects of the integrations even if it doesn't need to check against maven.
2019-12-18 13:40:19 -08:00
Trask Stalnaker 1987e86ebf Normalize tag verification order 2019-11-22 10:59:45 -08:00
dougqh 6b096c2240 Replacing Advice.class references
Replacing Advice.class references with string construction.

This stops the JVM from loading the Advice classes which are used as templates for byte buddy and doesn't ever need to be run directly.

This eliminates ~130 class loads at start-up -- and saves 0.5MiB in metaspace
2019-11-18 16:09:30 -05:00
Laplie Anderson 8a2594eeab Add "testCircularRedirects" option to HttpClientTest 2019-10-30 18:17:49 -04:00
Trask Stalnaker 86bd9793bd Switch to new Tags class in instrumetation 2019-10-24 21:05:00 -07:00
Trask Stalnaker 9182b64078 Switch to new Tags class in tests 2019-10-24 21:04:57 -07:00
Trask Stalnaker a9d3360701 Remove test dependency on GlobalTracer 2019-10-24 20:53:14 -07:00
Trask Stalnaker 45e8b7fdc5 Update http-url-connection to new agent api 2019-10-19 16:52:40 -07:00
Tyler Benson 2086664f6d Reduce overhead of URLAsResourceName decorator
Using `new URL()` just to parse the path out was rather expensive.  This should improve the situation.
2019-09-17 18:50:01 -07:00
Laplie Anderson 457410ea4e Run all tests on all java version 2019-09-03 13:03:16 -04:00
Laplie Anderson 9c5766162a Add test for ClassNotFound creating a span bug 2019-08-23 13:04:56 -04:00
Nikolay Martynov 63cd73e79e Remove obsolete check
We are no longer using UrlConnection to send traces
2019-08-14 16:46:31 -04:00
Nikolay Martynov b0ff861392 Do not trace openConnection for Datadog ClassLoader 2019-08-14 16:46:23 -04:00
Tyler Benson 95a294a560 Remove common (redundant) dependencies 2019-08-06 14:51:04 -07:00
Tyler Benson 9cdf049ca7 Extract ConfigUtils 2019-05-30 09:09:29 -07:00
Tyler Benson fc9f1d120c Misc fixes. 2019-05-29 13:54:35 -07:00
Tyler Benson e260b1d044 Make all http client tests extend HttpClientTest
Add flexibility to handle inconsistencies between client integrations.
2019-05-29 13:54:35 -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
Nikolay Martynov 6fd630831f Stop using `scopeManager().activate(span, true)` 2019-04-08 11:54:47 -04:00
Nikolay Martynov bfb48f31c1 Make sure span is opened and closed with scope in http_url_connection 2019-04-05 11:13:53 -04:00
Nikolay Martynov 3b0e769e88 Fix helper injection in context provider
Currently helpers will not be injected if instrumentation doesn't
apply. Unfortunately it is possible for some classes to have context
fields added even if instrumentation is not allied (i.g. instrumented
classes are not used). Fix this by always injecting all helpers if we
inject context fields.
2019-03-26 15:53:34 -04:00
Tyler Benson 50279d64fe Span type should only be an attribute and not inherited
Previously we were inheriting from the parent and also often setting as a tag.

Apply default span assertion to verify the spanType is being checked properly. (Include error state too.)
2019-02-28 12:39:51 -08:00
Tyler Benson 1644de3969 Migrate Jax-rs client instrumentation to Decorator 2019-02-27 09:40:08 -08:00
Tyler Benson 678df7b43d Migrate HttpURLConnection instrumentation to Decorator 2019-02-25 14:48:15 -08:00
Nikolay Martynov a46d6a2e8f Use config inheritance in `withConfigOverride`.
This moves us forward to abstract 'Config' and away from depending in
specific config data source (e.g. system properties).
2019-02-05 15:51:05 -05:00
Tyler Benson 6aa371d790 Encapsulate config override reflection 2019-02-05 11:30:07 -08:00
Tyler Benson 1a54e8179a Add setting to set service name by domain for http clients
This will allow better metric collection and identification of trends for individual services/hosts.

This is not enabled by default because it can result in a high cardinality of services.
2019-02-05 08:20:49 -08:00
Tyler Benson fe52180bfc Apply proper generic signature for Instrumenter.Default transformers()
Previously it was missing the MethodDescription portion.
2019-01-04 15:25:12 -08:00
Nikolay Martynov 0a3ecc1b90 Improve HttpUrlConnection instrumentation
Make sure we get one span per request
2018-12-04 16:54:48 -05:00
Nikolay Martynov 6f05cff023 Add test for UrlConnection error on file protocol 2018-11-15 12:31:42 -05:00
Tyler Benson cbb29069fe Apply component tag more consistently 2018-11-14 11:31:40 -08:00
Nikolay Martynov 98df97af3e First iteration on a better context store api
Separate context storage from actual fetching/putting
2018-11-02 10:46:57 -04:00
Andrew Kent 131074c255 Move InstrumentationContext api to bootstrap 2018-10-18 10:16:15 -07:00
Andrew Kent b02ed4e813 Initial Map-backed implementation and test 2018-10-17 15:29:59 -07:00
Andrew Kent 7330ceaf4e Instrumentation Context outline for HttpURLConnection as an example 2018-10-15 11:05:23 -07:00
Tyler Benson 432ce89a07 Add assertTraces to AgentTestRunner with implied argument
This will also help with auto complete when writing tests.
2018-10-15 10:19:00 +10:00
Nikolay Martynov f71192266c Rework the way multi-jvm tests work
To allow some JVMs runs only subset of tests
2018-10-02 13:20:19 -04:00
Nikolay Martynov a4cded9b4f Add some tests for distributed tracing in Tomcat and Jetty 2018-08-18 13:38:06 -04:00
Tyler Benson 3fc2738179 Improve test coverage and reduce duplication 2018-08-17 10:36:45 +10:00