Carlos Marquez
Carlos Marquez

Reputation: 1

Datadog APM through api request

I am using Datadog to monitor my kubernetes applicaitons. I would like to use the Datadog api to fetch all services under the section APM but I can't figure out which endpoints to use.

is that even possible?

I just expect to do an api request that returns me all services visible under APM -> services in the Datadog website.

Upvotes: 0

Views: 1341

Answers (2)

aLpEr
aLpEr

Reputation: 1

I don't know why this isn't in their API docs (or at least I couldn't find it easily). Just be sure to pass filter[env]=YOUR_ENV as query param.

curl -X GET "https://api.datadoghq.com/api/v2/services?filter%5Benv%5D=production" \
     -H "Accept: application/json" \
     -H "DD-API-KEY: ${DD_API_KEY}" \
     -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Upvotes: 0

bwest
bwest

Reputation: 9844

You can use the GET method of the service definitions endpoint. Here are the docs. The docs include a number of examples, as well as other endpoints including retrieving an individual service by name.

curl -X GET "https://api.datadoghq.com/api/v2/services/definitions" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Upvotes: 0

Related Questions