How can I change the url in the alert message so it can be correctly open from browser?

PMM version is 2.26.0. When I use the integrating alert to send alerts to slack, I can receive alters like the follwoing:

[FIRING:4]
Alert: WARNING disk space usage excceeds 80 (host prod-lex-admindb-lv-1.prod.xx.net ) mountpoint /net/nas-lv-1-ipmp2.prod.xx.net/export/mongo_backup value= 84.18570895289443
Description: disk space usage exceeds 80 on  mountpoint /net/nas-lv-1-ipmp2.prod.xx.net/export/mongo_backup
VALUE = 84.18570895289443
LABELS: map[agent_id:/agent_id/158f9fa4-7608-4087-9a96-5cd5aaa471fc agent_type:node_exporter alertgroup:PMM Integrated Alerting device:nas-lv-1-ipmp2.prod.xx.net:/export/mongo_backup foo:bar fstype:nfs ia:1 instance:/agent_id/158f9fa4-7608-4087-9a96-5cd5aaa471fc job:node_exporter_agent_id_158f9fa4-7608-4087-9a96-5cd5aaa471fc_hr-5s machine_id:/machine_id/c1783610c11331982… Show more

In the above alert message, the “FIRING:4” is a clickable link, but the link generated by PMM is wrong, e.g:
localhost:9093/alertmanager/#/alerts?receiver=%2Fchannel_id%2F87c95895-16d7-4946-9c41-da3251d14452

As the PMM runs in a docker(and we click the link out of this host), and we give the host a domain, e.g. pmm.prod.xx.net, So the correct URL should be:
pmm.prod.xx.net/alertmanager/#/alerts?receiver=%2Fchannel_id%2F87c95895-16d7-4946-9c41-da3251d14452

But I can not find where I could config this, could someone help with this, great thanks.

Another thing is How can I make the alert message contain the corresponding dashboard? Since Grafana does not support template variables so I do not bind the alert with a specific dashboard but use the alert template and alert rules.

1 Like

I omitted the http:// from the URL, as this forum only permits putting two links in one post for a new user.

1 Like

It seems related to the alertmanager config, I saw the start command at //etc/supervisord.d/alertmanager.ini

; Managed by pmm-managed. DO NOT EDIT.

[program:alertmanager]
priority = 8
command =
        /usr/sbin/alertmanager
                --config.file=/etc/alertmanager.yml
                --storage.path=/srv/alertmanager/data
                --data.retention=720h
                --web.external-url=http://localhost:9093/alertmanager/
                --web.listen-address=127.0.0.1:9093
                --cluster.listen-address=""

This file can not be directly modified. Does someone know how to config web.external-url for alertmanager? Thanks

2 Likes