Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[Feature Request] Running Grafana behind a proxy (grafana.net access) #5057
Grafana version: grafana-3.0.2-1463383025.x86_64
When installing Grafana3 on a system that requires using a HTTP proxy to reach the internet, Grafana is unable to reach grafana.net to check for plugins:
I was able to work around this by editing my init file adding this block to the 'start' section:
I was then experimenting with using grafana-cli for installing the clock plugin and ran into similar issue, had to set the proxy variables in my shell, then could do plugin install.
My preference would be that 'outbound' proxy could be set in grafana.ini, and that would be used by both grafana-server and grafana-cli.
Most package management systems have some way of setting a proxy via config (yum, apt, npm, git, etc). While it's certainly possible for me to edit the init file by hand (or via automation) and to set environment variables, it creates extra (and un-documented) work for anyone who would want to use grafana.net for plugins. Without my manual edits, my logs were filling up with failure messages of 'checking for updates'.
Long term, I'm going to have to do work to verify there's no changes to the init file on each release/update of grafana to ensure my edited copy that adds proxy settings hasn't deviated. While it seems simple enough to set my personal environment variables before using the CLI, if I had to do that each time I wanted to do git clone, I'd find another solution. In theory, I could set the proxy env vars in my bashrc, except I need to use sudo to actually install grafana-plugins, and our enterprise standard for sudo strips custom env vars. So then my option is to su to root, set the proxy settings in roots shell for all systems.
Or, there could be an option in grafana.ini for 'http_proxy' that was used by grafana-server and grafana-cli.
In the end, if you want to encourage usage of grafana.net especially among Enterprises, adding proxy support is like getting a surprise extra piece of bacon with breakfast.
Is there a way to disable grafana-server from attempting to check grafana.net for plugins altogether?
you don't have to do that, you can modify the environments file placed where they usually are (
But if it's true that it is common for server tools to have a proxy config, then I am open for it.
You can try setting the proxy info in /etc/environment . Grafana-server is running as a different user. But yes, a config option would be great. I brought this up when the cloudwatch ds was implemented. I could work on integrating the go module that reads from ENV:http_(https,no)proxy; but probably won't be able to get to it till next week.
func ProxyFromEnvironment(req _Request) (_url.URL, error)
It's not possible to set this environment flag in Windows - so a command line paramter would be great!
Failed to send requesterrorGet https://grafana.net/api/plugins/repo/grafana-cloc