未找到 statsd influxdb 保留策略

标签 statsd influxdb

向 statsd 发送数据时:

echo "foo:1|c" | nc -u -w0 127.0.0.1 8125

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 ] }

运行命令显示influxDB信息:

$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SHOW MEASUREMENTS"

会成功回复:

{
    "results": [
        {
            "series": [
                {
                    "name": "measurements",
                    "columns": [
                        "name"
                    ],
                    "values": [
                        [
                            "cpu_load_short"
                        ],
                        [
                            "foo.counter"
                        ]
                    ]
                }
            ]
        }
    ]
}

那我想从influxDB查询数据:

$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT value FROM foo.counter"

我收到错误消息:

{
    "results": [
        {
            "error": "retention policy not found"
        }
    ]
}

有什么想法吗? 涌入数据库:0.9.3

最佳答案

您确实找到了正确的解决方案,即任何包含句点的标识符都必须用双引号引起来。原始查询解析为 select * from the measure "counter"from the retention policy "foo",因此出现 foo not found 错误。

关于未找到 statsd influxdb 保留策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32496339/

相关文章:

python - Fabric1 env.hosts 和 env.hosts_name 的 fabric2 替代品是什么

metrics - Grafana中从InfluxDB中获取总共两个系列的数据

udpclient - 使用 UdpClient 进行日志记录时应该是单例吗?

influxdb - 在 Influxdb 中,如何删除所有测量值?

python - 如何使用python发送nc类似命令?

Graphite :将与模式匹配的所有统计信息相加?

hadoop - 远程滚动窗口聚合——时间序列 kudu vs influxdb vs opentsdb

docker - Docker 中的 InfluxDB 错误网关

influxdb - 统计某个标签在 influxdb 中出现的次数

java - InfluxDB批量写入的意外输出