18 Jul 2024 07:51 PM
I'm slowly switching from my own config management solution to Monaco 2.x.
Now I'm trying to create consistent Web Application configs with monaco but this seems to be impossible, due to the non-unique naming of Applications (multiple Applications with the same name, but different IDs can exist).
In my own solution I've "delegated" the uniqness to the user (which is perfectly fine if you have control over the config anyway. But with monaco this isn't possible?
Assume you want to create a webapplication and detection rules, there are two issues:
In my own solution I did use a PUT instead of a POST for creating the application and specify the Application identifier myself in the API payload and URL. If monaco would support this, it would be possible to create a full transportable configuration that can be applied to any environment that creates consistent applications. All the dependencies could be easily managed in monaco.
But currenlty you can only create the applications, then take note of the Application IDs and modify any depending configs based on that. It is not really automatable.
Has anyone found a solution for this?
19 Jul 2024 09:34 AM
@r_weber maybe Terraform is more flexible in this case
BTW you can use tags as pseudo-ids to differentiate app configs
(In my case I have no such issue since always stuck with naming conventions in app names like {ENV}-{APP ABBR}-{APP 2nd name fs needed})
Regarding generated ids - I don't think it will be allowed to delegate to the user. This logic is everywhere.
There are some exceptions like key user action IDs which you can assign manually, but it looks like legacy because dynatrace doesn't have a proper UUID generator in this case.
19 Jul 2024 12:07 PM - edited 19 Jul 2024 12:08 PM
Hi @Slawa ,
Actually you CAN generate IDs for Applications and totally post your own ones (this works for almost every config entity). I've been doing this for years now with my own solution and it works perfectly fine. It's kind of a key requirement for concise config management.
Even monaco already has a understanding of the applications it created (by name) and somehow tracks this, but I have no idea how this could be leveraged.
E.g. in debug mode you will see this (nowhere in my config definitions I've set this ID, so it must be fetched by monaco itself...by name)
19 Jul 2024 12:15 PM
Yes, you can generate an ID but not assign the desired/constant value. (like in the legacy key user actions mentioned above)
I believe Monaco used the same logic as Terraform
You have 2 file
1 declare configuration more or less human readable (id can be present or omitted)
2 technical state file/s with all details and ids are included indeed since it is required for API calls
19 Jul 2024 03:46 PM
You mean monaco can't assign a custom generated ID? It's well possible via the API that monaco uses. It's just that monaco doesn't support it. Or - if monaco actually does generate it's own IDs based on name - which I get the impression it does, then there should be a way to re-use those IDs in other config items, I haven't found out how this is done though.
What do you mean by state files? I haven't seen any state files when monaco deploy runs?
19 Jul 2024 04:38 PM
My mistake, I mixed KUA and action properties APIs
Let's say you try to set new Key User action -
you will use this API
https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/rum/web-application-configuration-api/key-user-actions/post-configuration
Here you have no control over id - it will generated randomly on server side
Other case is
https://docs.dynatrace.com/docs/dynatrace-api/configuration-api/rum/web-application-configuration-ap...
where you can manually assign metaid and unique ids - up to integer limit.
it looks like behind different API's is very different logic.
19 Jul 2024 06:16 PM
Yes there is quite some inconsistency on the APIs, I've seen that in the past already.
But even Applications and Application Key user actions can be managed. Actually I've even solved that in the past with this solution.
e.g. you can create Applications like this:
In code create an Application ID like this:
By having a custom APP-ID starting with "0000" and then add a known hash based on the name we can simply identify out own managed Applications from the ones created via UI. Wondering if monaco can do that or is doing that.
(I remember when monaco was still in it's very early stages I presented the ID generation to the monaco devs and they picked it up for some things shortly after that, but that was long before monaco 2.0 - no idea what/how it is done today)
And when adding key useractions we first need to look at the application itself to add the KUA.
Similar for appdetection rules. FYI here
So custom IDs are completely possible, it's really just monaco not working like that..