本文介绍了Kairosdb错误指标[0](name = abcd).tag [xyz] .value不能为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令在kairosdb中插入数据:

I am inserting data in kairosdb using the command: reference

但在kairosdb.log文件中我得到以下错误:

but in the kairosdb.log file I am getting following error:

08-10|13:54:33.443 [main] INFO  [Main.java:267] -      KairosDB service started
08-10|13:54:33.443 [main] INFO  [Main.java:268] - ------------------------------------------
08-10|14:00:38.236 [main] INFO  [TelnetServerModule.java:42] - Configuring module TelnetServerModule
08-10|14:00:39.259 [main] INFO  [CassandraHostRetryService.java:48] - Downed Host Retry service started with queue size -1 and retry delay 10s
08-10|14:00:39.357 [main] INFO  [JmxMonitor.java:52] - Registering JMX me.prettyprint.cassandra.service_kairosdb-cluster:ServiceType=hector,MonitorType=hector
08-10|14:00:39.734 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.023 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.216 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.295 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.391 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.
08-10|14:00:40.439 [main] ERROR [Main.java:345] - metric[0](name=meterreadings).tag[building_type].value may not be empty.

我的export.txt档案是:

My export.txt file is:

administrator@administrator-IdeaCentre-Q190:~/Abharthan/kairosdb$ head -10 export.txt
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"1","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"34.85"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"2","building_type":"Park","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"3","building_type":"Industrial","meter_type":"temperature","unit":"F"},"value":"0.07"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"4","building_type":"RecreationCenter","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"5","building_type":"Park","meter_type":"temperature","unit":"F"},"value":"2.2"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"6","building_type":"CommunityCenter","meter_type":"temperature","unit":"F"},"value":"31.41"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"7","building_type":"Office","meter_type":"temperature","unit":"F"},"value":"0"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"8","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"10.88"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"9","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"42.27"}
{"name": "meterreadings", "timestamp":"1359695700","tags": {"Building_id":"10","building_type":"ElementarySchool","meter_type":"temperature","unit":"F"},"value":"10.14"}

请建议如何解决此错误。

Please suggest how to fix this error.

推荐答案

通常,您描述的问题来自提供的没有关联值的标签。 TIt看起来像在您的building_type的空值为10的第一行后面有值(查找building_type:或类似的)。

usually the problem you describe comes from tags being provided with no associated value. TIt looks like you have values after the 10 first lines with empty value for building_type (look for "building_type":"" or similar).

通过查看你的JSON我看到几个不相关的可能的问题:

By looking at your JSON I see several unrelated possible problems :


  • 你的时间戳似乎是在Unix秒 - 它应该以毫秒为单位(由于OpenTSDB兼容性,可以使用Telnet API,但KairosDB需要毫秒)

  • 您的时间戳总是相同的(因此您更新相同的样本, / li>
  • 您的值是一个字符串(您可能想使用长或浮动),它可能会工作,但我不建议这样做

这篇关于Kairosdb错误指标[0](name = abcd).tag [xyz] .value不能为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 01:23