29 Jul 2020 01:51 PM - last edited on 27 Mar 2023 10:21 AM by MaciejNeumann
How to pull out data from metrics api v2 which would contain data from one certain key request?
Should I use and obtain the entityID for my KeyRequest somehow and would there be possibility to filter the requests based on request parameters?
I can filter out some certain service but this call returns data from all the Key Requests and I would need to filter my data to one specific use case but can't get my head around how to do it.
https://xxxxxxxxx.live.dynatrace.com/api/v2/metrics/query?resolution=Inf&from=1595851920000&to=1595852100000&api-token=XXXXXXXXXX&metricSelector=builtin:service.keyRequest.dbChildCallCount&entitySelector=type(SERVICE_METHOD),entityId(SERVICE_METHOD-18444A1107CDD08C )
I have tried go trough the documentation but I would appreciate if someone could offer some help how we could filter out data.
Solved! Go to Solution.
29 Jul 2020 04:16 PM
Hi Janne,
You are absolutely spot on! Your API call seems correct to me.
The key parts are:
type("SERVICE_METHOD"),entityId("SERVICE_METHOD-xxxxxxxx")
Also, make sure your metric actually exists at the keyRequest level. On my environment for example, I have dbChildCall only at the service level:
builtin:service.dbChildCallCount
Try using a generic one (for testing purposes) to ensure your call returns something. Maybe something like:
builtin:service.keyRequest.count.total
I hope this helps.
Best regards,
Radu