Configure Alert Manager slack URL

1,633 views
Skip to first unread message

Naftoli Gugenheim

unread,
Jul 3, 2017, 2:30:18 AM7/3/17
to Prometheus Users

I’m running prometheus and friends in docker-compose:

$ sudo docker-compose ps
             Name                           Command               State                    Ports                   
------------------------------------------------------------------------------------------------------------------
prometheus_alertman_1            /bin/alertmanager -config. ...   Up      9093/tcp                                 
prometheus_blackbox_exporter_1   /bin/blackbox_exporter -co ...   Up      9115/tcp                                 
prometheus_collectd_exporter_1   /bin/collectd_exporter -co ...   Up      0.0.0.0:25826->25826/udp, 9103/tcp       
prometheus_grafana_1             /run.sh                          Up      3000/tcp                                 
prometheus_https-portal_1        /init                            Up      0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp 
prometheus_prometheus_1          /bin/prometheus -config.fi ...   Up      9090/tcp

I have Alert Manager configured to alert to Slack. However the alert message is hyperlinked to http://f58922cbb637:9093/#/alerts. Instead it should hyperlink to https://something.com. How do I configure that?

Also, I think I read somewhere a hint that Alert Manager has its own UI. Is that where that link is supposed to go? (I guess I would give it its own subdomain.) What exactly does the UI provide? (Are there screenshots anywhere?)
Or is it supposed to link to the Prometheus UI?

Matt Palmer

unread,
Jul 3, 2017, 3:52:52 AM7/3/17
to Prometheus Users
On Mon, Jul 03, 2017 at 06:30:06AM +0000, Naftoli Gugenheim wrote:
> I have Alert Manager configured to alert to Slack. However the alert
> message is hyperlinked to http://f58922cbb637:9093/#/alerts. Instead it
> should hyperlink to https://something.com. How do I configure that?

-web.external-url=https://something.com

> Also, I think I read somewhere a hint that Alert Manager has its own UI. Is
> that where that link is supposed to go? (I guess I would give it its own
> subdomain.) What exactly does the UI provide? (Are there screenshots
> anywhere?)

The Alertmanager UI provides a user interface to silence alerts and view
currently active alerts. I am not aware of any publicly available
screenshots.

- Matt

Naftoli Gugenheim

unread,
Jul 5, 2017, 6:43:55 PM7/5/17
to Prometheus Users
Anyone?

Conor Broderick

unread,
Jul 5, 2017, 7:12:02 PM7/5/17
to Naftoli Gugenheim, Prometheus Users
Can you post your alertmanager configuration file? 

Anyone?
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CANpg8PA96QbtnoazDzTky%3DDQ%3DWaZ_h0zCa6JvHNfASHbHC3i9Q%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--

Naftoli Gugenheim

unread,
Jul 5, 2017, 10:16:09 PM7/5/17
to Conor Broderick, Prometheus Users

You mean alertman.yml? It’s just this:

        route:
          receiver: slack-team-ops
        receivers:
          - name: slack-team-ops
            slack_configs:
              - send_resolved: true
                api_url: "https://hooks.slack.com/services/XXX/YYY/ZZZ"
                channel: team-ops

On Wed, Jul 5, 2017 at 7:12 PM Conor Broderick <conor.b...@robustperception.io> wrote:
Can you post your alertmanager configuration file? 

On 5 July 2017 at 23:43, Naftoli Gugenheim <nafto...@gmail.com> wrote:
Anyone?

On Mon, Jul 3, 2017 at 2:30 AM Naftoli Gugenheim <nafto...@gmail.com> wrote:

I’m running prometheus and friends in docker-compose:

$ sudo docker-compose ps
             Name                           Command               State                    Ports                   
------------------------------------------------------------------------------------------------------------------
prometheus_alertman_1            /bin/alertmanager -config. ...   Up      9093/tcp                                 
prometheus_blackbox_exporter_1   /bin/blackbox_exporter -co ...   Up      9115/tcp                                 
prometheus_collectd_exporter_1   /bin/collectd_exporter -co ...   Up      0.0.0.0:25826->25826/udp, 9103/tcp       
prometheus_grafana_1             /run.sh                          Up      3000/tcp                                 
prometheus_https-portal_1        /init                            Up      0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp 
prometheus_prometheus_1          /bin/prometheus -config.fi ...   Up      9090/tcp

I have Alert Manager configured to alert to Slack. However the alert message is hyperlinked to http://f58922cbb637:9093/#/alerts. Instead it should hyperlink to https://something.com. How do I configure that?

Also, I think I read somewhere a hint that Alert Manager has its own UI. Is that where that link is supposed to go? (I guess I would give it its own subdomain.) What exactly does the UI provide? (Are there screenshots anywhere?)
Or is it supposed to link to the Prometheus UI?

--
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-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.

Matt Palmer

unread,
Jul 5, 2017, 10:34:42 PM7/5/17
to Naftoli Gugenheim, Prometheus Users
On Wed, Jul 05, 2017 at 10:43:42PM +0000, Naftoli Gugenheim wrote:
> Anyone?

https://groups.google.com/d/msg/prometheus-users/r5mWacTtbVU/lKoWfaLZAgAJ

- Matt

nafg

unread,
Jul 5, 2017, 10:58:28 PM7/5/17
to Prometheus Users, nafto...@gmail.com, mpa...@hezmatt.org
Oh thanks, I don't know why your previous message didn't reach my email inbox.

nafg

unread,
Jul 5, 2017, 10:58:47 PM7/5/17
to Prometheus Users, mpa...@hezmatt.org


On Monday, July 3, 2017 at 3:52:52 AM UTC-4, Matt Palmer wrote:
On Mon, Jul 03, 2017 at 06:30:06AM +0000, Naftoli Gugenheim wrote:
> I have Alert Manager configured to alert to Slack. However the alert
> message is hyperlinked to http://f58922cbb637:9093/#/alerts. Instead it
> should hyperlink to https://something.com. How do I configure that?

-web.external-url=https://something.com

Is that documented somewhere?

Matt Palmer

unread,
Jul 6, 2017, 12:45:31 AM7/6/17
to Prometheus Users
On Wed, Jul 05, 2017 at 07:58:46PM -0700, nafg wrote:
> On Monday, July 3, 2017 at 3:52:52 AM UTC-4, Matt Palmer wrote:
> > On Mon, Jul 03, 2017 at 06:30:06AM +0000, Naftoli Gugenheim wrote:
> > > I have Alert Manager configured to alert to Slack. However the alert
> > > message is hyperlinked to http://f58922cbb637:9093/#/alerts. Instead it
> > > should hyperlink to https://something.com. How do I configure that?
> >
> > -web.external-url=https://something.com
>
> Is that documented somewhere?

$ docker run --rm -it prom/alertmanager -h
Usage of /bin/alertmanager:
-config.file string
Alertmanager configuration file name. (default "alertmanager.yml")
-data.retention duration
How long to keep data for. (default 120h0m0s)
-log.format value
Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true" (default "logger:stderr")
-log.level value
Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal] (default "info")
-mesh.listen-address string
mesh listen address. Pass an empty string to disable. (default "0.0.0.0:6783")
-mesh.nickname string
mesh peer nickname (default "4f477582dfeb")
-mesh.password string
password to join the peer network (empty password disables encryption)
-mesh.peer value
initial peers (may be repeated)
-mesh.peer-id string
mesh peer ID (default: MAC address)
-storage.path string
Base path for data storage. (default "data/")
-version
Print version information.
-web.external-url string
The URL under which Alertmanager is externally reachable (for example, if Alertmanager is served via a reverse proxy). Used for generating relative and absolute links back to Alertmanager itself. If the URL has a path portion, it will be used to prefix all HTTP endpoints served by Alertmanager. If omitted, relevant URL components will be derived automatically.
-web.listen-address string
Address to listen on for the web interface and API. (default ":9093")
-web.route-prefix string
Prefix for the internal routes of web endpoints. Defaults to path of -web.external-url.

- Matt

Naftoli Gugenheim

unread,
Jul 6, 2017, 3:33:38 AM7/6/17
to Matt Palmer, Prometheus Users
Thanks.

Now I have another issue. In the Alert Manager UI, on an alert, the Source link goes to a similar broken URL:


--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/r5mWacTtbVU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.

To post to this group, send email to promethe...@googlegroups.com.

jorg.h...@gmail.com

unread,
Jul 6, 2017, 8:03:11 AM7/6/17
to Prometheus Users, mpa...@hezmatt.org


On Thursday, July 6, 2017 at 9:33:38 AM UTC+2, nafg wrote:
Thanks.

Now I have another issue. In the Alert Manager UI, on an alert, the Source link goes to a similar broken URL:


+1  This also affects the Source link in the emails that alertmanager is sending out, is this adaptable somewhere without creating a custom template ?

Jorg
Reply all
Reply to author
Forward
0 new messages