28 Nov 2024 09:07 AM - last edited on 29 Nov 2024 09:58 AM by MaciejNeumann
Hi all,
I am working on the auto-tagging to add an "Environment" tag to EMS queues.
However, the only properties available in the Tibco EMS queue is only host name and port number
I know how to filter the queues by hard-coding the host name
type(tibco:queue),host("<host1>","<host2>")
and filter the host name based on host group
type(host),tag(host-group:<host-group name>)
However, is there any way that we can merge 2 queries together such that we can provide host name based on a particular host group?
01 Dec 2024 02:24 PM
Hello @Hillman
Referring to the highlighted concern, you can review:
hoping it helps.
KR,
Peter
02 Dec 2024 03:07 AM - edited 02 Dec 2024 04:01 AM
Thank you for the documents provided. However, in this tenant, we are monitoring both SIT and UAT environment. They have their own EMS servers but the queues are using the same name. Here comes the issue, the type(queue) seems to mix up the data of the same queue name, even though they come from different host group
If we want to separate the queue from different environment with different tags, e.g. uat2 and sit2, we cannot use the message queue type. Only type(tibco:queue) is feasible as it maps to a particular host.
However, I am still struggling with the query. It seems there are not much relationship can be defined for tibco:queue
Hillman
02 Dec 2024 05:38 AM
Hi @Hillman ,
I think for linking queues with hosts you can have to relate first with a queue with a queue instance, a queue instance with a queue or queue with a service.
Let me give you some examples:
type("QUEUE_INSTANCE"),fromRelationship.isInstanceOf(type("QUEUE"),entityName.startsWith("queue_name")),fromRelationship.runsOnHost(type("HOST"),entityName.startsWith("hostname"))
type("QUEUE"),toRelationships.isInstanceOf(type("QUEUE_INSTANCE"),entityName.equals("queue_instance"),fromRelationship.runsOnHost(type("HOST"),entityName.equals("hostname")))
type("QUEUE"),toRelationship.listensOnQueue(type("SERVICE"),entityName.in("service_name"),fromRelationship.runsOnHost(type("HOST"),entityName.equals("hostname")))
I think it's not possible to relate queues with hostgroups. But with hosts it's possible as you can see.
Hope it helps.
Regards,
Elena.
02 Dec 2024 06:13 AM - edited 02 Dec 2024 06:23 AM
Hi @erh_inetum ,
As I have mentioned above, the queues returned from type(queue) are mixing up the 2 environments together. That does not suit our case as we want to assign different tags to the queues from different environments.
I am still trying to figure out what relationships does type(tibco:queue) support.
Regards,
Hillman
02 Dec 2024 08:05 AM - edited 02 Dec 2024 08:09 AM
I have used Dynatrace API to get the entity and see what kind of relationship does the type(tibco:queue) have. The only relationship it has got is a tibco broker
At the end, I can only match the pattern with tibco broker name as it contains the hostname which is the only way to identify the environment.
type(tibco:queue),fromRelationships.isChildOf(type(tibco:broker),entityName.Contains(<partial_string_of_hostname>))
Hillman