<p>I was trying to get an alert in slack from Datadog when kubernet crojob  fail.
I have a query to get pod failure notification when its crashloop but not sure how to update the query for the cronjob failure</p>
<pre><code>max(last_10m) :avg:kubernets_state.contaier.status_report.count.waiting{reason:crashloopbackoff !pod_phase:succeeded} by {kube_cluster_name, kube_namespace,pod_name,kubernetes.io/clusster/cluster_name}.rollup(avg, 120) &gt;=1
</code></pre>

Rajesh174u
<p>Can you use the <code>kubernetes_state.job.completion.failed</code> metric?</p>
<p>For example:</p>
<pre><code>max(last_5m):max:kubernetes_state.job.completion.failed{*} by {kube_cluster_name,kube_namespace,kube_cronjob} &gt;= 1
</code></pre>
<p>Note that there are two different tags, <code>kube_cronjob</code>, which is the name of the cron job, and <code>kube_job</code> which is the name of the instance of the job.</p>
<p>See also <a href="https://docs.datadoghq.com/containers/kubernetes/data_collected/" rel="nofollow noreferrer">the docs</a>.</p>
