Get Key Request using API

Hi Guys,

How to get all key request via api?

Because i have try on data explorer and limit only 100 data key request with low transaction

Regards,

Andra

Hi @andra_nosa ,

you can try pulling a metric that contains the key requests and split the dimension accordingly.

Take e.g. following command (the output still has duplicates and is not well formatted, but contains only keyRequests)

curl -X GET "https://<tenant_id>/api/v2/metrics/query?metricSelector=builtin%3Aservice.keyRequest.cpu.perRequest%3AsplitBy%28%22dt.entity.service_method%22%29%3Aavg%3Aauto%3Asort%28value%28avg%2Cdescending%29%29" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token <token>" | tr 'dimension' '\n' | grep SERVICE_METHOD

Following metric query is being used here:

builtin:service.keyRequest.cpu.perRequest:splitBy(ā€œdt.entity.service_methodā€):avg:auto:sort(value(avg,descending))

Best,

Mark

Hey did you checked this similar question mark solved already Solved: Re: Is there a way to get a list of all marked key requests & key user actions per tenant? - Dynatrace Community

Key Requests:

with Metrics v2 API and Key User action

Hi @mark_bley and @techean thanks for sharing with me,

I used this metric builtin:service.keyRequest.count.total:parents:names and got all information

Thanks Guys!

happy to know that :slightly_smiling_face:

This is now also possible using the Settings API (https://www.dynatrace.com/support/help/shortlink/api-v2-settings-get-objects) and the schemaId ā€œbuiltin:settings.subscriptions.serviceā€.