Skip to content

Conversation

@yuzawa-san
Copy link
Contributor

The current behavior is to raise exception in the constructor of the GraphiteRecord object when a metric with zero values is loaded. This causes all of the other metrics (which could be fine) not to be loaded. In the example render API output for our disk usage gauges, the machine `disk.east.app2' is reporting metrics anymore after a statsd reset so gauge was reset. It would make the load of all of the other metrics fail.

disk.east.app1,1421711710,1421711770,10|44.0,44.0,44.0,44.0,44.0,None
disk.east.app2,1421711710,1421711770,10|None,None,None,None,None,None
disk.east.app3,1421711710,1421711770,10|29.0,29.0,29.0,29.0,29.0,None
disk.east.app4,1421711710,1421711770,10|56.0,56.0,56.0,56.0,56.0,None

The proposed change here sets a flag on the GraphiteRecord object if it does not contain any values. The list comprehension to generate the input to the check method has been modified to give None instead of the value for the metric (still no divide by zero errors). The None is then detected in the check method and a critical log message is logged for only that metric. The other metrics can still be processed. Additionally, the raise of the exception is moved to be triggered if the entire metrics response is empty.

The behavior for an empty metric is logging it as critical. I am open to changing the behavior in the future, possibly to something like `insufficient_data' like in AWS. Currently, I was just mirroring the level of the previous behavior.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.65%) when pulling 59471a3 on yuzawa-san:develop into 3c7967b on klen:develop.

klen added a commit that referenced this pull request Mar 9, 2015
@klen klen merged commit 12f1fc2 into klen:develop Mar 9, 2015
@klen
Copy link
Owner

klen commented Mar 9, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants