0

我正在使用 grafana 处理石墨数据,但是当我尝试解析它时出现错误。发生这种情况是因为服务器没有给我 JSON。

我正在尝试使用脚本仪表板,我正在使用的脚本是:https ://gist.github.com/anatolijd/73b1360c9780c0d161b1

function expand_filter_values行了var obj = JSON.parse(req.responseText);,显然response.text不是 JSON 对象,而是包含以下内容的 html:

< !-- Copyright 2008 Orbitz WorldWide

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -- >



< html><br>
    < head><br>
    < title>Graphite Browser< /title><br>
  < /head>


< frameset rows="60,*" frameborder="1" border="1">
  < frame src="/browser/header/" name="Header" id='header' scrolling="no" noresize="true" />

  < frame src="/composer/?query=myhost.xxx.%2A" name="content" id="composerFrame"/>

  < /frameset>
< /html>

你能帮我吗?

4

1 回答 1

0

石墨地址错了,我改了,一切正常。

于 2014-10-29T18:55:55.320 回答