# Grafana alert for cpu/memory usage

**URL:** <https://community.grafana.com/t/grafana-alert-for-cpu-memory-usage/64732>\
**Category:** Prometheus\
**Tags:** alerting\
**Created:** [April 27, 2022, 8:35am UTC](https://community.grafana.com/t/grafana-alert-for-cpu-memory-usage/64732 "2022-04-27T08:35:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhodyrhmd](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dhodyrhmd](https://community.grafana.com/u/dhodyrhmd)\
**Post date:** [April 27, 2022, 8:35am UTC](https://community.grafana.com/t/grafana-alert-for-cpu-memory-usage/64732/1 "2022-04-27T08:35:45Z")

</div>

Hi, I’m new on Grafana and I work on v8.5.0. I want to make an alert through Grafana that define if the CPU or Memory usage above threshold (let say 85%) it will firing an alert. What I have now are time series limit CPU/memory

limit query:  
`kube_pod_container_resource_limits{namespace="$namespace", pod="$pod", resource="cpu"}`

and cpu/memory usage query:  
`sum(rate(container_cpu_usage_seconds_total{namespace="$namespace", pod="$pod", container!="POD", container!="", pod!=""}[1m]))`

Logical to make the percentage is, `(resource_usage_query)/(resource_limit_query)*100` . I’ve tried to combine both query same as the formula but ended with `nodata` value. Is there any syntax or something I missed? I appreciate any suggestion.
