monitoringmetricsdatadog

Datadog monitor value shows with decimal


I have set up a monitor that counts the replicas in a namespace and to alert me when the replicas exceed the threshold of 0. The graph looks ok and i get values like 1, 2, 3 etc, but in the email i set it up with the variable {{ value }} and i get 1.0, 2.0, 3.0 etc.

Is there a way to show the value without decimals?

Details of monitor:

Detection method: Threshold alert

Metric: kubernetes_stace.deployment.replicas from kube_namespace:* sum by kube_namespace

Threshold: 0


Solution

  • You can use mathematical operators on variables in monitor messages, so instead of using {{value}} you can use {{eval "int(value)"}}.

    https://docs.datadoghq.com/monitors/guide/template-variable-evaluation/#examples