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.
Turns out the class level path annotation overrides parent classes, so we only need to find the nearest one.
We also need to look from the instance’s class, not from where the method is defined.
Commented out a test case because we still need to compile against java 7. That case will be added back when we upgrade to java 8.
- reproduce NPE error with JaxRs class and interfaces in JavaInterfaces
- fix the logic target class of method with @Path annotation to avoid NPE
- setting java 1.8 for jaxrs's test
Sometimes servlets will call another servlet by “resetting” the request object. This maintains the attributes previously set, including the span. We want to allow the trace to start if there’s no “active trace” even if there is a span attribute.
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`.)
Disabled by default, and only creates a span if existing trace detected.
To enable all of them:
* System Property: `-Ddd.integration.servlet.enabled=true`
* Environment Variable: `DD_INTEGRATION_SERVLET_ENABLED=true`
(They have independent configs as well. If needed, view the source below.)
Adding a happy & comm failure test case for StatsDMonitor.
This checks some but not all of the counters but also makes sure the exceptional path branches are exercised.
To make this test possible, I added an additional constructor to StatsDMonitor that takes a StatsDClient.
For spring:
* Move more logic to the decorator.
* Use a fixed operation name, but set the resource name.
* Rename the root span instead of the parent span (If there are other spans in between this could make a difference.) Not sure what impact this would have if multiple controllers are called (ie, forward/include).
For Jax-rs:
* Rename the root span instead of the parent span (same concern as above with spring)
Adding StatsDMonitor to DDAgentWriter
Modified Writer.createAgentWriter to read the health Monitor configs and construct StatsDMonitor when health metrics are enabled
Updated DDTracerTest to check for use of appropriate Monitor class depending on the Config
Introducing a Monitor for DDAgentWriter
Monitor can be used to track critical lifecycle events in the publishing of spans. This change only contains a NoopMonitor, but a StatsD variant will be added in later commit.
The DDAgentWriter has been altered to take a Monitor instance at construction for the purposes of testing the Monitor.
DDAgentWriter now includes tests to count spans published and sent -- including new tests for multi-threaded writing and slow agent response scenarios.
Changing the DDApi send methods to return a new Response object instead of a boolean result.
The Response object allows additional information to be propagated to the DDAgentWriter that is needed for helath monitoring.
Beyond success / fail represented by DDApi.Response.success, this includes...
- communication exception to the agent
- status code returned by the agent
- JSON parsing exception caused by bad payload returned by the agent
DDApiTest-s have also been updated to check response.success() but also to check response.status() as appropriate.