I'm having problem to make grafana get metrics from graphite. It seems like the error comes from graphite itself, which need graphite-api.
Do I absolutely need graphite-api installed and running to have this work?
Thank you for your help.
With curl I can get all my metrics tree, but the browser still give me a metrics query failed error. May be I should copy and paste all my configurations here.
graphite nginx conf :
server {
listen 443;
ssl on;
ssl_certificate /etc/pki/tls/certs/dev.mydomain.net.crt;
ssl_certificate_key /etc/pki/tls/certs/dev.mydomain.net.key;
server_name graphite.mydomain.net;
#charset koi8-r;
rewrite_log off;
access_log /srv/www/graphite/access.log main;
error_log /srv/www/graphite/error.log debug;
# Proxy to Uchiwa on localhost:3000
#
location / {
proxy_pass http://graphite:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
if ($http_origin ~* "^http://metro.mydomain.net:80$"){
set $cors "true";
}
if ($request_method = 'OPTIONS') {
set $cors "${cors}options";
}
if ($request_method = 'GET') {
set $cors "${cors}get";
}
if ($request_method = 'POST') {
set $cors "${cors}post";
}
if ($cors = 'true') {
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header "Access-Control-Allow-Credentials" "true";
add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS";
add_header "Access-Control-Allow-Headers" "Authorization, origin, accept";
}
if ($cors = "trueoptions") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($cors = "truepost") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
if ($cors = "trueget") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
}
}
grafana nginx conf :
server {
#listen 443;
listen 80;
#ssl on;
#ssl_certificate /etc/pki/tls/certs/dev.mydomain.net.crt;
#ssl_certificate_key /etc/pki/tls/certs/dev.mydomain.net.key;
server_name metro.mydomain.net;
root /var/www/html/grafana;
index index.html
client_max_body_size 30M;
#charset koi8-r;
rewrite_log off;
access_log /var/www/html/grafana.access.log main;
error_log /var/www/html/grafana.error.log debug;
}
grafana config.js :
// Graphite & Elasticsearch example setup
datasources: {
graphite: {
default: true,
type: 'graphite',
url: "http://graphite.mydomain.net:8000",
render_method: 'GET',
},
/* elasticsearch: {
type: 'elasticsearch',
url: "http://my.elastic.server.com:9200",
index: 'grafana-dash',
grafanaDB: true,
}*/
},
I can't copy and paste logs here, cause they contain links, and the site is telling me I should have at least 10 reputations to post more than 2 links. While they are not real links, just urls on my server, and I don't know how to convert them in plain text so that I can post. Then I was obliged to remove all log messages in order to edit my question.
Please help me????
Thanks.
Regards