search not working in webUI

Asked by Mark Lin

Hi,

Search on the webUI is returning search request failed no matter what I put in. From webapp-error.log, I am just seeing TempalteDoesNotExist: 500.html. So I touch webapp/web/templates/500.html, so no more error. But the question remain is how do I have search working?

I tried "system", "system.*" even ".*" to find the metric entered by example python script, but none worked.

Thanks,
Mark

p.s. Graphite is just awesome!! Thanks for open sourcing it.

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
chrismd
Solved:
Last query:
Last reply:
Revision history for this message
Best chrismd (chrismd) said :
#1

So the 500.html not found error is a completely unrelated bug. It just means you don't have DEBUG = True in your local_settings.py and there is a server-side error so instead of displaying the standard Django error page (which is what you get with DEBUG = True) it is trying to return a custom error page that I am supposed to get off my lazy ass and write one of these days :)

I created Bug #424672 so I don't forget to finally fix this in the next release. I keep forgetting because I always use DEBUG = True.

As for why the search feature does not work, well that is because I am very indecisive and like to procrastinate fixing features that I don't use myself :)

Basically the only problem is that is preventing this feature from working is that an index file needs to be created. The index file should contain a list of all the metrics stored on your graphite server. They should be in a file called $GRAPHITE_ROOT/storage/index and its contents should look like this:

foo.bar.metric1
foo.bar.metric2
...

The reason this doesn't work out of the box is because I have kept changing my mind about how to create and maintain this index file. First it was a cron job but that got annoying, so then it became part of carbon (there used to be a carbon daemon that did maintenance tasks), but then carbon got rewritten and this functionality didn't survive. And so on and so forth, I just need to write a stupid script and at least put it in the documentation. An error message for the user saying something like "Tell your administrator to run the create-index script" or whatever would be nice too. I will create another bug for this so I don't forget to complete it for the next release either.

This is why open source is great. People are nice and submit bug reports and ask questions, which makes me feel bad for being lazy, thus resulting in me fixing bugs that would otherwise sit around forever :)

Thanks

Revision history for this message
Mark Lin (wedney2004-craig1) said :
#2

Thanks chrismd, that solved my question.

Revision history for this message
Tamale (uictamale) said :
#3

chris, instead of needing to maintain a flat-file, would it be too hard to add another method in the metrics section that instead of looking at a specific depth, would simply search all depths for a key term?

I'm attempting to do this right now actually, with the intent to return json objects at each level below what's matched, in other words, if you have metrics like this:

foo.bar.1.count
foo.bar.1.countFailed
foo.bar.1.pctFailed
foo.bar.2.count
foo.bar.2.countFailed
foo.bar.2.pctFailed
foo.nop.count
foo.nop.countFailed
foo.nop.pctFailed

and you search 'bar', i want this returned:

foo.bar.1
foo.bar.2

I thought I was pretty close developing this myself but I'm getting hung up on how to use the matches object..