石墨返回不正确的数据点 [英] Graphite returning incorrect datapoint
问题描述
- 我下载了statsd和石墨0.9.x
- 我使用了statsd源提供的stats-client,如下所示:
-
./statsd-client.sh 'development.com.alpha.operation.testing.rate:1|c'
- I downloaded statsd and graphite 0.9.x
- I used the stats-client provided with source of statsd as follows:
./statsd-client.sh 'development.com.alpha.operation.testing.rate:1|c'
然后我尝试查询最近24小时的摘要:
Then I tried querying for a summary for last 24 hours:
http://example.com/render?format=json&target=summarize(stats.development.com.alpha.operation.testing.rate , "24hours","sum",true)& from = -24hours& tz = UTC
http://example.com/render?format=json&target=summarize(stats.development.com.alpha.operation.testing.rate, "24hours", "sum",true)&from=-24hours&tz=UTC
我得到1个数据点,如下所示:
I get 1 datapoint as follows:
"datapoints": [[0.0, 1386277560]]}]
为什么我得到0.0?甚至Graphite Composer也不显示任何内容
Why I am getting 0.0? Even Graphite Composer does not display anything
当我执行10次操作时,我期望的值为"10".我做错了什么?
I was expecting a value of "10" as I performed the operation 10 times. What did I do wrong?
storage-schemas.conf
[carbon] pattern = ^carbon\. retentions = 60:90d [default_1min_for_1day] pattern = .* retentions = 60s:1d
请帮助我理解问题.
根据以下答案,我更改了存储聚合,并在metric_file.wsp上运行whisper-info后得到以下响应.但是我仍然在数据点中获得"0.0"作为值,并且Graphite浏览器不显示任何内容.
As per answer below, I changed storage-aggregation and I get following response after running whisper-info on metric_file.wsp. But I am still getting "0.0" as value in datapoint and Graphite browser does not display anything.
maxRetention: 86400 xFilesFactor: 0.0 aggregationMethod: sum fileSize: 17308 Archive 0 retention: 86400 secondsPerPoint: 60 points: 1440 size: 17280 offset: 28
我还根据另一个答案中的建议查看了stats_counts树,但相同.
I also looked at stats_counts Tree as suggested in another answer, but its the same.
我的设置有什么问题.除了以下存储聚合中的答案所建议的更改以外,我对所有内容都使用默认设置
What is wrong with my setup. I am using default setting for everything but the changes suggested by an answer below in storage-aggregation
推荐答案
在Whisper软件包中,您将获得一个脚本whisper-info.py.在适当的指标文件上调用它-
Within the whisper package, you will get a script- whisper-info.py. Invoke it on the appropriate metric file-
/whisper-info.py /opt/graphite/storage/whisper/alpha/beta/charlie.wsp
您将获得类似这样的内容
You will get something like this-
maxRetention: 31536000 xFilesFactor: 0.0 aggregationMethod: sum fileSize: 1261468 Archive 0 retention: 31536000 secondsPerPoint: 300 points: 105120 size: 1261440 offset: 28
在这里,请确保
aggregationMethod
为和,而xFilesFactor
为0.0.很有可能不是,因为这不是石墨的默认行为.现在创建一个正则表达式来获取您的指标并将其放在配置文件storage-aggregation.conf
的开头.这将确保新创建的指标遵循此新的聚合规则.您可以在此处详细了解xFilesFactor的工作原理.Here, make sure that
aggregationMethod
is sum, andxFilesFactor
is 0.0. Most probably it is not, since this isn't graphite's default behavior. Now make a regex that picks up your metrics and put it at the beginning of the config filestorage-aggregation.conf
. This will ensure that the newly created metrics follow this new aggregation rule. You can read more about how xFilesFactor works here.这篇关于石墨返回不正确的数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-