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

Process Group Instance CPU filtered by tag

gilgi
DynaMight Champion
DynaMight Champion

Hi All, 

I'm trying to create a chart with the process group instance cpu, but only to processes from a certain kuberenetes namespace.

Searching for the list of process groups with the following DQL shows the correct list:

fetch dt.entity.process_group_instance
|fieldsAdd tags
|filter(matchesValue(tags,"[Kubernetes]namespace:easytrade"))

However, when using this in combination of teh metrics command and lookup as follows I get no data:

timeseries avg(dt.process.cpu), by:{dt.entity.process_group_instance}
| lookup [fetch dt.entity.process_group_instance
| fieldsAdd tags
],
sourceField:dt.entity.process_group_instance, lookupField:id
| filter matchesValue(lookup.tags,"[Kubernetes]namespace:easytrade")

What am I doing wrong here?

Gil.

1 REPLY 1

gilgi
DynaMight Champion
DynaMight Champion

So, In order not to change the original question as people may have the same issue, this is how I've managed to resolve this:

timeseries avg(dt.process.cpu.usage), by:{dt.entity.process_group_instance}
| lookup [fetch dt.entity.process_group_instance
| fieldsAdd tags
| filter(matchesPhrase(tags,"[Kubernetes]namespace:easytrade"))
], sourceField:dt.entity.process_group_instance, lookupField:id
| filterOut isNull(lookup.tags)

 

For some reason, It seems as if the lookup ignores the inner filter (which I thought should be used in order to minimize the number fo records read from the smartscape).

Featured Posts