以下命令按预期返回指标:
curl " http://graphite.metrics:8080/metrics/find?format=completer&query=server *.cache"
{"metrics": [
{"is_leaf": "1", "path": "server1200.cache", "name": "cache"},
{"is_leaf": "1", "path": "server1201.cache", "name": "cache"},
{"is_leaf": "1", "path": "server1202.cache", "name": "cache"},
{"is_leaf": "1", "path": "server1203.cache", "name": "cache"},
{"is_leaf": "1", "path": "server1205.cache", "name": "cache"}
]
}
如果我使用 Cubism.js 尝试相同的查询,我会得到“无法找到指标”:
var context = cubism.context()
.serverDelay(60 * 1000)
.step(60 * 1000)
.size(1440);
var graphite = context.graphite("http://graphite.metrics:8080");
graphite.find("metricXX*", function(error, results){
alert(error);
});
如果 Cubism.js 在内部执行相同的请求,为什么找不到指标?