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

Dynatrace Managed. Query multiple environments for alerts

Hello,

Here is the situation - we have Dynatrace Managed with a number of (in dozens and hundreds) of different monitored environments.

I would like to make an API call to find out if all or subset of these environments (selected from a list) logged the specific type of alert during a specific timeframe.

For example - list all environments experienced 'slow disk' alerts on the specific day with a timestamp of start/stop of the alert.

How can I do the above using a single request?

I know how to query a specific environment for all/specific types of alerts using GET -

/api/v1/events

But as I said - I have hundreds of such environments and it would require to create access token for each environment and query each of them separately. This is not a practical solution.

Any alternatives?

Thanks

9 REPLIES 9

Julius_Loman
DynaMight Legend
DynaMight Legend

There is no such option to query multiple environments. You will have to get Api Token for each one and query them individually.

Luckily, you should be able to automate this using the Cluster API v2. I did not try this yet on my own, but you should be able to create a token management token for each environment and then create the required API token for each environment.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

I just looked at cluster API v2. I See


Environments

Manage environments

Migration to multi-datacenter deployment

Migration to multi-datacenter deployment

Remote access

Manage remote access requests

Synthetic - Locations and nodes

Manage synthetic locations and nodes

Tokens

Manage Dynatrace API authentication tokens

User management

Manage user sessions


How above is going to help me? One way or another, I need to create a token for each environment and then using that token query alerts. Nothing has changed, in terms of reducing time to get my answers, right?

Thanks

Julius and I meant "Tokens" API that can be used to create automatically tokens for each environment. See my github example.

For the specific operation you should look at the Environment's APIs.

Senior Product Manager,
Dynatrace Managed expert

OK, folks, thank you both.

Seems I need to take the path of Ansible/bash scripting way...

Sorry, I added my comment in the main thread.

OK - moved.

Senior Product Manager,
Dynatrace Managed expert

Radoslaw_Szulgo
Dynatrace Guru
Dynatrace Guru

Hi Irakli - take a look at my example here that I show how I update Frequent Issues Detection settings for many environments using Ansible:

https://github.com/rszulgo/providing-dynatrace-managed-as-a-service/tree/master/update-existing-envi...


You cannot do that with a single call, but that's not bad when you automate that - you can call single... script.


Senior Product Manager,
Dynatrace Managed expert

I am kinda surprised that such a feature is not implemented...

Let me try your approach but in one of our clusters we have '2047 Environments' (not a joke) and I can imagine how much time will it take to go thru all of them.

The problem with the script that in it could be 15 from 2000 environments which experience such alert type but unless I query all of them, I won't be able to see which one was...

It's intentionally not implemented. The way we store separately data per environment, server would need to run the workload of iterating of hundreds or thousands of envs. You rather don't want to overload server with a single query, but rather run smaller chunks and throttle requests if it's too much...


BTW - what I guess you try to do is to implement some custom alerting on top of what Dynatrace does with AI. We work for better customization possibilities in that area - we'll see what next year brings.

Anyway... 2000+ envs it pretty too much, but you probably already know that 😉

Senior Product Manager,
Dynatrace Managed expert

Featured Posts