11 Aug 2023 06:25 PM - last edited on 14 Aug 2023 08:31 AM by MaciejNeumann
I found the way to do it via the v1 API (and it's extremely straightforward...), but as that will one day be deprecated, I'd prefer to write my query to use a v2 method (assuming it exists) so that I don't have to come back to the script years later and have to update it.
v1 method:
Web application configuration API - GET key user actions | Dynatrace Docs
I can query via the Monitored Entities v2 API and get a list of all User Actions for an application, but there's no way I can tell to determine if that action is marked as a Key User Action or not...
I've tried poking around the Settings v2 API, and the closest thing I found there is a list of Apdex settings for an Application, but those appear to only be the fallback settings for the entire application (i.e. for user actions that aren't marked as Key). I'm guessing Key User Actions will show up in that same section if we've customized an Apdex threshold for them, but that's kind of the whole point of this script, so we haven't yet.
So is the functionality to get a list of just the Key User Actions for a specific Application not present in the v2 API yet, or am I missing something?
Extra Context:
In case it isn't clear, I'm writing a script that we can feed a list of Application names. It will then loop through those and, for each application, get a list of all the Key User Actions. Then, for each Key User Action, determine what the average VCT was over a certain timeframe (like last 7 or 14 days or whatever), then calculate what the standard deviation was for that time period. We can then use that to set Apdex thresholds for each Key Action where the Tolerating threshold is maybe 2 standard deviations above average and the Frustrated is 3 or 4 standard deviations above (it's kind of crazy that Dynatrace doesn't do this for us automatically.... Are we really expected to manually determine the thresholds for each Key User Action for all of our Applications?).
Solved! Go to Solution.
11 Aug 2023 07:23 PM
Hello @36Krazyfists under the Configuration API you have:
13 Aug 2023 09:17 AM
Yeah, that's the API I mentioned in my original post, which is v1 API. Based on your other post it sounds like you are saying there isn't an equivalent v2 API way to reach this?
14 Aug 2023 01:44 AM
Right, as I add below, the future roadmap of APIv1 in particular and API in general is unclear, but in the latest Dynatrace there is at least a classic APIv1 and v2 environment.
11 Aug 2023 07:29 PM
The future of the current API is not clear, even within V2 I have seen many modifications over time. I haven't seen end of life for API v1 yet. Your approach is valid, but today not everything has an equivalence. I think you have exhausted all the possibilities correctly.
The only change that is likely to be implemented is to obtain Bearer tokens through an Oauth application.
14 Aug 2023 06:24 AM
You need to use the Monitoring entities API (Environment v2 API) and look for the APPLICATION_METHOD entities.
Use the entitySelector with relation for looking up the key user actions for a particular application, for example:
type(APPLICATION_METHOD),fromRelationships.isApplicationMethodOf(entityId(APPLICATION-C45712444213D6A1))
This will return the list of key user actions present in the searched timeframe. Then you can fetch the metrics using Metrics API for such actions.
There is no schema in Settings API at this time which will allow you to configure or retrieve key user actions for an application.
14 Aug 2023 01:59 PM
No, as I stated in my original post, the Monitored Entities API will get you a list of all User Actions for an application. There's no property that denotes whether any of those properties are Key User Actions. At least not any that I could find. I'm just using the v1 Configuration API for now.
14 Aug 2023 02:44 PM - edited 14 Aug 2023 02:47 PM
No, APPLICATION_METHOD is a key user action. You won't see non-key user actions in Monitored entities, only key user actions. Just be sure you are looking at the correct user action and application since key user actions can have the same name across different applications.
14 Sep 2023 03:33 PM - edited 14 Sep 2023 03:35 PM
You can use terraform, which powered by v2 API
https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/web_applicatio...
if TERRAFORM_EXPORT:
terraform_export = subprocess.Popen(
args=[os.environ['DYNATRACE_TERRAFORM_BIN'], "-export", "-id", MODULE],
cwd=PROJECT_FOLDER)
terraform_export.communicate()
module "web_application" {
source = "./configuration/modules/web_application"
}