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

Is there an API to find "context" of a tag just by giving tag......without any entities?

BHA5472
Visitor

Is there an API to find the "context" of a tag just by giving a tag......without any entities? Or if not, then is there any way by which entity related to a particular tag can be found?

5 REPLIES 5

ChadTurner
DynaMight Legend
DynaMight Legend

@BHA5472  If this is an automatic tag, you can also go into the UI and look that tag up to see what rules are defined for it. Additionally, you can also search for tag values in Dynatrace. If this is a Manual tag that was created, the same applies by searching for all manually applied tags via settings>Tags>Manually Applied.

 

There also is the API: 

ChadTurner_0-1615304445411.png

 

-Chad

Hey Chad, these API doesn't tell you that information. Nd there is no API which can give you a list of manually applied tags without giving any entity.

Dallas
Dynatrace Mentor
Dynatrace Mentor

Hey @BHA5472, Could you provide some more info? When you say you are looking for the "context" what exactly are you looking to find?

Thanks

-Dallas

Hey Dallas,

Context of tag means if a tag is automatically detected by Dynatrace say AWS tag, then context for that tag is AWS. If it is being discovered as Kubernetes, it's context will be kuberetes. There are tags which don't have any particular context, their context value is "CONTEXTLESS".

 

So, is there any way by which context of a particular tag could be found using API?

adam_gardner
Dynatrace Champion
Dynatrace Champion

All manual and tags applied via autotag rule will be CONTEXTLESS. All AWS tags will have a context value of AWS and other technologies will follow similar conventions like KUBERNETES as Dallas mentioned above.

I'm assuming you want to search for manual tags, which is possible with the /api/v2/tags endpoint:

 

 

curl -x GET https://abc123.live.dynatrace.com/v2/api/tags?entitySelector=type("HOST"),tag("manualtag:value")

 

 

 

Retrieves this (if you actually have a host manually tagged with <pre>manualtag:value</pre>):

 

 

 

{
"totalCount": 1,
"tags": [{
"context": "CONTEXTLESS",
"key": "manualtag",
"value": "value",
"stringRepresentation": "manualtag:value"
}]
}

 

 


If this is not what you're asking, please elaborate on the usecase a bit more and I'll try to assist.

Featured Posts