简体   繁体   中英

Unable to create charts on grafana connected to graphite

I installed graphite and it is updating with data. I also installed and configured grafana to use graphite.

When I attempt to create, charts on grafana, I get "Time series request error".

I have grafana an graphite on the same server. Is this related to Cors. I am not familiar with configuring cors etc.

How would I fix this issue?

This is my nginx.conf file:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

server {
    listen 8080 default_server;
    server_name _;
    location / {
      root /srv/www/htdocs;
      index index.html;
    }
    location /graphite/ {
        add_header 'Access-Control-Allow-Origin' *;
        proxy_pass                 http://127.0.0.1:8090/;
        proxy_set_header           X-Real-IP   $remote_addr;
        proxy_set_header           X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header           X-Forwarded-Proto  $scheme;
        proxy_set_header           X-Forwarded-Server  $host;
        proxy_set_header           X-Forwarded-Host  $host;
        proxy_set_header           Host  $host;
        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }

    location /elasticsearch/ {
        proxy_pass                 http://127.0.0.1:9200/;
        proxy_set_header           X-Real-IP   $remote_addr;
        proxy_set_header           X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header           X-Forwarded-Proto  $scheme;
        proxy_set_header           X-Forwarded-Server  $host;
        proxy_set_header           X-Forwarded-Host  $host;
        proxy_set_header           Host  $host;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }

} }

CORS is not required if you make Nginx proxy_pass. Follow my recommendation to setup Grafana with Nginx https://github.com/mikhailov/grafana/blob/master/sample/nginx_testing.conf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM