cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Again a surprise in Dynatrace, key requests

henk_stobbe
DynaMight Leader
DynaMight Leader

Hello there is a new way to create and remove key requests in a service:

 

henk_stobbe_1-1645107164506.png

 

 

No more waiting for the request to show itself, thanks Dynatrace!

 

KR Henk

 

 

7 REPLIES 7

pahofmann
DynaMight Guru
DynaMight Guru

Great find, finally addresses this Product Idea. 

Dynatrace Certified Master - Dynatrace Partner - 360Performance.net

henridb
Guide

Also the "Muted requests" just below that option is new 😉

Karolina_Linda
Community Team
Community Team

Thanks for sharing, Henk!

Keep calm and build Community!

henridb
Guide

Only remark: The Key requests and Mute requests options are also visible for Database services but have no function there...

Great find Henri!

adam_gardner
Dynatrace Champion
Dynatrace Champion

Just to round off this thread, there is an API available to do this way ahead of time too (as part of a pipeline?) I've wrapped it in a container.

1. Create a Dynatrace API token with v2 read entities and write settings permissions

2. Create a CSV using a pipe as a separator. Save as input.csv:

entitySelector|request_name
type(SERVICE),tag(app:frontend)|/pageOne.html
type(SERVICE),tag(app:frontend),tag(environment: production)|/pageTwo.html
type(SERVICE),tag(app:frontend)|/pageThree.html
type(SERVICE),tag(app:frontend)|/pageFour.html

2. From the same directory, run this:

 

docker run --rm ^
--mount type=bind,source=%cd%/input.csv,target=/app/input.csv ^
-e filename=input.csv ^
-e dt_url=https://abc12345.live.dynatrace.com ^
-e dt_api_token=dt0c01.************* ^
adamgardnerdt/key-request-creator:0.0.2

 For debugging add a new -e parameter dt_logging=1:

 

docker run --rm ^
--mount type=bind,source=%cd%/input.csv,target=/app/input.csv ^
-e dt_logging=1 ^
-e filename=input.csv ^
-e dt_url=https://abc12345.live.dynatrace.com ^
-e dt_api_token=dt0c01.************* ^
adamgardnerdt/key-request-creator:0.0.2

 

What The Container Does

1. Mount the input.csv file into /app/input.csv inside the container.

2. For each entity selector, the script looks up the matching SERVICE IDs then creates Key requests against them.

 

Known Limitations

1. The entity type (eg. SERVICE) must exist before you can create config against it. So as long as the SERVICE is there, the key request will be created (even if that endpoint has never had traffic) but no service = no key request. So it's easy to ensure this. Onboard your service and send a few requests to /dummy (even if it 404s) and the service will be available within minutes.

MevlutS
Contributor

Thank you @adam_gardner. It is really useful. We can develop our automation but there is not a any guide or example for this. Indeed, confusing a little bit. 

Is it possible to share with us the guide or example for just key request api usage ?

Featured Posts