@grow-codes/datadog-apm - v0.1.1
    Preparing search index...

    Class DatadogApmClient

    Client for Datadog APM. health(), ping() and serverVersion() use the Datadog Agent's GET /info; initTracing sets up OpenTelemetry exporting to the Agent; spans is the SaaS query API (needs apiKey + appKey).

    const client = DatadogApmClient.fromEnv();
    const tracing = client.initTracing({ serviceName: "checkout" });
    console.log(await client.serverVersion()); // "7.85.4"
    await client.close(); // flushes and shuts down the tracing it started
    Index

    The immutable configuration.

    • Flushes and shuts down every tracing handle started with initTracing, then releases connections. Idempotent.

      Returns Promise<void>

    • Agent liveness: GET /info. healthy with status ok and details version, git_commit when the Agent answers; unreachable on network errors, unhealthy on HTTP errors. Never throws except for CANCELLED and CONFIG.

      Parameters

      Returns Promise<HealthStatus>

    • Round trip to the Agent (GET /info), returning the latency in ms. The Agent has no authentication; to check Datadog API credentials use client.spans.ping().

      Parameters

      Returns Promise<number>

    • Datadog Agent version from GET /info (e.g. 7.85.4); UnsupportedError when absent.

      Parameters

      Returns Promise<string>