Skip to content

highestAverage fail with Internal Server Error when some matching whisper databases contains "None" values #230

@bplessis

Description

@bplessis

Hi,

I'm not sure if everything should be fixed on the "graphite-api" side and will try to also fix the data-collector (netapp-harvest) but i'm not sure sending back an exception trace is really what should be done.

Here is the problem as i see it, the data collection sometime doesn't record values, probably because lack of change on the specific part of the monitored system, so a "None" is recorded in the whisper database.

When requesting/graphing (with grafana) the value using
aliasByNode(netapp.perf.$Group.$Cluster.svm.$SVM.vol.*.read_data, 7)
no problem occur but the default graphs provided with the tool have a 'highestAverage' filter on to limit the subset to the "biggest" consumers:

aliasByNode(highestAverage(netapp.perf.$Group.$Cluster.svm.$SVM.vol.*.read_data, $TopResources), 7)

When adding highestAverage the query give back something like that:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint
File "/usr/lib/python3/dist-packages/graphite_api/app.py", line 415, in render series_list = evaluateTarget(context, target, data_store)
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 71, in evaluateTarget result = evaluateTokens(requestContext, tokens, data_store)
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 103, in evaluateTokens replacements)
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 131, in evaluateTokens for arg in tokens.call.args]
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 131, in for arg in tokens.call.args]
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 103, in evaluateTokens replacements)
File "/usr/lib/python3/dist-packages/graphite_api/evaluator.py", line 137, in evaluateTokens ret = func(requestContext, *args, **kwargs)
File "/usr/lib/python3/dist-packages/graphite_api/functions.py", line 2279, in highestAverage return sorted(seriesList, key=safeAvg)[-n:] TypeError: unorderable types: float() < NoneType()

I was using debian-strech packaged 1.1.3, i also tried the latest master branch this didn't fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions