我无法让 grafana 从石墨中获取指标。似乎错误来自石墨本身,它需要graphite-api。
我是否绝对需要安装和运行石墨 API才能完成这项工作?
谢谢您的帮助。
使用 curl 我可以获得所有指标树,但浏览器仍然给我一个指标查询失败错误。也许我应该在这里复制并粘贴我的所有配置。
石墨 nginx 配置:
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 配置:
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,
}*/
},
我无法在此处复制和粘贴日志,因为它们包含链接,并且该网站告诉我我应该至少有 10 个声誉才能发布超过 2 个链接。虽然它们不是真正的链接,只是我服务器上的 url,我不知道如何将它们转换为纯文本以便我可以发布。然后我必须删除所有日志消息才能编辑我的问题。
请帮我????
谢谢。
问候