17 Apr 2021
04:22 PM
- last edited on
20 Apr 2021
07:44 AM
by
Karolina_Linda
Hello,
I notice if I list the problems for a certain entity like:
type(process_group_instance),tag(MyApplication:AppName)
The JSON returns information like this:
"totalCount": 10,
"pageSize": 50,
"problems": [
That total count can be 0 or greater.
Here is my question - If the tag name is invalid, totalCount will be 0. I HAVE NO WAY TO DISTINGUISH BETWEEN A GOOD TAG WITH NO PROBLEMS AND A BAD TAG.
Should I be making an API call beforehand to validate that a tag name is valid?? How do I do that? I have heard that managed tags are stored in one place and other tags in another.
Help!! I am trying to pull problems for a tag, and that works great. I just have no way to flag if the tag was actually valid.
Thanks,
Lou
Solved! Go to Solution.
20 Apr 2021 06:35 PM
Maybe a better way of asking this question is "What is the best way to validate that a tag (normal or custom" is valid?" through the V2 API?
22 Apr 2021 06:50 AM
@louis_gallo I do not fully understand what you would like to implement with the problems API endpoint. Can you give me more context on why the problems endpoint should verify if a given tag exists? For us the endpoint does return the list of entities that show a problem with a given tag. In case there is no entity with that given tag, the result is of course empty. On the other hand, the tag could exist on other entity types of course.
Best regards,
Wolfgang
22 Apr 2021 06:56 AM
@louis_gallo You can use the tag endpoint to query for the number of entities of a given type and how many assignments the tag has, see here:
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/custom-tags/get-tags/
22 Apr 2021 08:54 PM
Hi Wolfgang. My idea, which I actually have a POC built, is to automate pulling back problems by a tag for a particular time, in most cases the time of a PVS test. Hence why I want to validate the tag beforehand as valid because both an invalid tag OR a valid tag with no problems return the same result. Hopefully that makes sense. I am going to try your idea above. Just have to get read entities privs with my token. If I am off base here, please let me know.
23 Apr 2021 11:50 PM
It works as a validator for the tags!!! Thanks Wolfgang!!
24 Apr 2021 07:16 AM
Great that it worked, have a great weekend!
Regards,
Wolfgang