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

CPU/Memory usage % for a service

achoud22
Newcomer_

I am trying to create a custom metric to showcase CPU/Memory usage % of a service in a namespace in a cluster . 
Is there any way to do that .

1 REPLY 1

tomaxp
Mentor

Hi,
i try with this:

timeseries {
    mem_used  = sum(dt.kubernetes.container.memory_working_set, default:0),
    mem_limit = sum(dt.kubernetes.container.memory_limit,        default:0)
  },
  by:{ dt.entity.service, dt.entity.cloud_application_namespace },
  filter:{ dt.entity.cloud_application_namespace == "CLOUD_APPLICATION_NAMESPACE-xxxxxxxxxxxxxx" },
  nonempty:true
| fieldsAdd mem_pct = 100.0 * mem_used[] / mem_limit[]
| fieldsAdd service = entityName(dt.entity.service),
           namespace = entityName(dt.entity.cloud_application_namespace)
| fieldsKeep service, namespace, mem_pct


but I recive null. But mabye on my env limits are not set

Featured Posts