Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/add_new_instrumentation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Add a New Instrumentation

Now we will step through adding a very basic instrumentation to the trace agent. The
existing [google-http-client instrumentation](../dd-java-agent/instrumentation/google-http-client)
existing [google-http-client instrumentation](../dd-java-agent/instrumentation/google-http-client-1.19)
will be used as an example.

## Clone the dd-trace-java repo
Expand Down Expand Up @@ -161,7 +161,7 @@ When applying multiple advices, consider using the `@AppliesOn` annotation to co
## Add the HeadersInjectAdapter

This particular instrumentation uses
a [HeadersInjectAdapter](../dd-java-agent/instrumentation/google-http-client/src/main/java/datadog/trace/instrumentation/googlehttpclient/HeadersInjectAdapter.java)
a [HeadersInjectAdapter](../dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/HeadersInjectAdapter.java)
class to assist with HTTP header injection. This is not required of all instrumentations. (
See [InjectorAdapters](./how_instrumentations_work.md#injectadapters--custom-getterssetters)).

Expand Down Expand Up @@ -487,11 +487,11 @@ The `check` task runs `verifyAgentJarIntegrations` automatically, so CI will fai
is out of date.

All integrations must include sufficient test coverage. This HTTP client integration will include
a [standard HTTP test class](../dd-java-agent/instrumentation/google-http-client/src/test/groovy/GoogleHttpClientTest.groovy)
a [standard HTTP test class](../dd-java-agent/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientTest.groovy)
and
an [async HTTP test class](../dd-java-agent/instrumentation/google-http-client/src/test/groovy/GoogleHttpClientAsyncTest.groovy).
an [async HTTP test class](../dd-java-agent/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientAsyncTest.groovy).
Both test classes inherit
from [HttpClientTest](../dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpClientTest.groovy)
from [HttpClientTest](../dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpClientTest.groovy)
which provides a testing framework used by many HTTP client integrations. (
see [Testing](./how_instrumentations_work.md#testing))

Expand Down
2 changes: 1 addition & 1 deletion docs/how_instrumentations_work.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ Implement `JavaModuleOpenProvider` when:
Tests are written in Groovy using the [Spock framework](http://spockframework.org).
For instrumentations, `InstrumentationSpecification` must be extended.
For example, HTTP server frameworks use base tests which enforce consistency between different implementations
(see [HttpServerTest](../dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy)).
(see [HttpServerTest](../dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy)).
When writing an instrumentation it is much faster to test just the instrumentation rather than build the entire project,
for example:

Expand Down