The best way to exclude certain labels for certain alerts is to aggregate
them away in the alert expression. Which aggregation (sum, avg, max, min
etc) makes sense depends on the semantics if the metric.

Yes, you can change the alert email template, there are examples how to do
that here: https://prometheus.io/docs/alerting/latest/notification_examples/

For reference, the default template is here, you can work off that or start
from scratch:
https://github.com/prometheus/alertmanager/blob/master/template/email.html

/MR

On Wed, Mar 3, 2021, 20:31 rajasekhar kommineni <rajaco...@gmail.com> wrote:

> Hi All,
>
> I want to exclude Labels for each item in the alerts. Is there are way to
> that
>
> Also I would like to know if we can modify the email template to send the
> below alerts in tabular format.
>
> *[3] Firing*
> *Labels*
> alertname = Low data disk space
> device = /dev/sda4
> fstype = xfs
> instance = node1
> job = Node_Exporter
> mountpoint = /data1
> severity = warning
> *Annotations*
> description = Free Space Percentage for /data1 is 91.00
> summary = Low Disk Space on node1
> Source
> <http://nwslprometcp001.inmar.com:9090/graph?g0.expr=ceil%28%28%28node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+-+node_filesystem_free_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D%29+%2F+node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+%2A+100%29%29+%3E+85&g0.tab=1>
>
> *Labels*
> alertname = Low data disk space
> device = /dev/sda4
> fstype = xfs
> instance = node2
> job = Node_Exporter
> mountpoint = /data1
> severity = warning
> *Annotations*
> description = Free Space Percentage for /data1 is 87.00
> summary = Low Disk Space on node2
> Source
> <http://nwslprometcp001.inmar.com:9090/graph?g0.expr=ceil%28%28%28node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+-+node_filesystem_free_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D%29+%2F+node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+%2A+100%29%29+%3E+85&g0.tab=1>
>
> *Labels*
> alertname = Low data disk space
> Application = RxReturns
> Product = Incorta
> device = xfs
> fstype = nfs
> instance = node3
> job = Node_Exporter
> mountpoint = /var
> severity = warning
> *Annotations*
> description = Free Space Percentage for /var is 92.00
> summary = Low Disk Space on node3
> Source
> <http://nwslprometcp001.inmar.com:9090/graph?g0.expr=ceil%28%28%28node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+-+node_filesystem_free_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D%29+%2F+node_filesystem_size_bytes%7Bfstype%21~%22tmpfs%7Crootfs%22%2Cmountpoint%21~%22%2Ftmp%7C%2Fboot%7C%2Fvar%7C%2Fusr%22%7D+%2A+100%29%29+%3E+85&g0.tab=1>
>
> Thanks,
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/e2ebb81e-9da6-4f31-8123-2c428fa2c65an%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/e2ebb81e-9da6-4f31-8123-2c428fa2c65an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAMV%3D_gYjPjA5dbkJRs0pp-faPYP4iZ%3DooGtgiTgak%3DyDsjy_Fw%40mail.gmail.com.

Reply via email to