Commit Graph

82 Commits

Author SHA1 Message Date
Laplie Anderson 6cd530a541 Move decorators to bootstrap 2020-03-11 18:41:29 -04:00
Tyler Benson 35e00686b3 Imply not(isInterface()) call for expensive matchers
Also remove from simple named("some.name") matchers to avoid metadata lookup.
2020-02-27 12:13:42 -08: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
Trask Stalnaker 8949d6c05f Make sure CallDepthThreadLocalMap is always reset 2020-02-20 16:53:57 -08:00
Laplie Anderson d45ead1284 split matching into safeExtendsClass and safeHasInterface 2020-02-19 21:22:17 -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 e440eba9a1 Enable Servlet request and response dispatcher instrumentation by default.
Change config for Servlet Filter and Service and JDBC DataSource instrumentation so it must be explicitly enabled (won't be enabled by accident if all of servlet is enabled).
2020-01-10 13:51:21 -08:00
Tyler Benson 43fbf28035 Revert "Remove experimental jdbc and servlet integrations until further evaluation"
This reverts commit 2432a92230.
2020-01-10 12:53:24 -08:00
Tyler Benson 7cb24f35c0 Better error handling for getClientInfo in JDBCDecorator
An exception there caused a span to be created but then never finished.
2020-01-08 15:10:54 -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
Tyler Benson 2432a92230 Remove experimental jdbc and servlet integrations until further evaluation 2019-11-06 11:45:00 -08:00
Tyler Benson 4f853f5f0c Rename config key for beta/experimental instrumentation.
Postfix the existing config names with `-beta` for `servlet` and `jdbc`.

To avoid any risk that the config was explicitly enabled for an unrelated reason resulting in unexpected behavior when upgrading to the latest version.
2019-11-04 13:41:33 -08:00
Tyler Benson a3a1467192 Add span when calling DataSource.getConnection with a trace.
Disabled by default, and only creates a span if existing trace detected.

To enable:
* System Property: `-Ddd.integration.jdbc.enabled=true`
* Environment Variable: `DD_INTEGRATION_JDBC_ENABLED=true`
(Or more specifically with `jdbc-datasource`.)
2019-10-25 16:02:39 -07:00
Trask Stalnaker 8c558fa00e Format 2019-10-24 21:05:01 -07:00
Trask Stalnaker e32bf1816a Organize imports 2019-10-24 21:05:01 -07: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
Tyler Benson a8ca47ed03 Skip spring controller and dropwizard trace if no trace present
Also prefer early return instead of deep nesting for null check.
2019-10-24 14:40:08 -07:00
Trask Stalnaker 308409f856 Update jdbc to new agent api 2019-10-19 16:52:41 -07:00
Tyler Benson 9ef3332140 Extract base test class and move Config class changes there. 2019-10-07 18:51:25 +02:00
Laplie Anderson 3323bbc5b1 java.sql classes are not always present 2019-09-04 13:11:03 -04:00
Laplie Anderson 457410ea4e Run all tests on all java version 2019-09-03 13:03:16 -04:00
Tyler Benson 95a294a560 Remove common (redundant) dependencies 2019-08-06 14:51:04 -07:00
Tyler Benson 747f758a70 Remove default instance
It’s not very interesting and breaks the definition of “instance” when we want to see the db name when no instance name is defined.
2019-07-15 12:52:57 -07:00
Tyler Benson 2c240754fc Additional testing for split-by-instance config
Some DB’s don’t define an instance, so verify the setting has no effect for them.
2019-06-14 10:08:17 -07:00
Tyler Benson a4d53b0dcd Update Cassandra Tests and more instance name cleanup 2019-06-13 15:55:40 -07:00
Tyler Benson 3c68c09101 Review fixes. 2019-06-11 11:12:50 -07:00
Tyler Benson 4469c7fb11 separate out driver subtype
to avoid changing existing service names
2019-06-10 16:17:36 -07:00
Tyler Benson 0807598d16 Populate settings from properties and add MariaDB alt styles 2019-06-10 12:02:14 -07:00
Tyler Benson ec60d679d6 Add Oracle support and fix muzzle. 2019-06-06 18:03:56 -07:00
Tyler Benson 6100443443 Attempt to properly parse out instance name from JDBC url
Unfortunately implementations are INCREDIBLY inconsistent on the matter.  Oracle implementation is still pending since it’s really complicated.
2019-06-05 18:01:33 -07:00
Tyler Benson d90a3c47ae Restrict derby version
Lastest version requires Java 9+, so we can’t test against it for now.
2019-03-11 14:26:58 -07: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 c46909e59f Migrate JDBC instrumentation to Decorator 2019-02-26 11:16:35 -08:00
Tyler Benson bbcd2f6949 Move other Utils to utils package 2019-02-05 11:43:05 -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
Tyler Benson 3ef347f00f Use safeHasSuperType instead of isSubTypeOf 2018-12-27 10:33:43 -08:00
Tyler Benson 471d8c4410 Properly capture callable statement queries
CallableStatement is a sub type of PreparedStatement.  Previously we were only matching methods that returned exactly PreparedStatement.
2018-12-21 14:03:33 -08:00
Tyler Benson 9bd2b86d2e Add assertion to ensure latestDepTest dependencies are different from test. 2018-11-12 08:15:24 -08:00
Nikolay Martynov 15024915bf Catch `AbstractMethodError` when trying to unwrap jdbc connection
jdts throws this exception since they just have 'stub' umplementation.
2018-11-01 09:57:18 -04:00
Nikolay Martynov 8a066de772 Add logging in jdbc instrumentation when we cannot unwrap connection 2018-10-31 13:38:37 -04:00
Tyler Benson 192b0fd478 misc minor changes 2018-10-22 10:44:04 +10: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
Tyler Benson e11ab12284 Better error handling for older JDBC drivers
that don’t support unwrapping (pre JDK 1.6).
2018-09-18 16:46:08 +10:00
Tyler Benson b3222009ef Stop sending params with AWS traces
can potentially contain sensitive data.

(See #461)
2018-09-07 08:55:24 +10:00
Tyler Benson 3f2ec7dc48 Move to separate packages 2018-08-16 12:24:27 +10:00