opentsdb是否接受特殊字符,如度数符号(°),%或²

问题描述 投票:0回答:2

我将温度值从我的java代码发布到opentsdb。所以在其中一个标签中我想显示测量类型,例如读数是在°C还是°F。所以我试图从java发布unicode "\u00b0",虽然在System.out.println我能够看到度数符号但是当我发布opentsdb时不接受该值。

我还阅读了文章,它定义了opentsdb接受的字符。(在Metrics and Tags section中)它定义了它接受Unicode字母。但是当我尝试发送学位的unicode时它不起作用。那么它接受这些字符的unicode吗?我怎么发送它们。 http://opentsdb.net/docs/build/html/user_guide/writing.html

java unicode special-characters opentsdb
2个回答
1
投票

以下规则适用于指标和标记值:

  1. 字符串区分大小写,即“Sys.Cpu.User”将与“sys.cpu.user”分开存储
  2. 不允许有空格。
  3. 仅允许以下字符:a到z,A到Z,0到9, - ,_,。,/或Unicode字母(根据规范)But in fact, other than above mentioned characters no other is supported by opentsdb.

0
投票

从opentsdb版本2.3开始,支持通过config变量指定其他字符(从OpenTsdb: Is Space character allowed in Metric and tag information交叉发布)

tsd.core.tag.allow_specialchars = !@#$%^&*()_+{}|: <>?~`-=[]\;',./°

http://opentsdb.net/docs/build/html/user_guide/configuration.html提供了更多细节

© www.soinside.com 2019 - 2024. All rights reserved.