在向statsd发送数据时:
echo "foo:1|c" | nc -u -w0 127.0.0.1 8125
Run Code Online (Sandbox Code Playgroud)
statsd将在刷新后输出结果并将数据插入到InfluxDB中:
{ counters:
{ 'statsd.bad_lines_seen': 0,
'statsd.packets_received': 1,
'statsd.metrics_received': 1,
foo: 1 },
timers: {},
gauges: { 'statsd.timestamp_lag': 0 },
timer_data: {},
counter_rates:
{ 'statsd.bad_lines_seen': 0,
'statsd.packets_received': 0.03333333333333333,
'statsd.metrics_received': 0.03333333333333333,
foo: 0.03333333333333333 },
sets: {},
pctThreshold: [ 90 ] }
Run Code Online (Sandbox Code Playgroud)
运行命令以显示InfluxDB信息:
$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SHOW MEASUREMENTS"
Run Code Online (Sandbox Code Playgroud)
会成功回复:
{
"results": [
{
"series": [
{
"name": "measurements",
"columns": [
"name"
],
"values": [
[
"cpu_load_short"
],
[
"foo.counter"
]
]
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
然后我想查询来自InfluxDB的数据:
$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT value FROM foo.counter"
Run Code Online (Sandbox Code Playgroud)
我收到错误消息:
{
"results": [
{
"error": "retention policy not found"
}
]
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?流入数据库:0.9.3
您确实找到了正确的解决方案,即包含句点的任何标识符都必须加双引号.原来的查询解析为select * from the measurement "counter" from the retention policy "foo",因此foo not found错误.
| 归档时间: |
|
| 查看次数: |
3873 次 |
| 最近记录: |