Class DatadogApmClient

java.lang.Object
codes.grow.packages.datadogapm.DatadogApmClient
All Implemented Interfaces:
AutoCloseable

public final class DatadogApmClient extends Object implements AutoCloseable
The Datadog APM client (API.md section 1). health(), ping() and serverVersion() use the local Datadog Agent's GET /info (trace intake port 8126, no authentication); initTracing(TracingConfig) sets up OpenTelemetry exporting to the Agent; spans() is the SaaS query API (needs apiKey + appKey). Thread-safe.

 try (DatadogApmClient client = DatadogApmClient.fromEnv()) {
   DatadogTracingHandle tracing = client.initTracing(TracingConfig.builder("checkout").build());
   String agent = client.serverVersion(); // "7.85.4"
 } // close() flushes and shuts down the tracing it started
 

Every I/O method has a blocking form and an ...Async form returning CompletableFuture.