unable to configure grafana with graphite

后端 未结 7 1065
孤独总比滥情好
孤独总比滥情好 2021-02-10 11:44

I am using Nginx to serve both graphite and grafana (they are all running on the same server - not my desktop). I am able to access graphite via Nginx. However, grafana cannot

7条回答
  •  轮回少年
    2021-02-10 12:10

    Another thing to try would be to use a CORS proxy if you cannot edit the NGinx config. I used the NPM package corsproxy to get around the graphite CORS issue.

    Install the corsproxy package:

     mkdir graphiteProxy
     cd graphiteProxy
     npm install corsproxy
     echo "copy the version of http_proxy corsproxy depends on into"
     echo "your local node_modules"
     cp -r node_modules\corsproxy\node_modules\http-proxy node_modules\http_proxy
     touch app.js
    

    app.js:

    // point the grafana config.js to your local proxy: http://localhost:8081
    var cors_proxy = require('corsproxy')
    var http_proxy = require('http-proxy')
    cors_proxy.options = {
       target : "http://{{graphiteserver}}:8080"
    }
    http_proxy.createServer(cors_proxy).listen(8081)
    

    run the proxy:

    node app.js
    

提交回复
热议问题