For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/fr/api/latest/spans/get-a-list-of-spans.md. A documentation index is available at /llms.txt.
Language
Datadog site

Obtenir la liste des spans

GEThttps://api.datadoghq.com/api/v2/spans/eventshttps://api.us3.datadoghq.com/api/v2/spans/eventshttps://api.us5.datadoghq.com/api/v2/spans/eventshttps://api.datadoghq.eu/api/v2/spans/eventshttps://api.ap1.datadoghq.com/api/v2/spans/eventshttps://api.ap2.datadoghq.com/api/v2/spans/eventshttps://api.uk1.datadoghq.com/api/v2/spans/eventshttps://api.ddog-gov.com/api/v2/spans/eventshttps://api.us2.ddog-gov.com/api/v2/spans/events

Présentation

L'endpoint de liste renvoie les spans qui correspondent à la requête de recherche. Les résultats sont paginés.

Utilisez cet endpoint pour afficher vos derniers spans. Le débit de cet endpoint est limité à 300 requêtes par heure.

OAuth apps require the apm_read authorization scope to access this endpoint.

Arguments

Chaînes de requête

Name
Type
Description
filter[query]
string

Search query following spans syntax.

filter[from]
string

Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

filter[to]
string

Maximum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).

sort
enum

Order of spans in results.

Allowed enum values: timestamp, -timestamp
page[cursor]
string

List following results with a cursor provided in the previous query.

page[limit]
integer

Maximum number of spans in the response.

Default: 10

Réponse

OK

Response object with all spans matching the request and pagination information.

Champ
Type
Description
data
[object]

Array of spans matching the request.

links
object

Links attributes.

meta
object

The metadata associated with a request.

Exemple de code

Obtenir la liste des spans
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/spans/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"