How to edit a link in a weak notification from Grafana

We are using Grafana 4 and have implemented weak alert alerts on the incoming Webhook. Notifications are sent as expected, except that the link in the notification indicates the wrong place. For example, if you accept the following test notification:

enter image description here

Then I expect that the link in the [Alerting] Test notification will point to the Grafana server. However, the host in this link is localhost. I thought this might just be a test notifications problem, but it also happens with real notifications: the path will be correct, but the host and port will be wrong (localhost: 62033, for full details).

I tried to find the place where this host / port is configured, with no luck. Any clues to fix this?

Thanks in advance.

+7
slack grafana
source share
2 answers

There are several options that you can add to your ini file to tell Grafana how to create self-relational URLs:

 #################################### Server ############################## [server] # Protocol (http or https) protocol = http # The http port to use http_port = 3000 # The public facing domain name used to access grafana from a browser domain = localhost # The full public facing url root_url = %(protocol)s://%(domain)s:%(http_port)s/ 

You should start by setting the correct protocol , http_port and domain values. If you are accessing Grafana on port 80 or 443 and do not want the port to be explicitly specified in the URL, you can remove :%(http_port) from the root_url parameter.

+6
source share

In addition to editing grafana.ini , if you use Grafana in a Docker container, you can also pass this to the container using environment variables (the example uses the grafana / grafana container by default).

docker run \ -d \ -p 3000:3000 \ --name=grafana \ -e "GF_SERVER_ROOT_URL=http://grafana.server.name:3000" \ grafana/grafana

+1
source share

All Articles