Throws ConfigError unless both apiKey and appKey are configured.
POST /api/v2/spans/analytics/aggregate: computes compute (results keyed c0, c1, …)
per group of groupBy.
Releases connections. Idempotent.
UnsupportedError where the service has no dependency API.
Optional_opts: DependencyOptionsReads a trace. Default: searches the indexed spans with trace_id:<id> over the last 24 hours
(all pages, merged by span id) — only spans kept by retention filters, so the trace may be
partial. With preview: true: GET /api/v2/trace/{id} (full trace, preview API). Returns
null when nothing is found.
Distinct span names (Datadog resource_name) of service in the last 24 hours, via
aggregateSpans grouped by resource_name (up to 1000).
GET /api/v2/apm/services?filter[env]=…: names of the services that reported traces. The env
filter defaults to the configured environment, else * (all).
Authenticated round trip GET /api/v2/validate_keys (API key + application key); returns the
latency in ms. Invalid keys → AuthenticationError (Datadog answers 401 or 403).
Iterates over every span matching the search, following the cursor page by page (same
absolute window for every page). Throws TimeoutError when Datadog reports a timed-out query
that returned no spans (never a silently empty result).
One page of POST /api/v2/spans/events/search. Pass nextCursor back as cursor with the
same absolute from/to for the next page. status: "timeout" or warnings mark a
partial result.
Finds traces with spans matching query (service, span name, @tag values, duration in
nanoseconds) in start..end (default: the last 15 minutes), newest first, up to limit
(default 20) distinct trace ids. Summaries are built from the matching spans only.
Polls getTrace until the trace has minSpans spans (default timeout 30 s, interval
2 s because Datadog allows 50 searches per minute). Throws TimeoutError when it does not
appear in time.
StaticfromBuilds a query client from the environment (DD_API_KEY, DD_APP_KEY, DD_SITE, …).
StatictraceBuilds the Datadog query string for a SPEC TraceSearchQuery (see traceSearchQueryString).
Datadog spans query client (SaaS API at
https://api.<site>, headersDD-API-KEYandDD-APPLICATION-KEY). Implements the SPEC TraceQueryClient on top of the spans search and aggregate APIs, plus Datadog-specificsearchSpans,aggregateSpansandping.Errors: 400/413/422 →
ValidationError, 401 →AuthenticationError, 403 →PermissionDeniedError(AuthenticationErrorfromping()), 404 →NotFoundError, 408 →TimeoutError, 429 →RateLimitError(waitsRetry-After/X-RateLimit-Resetwithin the retry budget), 5xx →UnavailableError.