Repository navigation
Replies: 4 comments 2 replies
|
The *_query_log scripts in https://git.openstreetmap.org/nominatim.git/tree/refs/heads/master:/munin should work. OpenStreetMap devops team has a prometheus exporter https://github.com/openstreetmap/prometheus-exporters/ |
|
Thank you, I didn't know about that other repository. Quick test says that it works, but there's small problem with timezones. Nominatim logs in utc, but these scripts use local time (utc+1 in my case) and don't find any data because of it. I'm not familiar with Python, but I added timezone.utc to created datetime() objects and it seems that it fixed it. Any tips how to optimize things when I'm not really interested in log? I only need it for pretty graphs, i.e. just last five minutes of it. Previously I simply deleted old records from table, but with file it's not that easy. If I had only one Munin script, I could rotate it from there and drop everything that was processed, but when I have two, it becomes problematic, unless I come up with some synchronization mechanism (which might not be too difficult...). Rotating the log asynchronously means that I will lose some data for that 5min interval when it happens. Probably not a big deal if I do it once a day. But I wonder if anyone already invented something more elegant. |
|
The munin scripts really should be cleaned up. I was thinking that we should go with the times and provide an optional Prometheus endpoint for monitoring. I would be open for a PR on that front. |
|
My current cunning plan is to use cron job that runs every 5 minutes, renames log, makes Nominatim open new one with original name, and then Munin scripts will work with the renamed one. Advantage is that I can keep only the smallest part of log that I otherwise don't need for anything, and also Munin scripts can be simplified, no more seeking and date parsing, simply take all lines. Disadvantage is that unless I missed something, making Nominatim reopen the log means reloading service and restarting all workers, which is unnecessary and also not fast at all, it takes a while before old ones stop logging in original file. I found that gunicorn is supposed to reopen logs on USR1 signal, but it probably applies only to some own logs, it doesn't do anything with Nominatim. I'm currently experimenting with following change to Nominatim, which seems to do the trick. But I've never done anything like this before, so I'm not very confident about it, it probably needs some error handling and who knows what else. |
Uh oh!
There was an error while loading. Please reload this page.
I'm replacing years old local Nominatim instance. There were some big changes like whole PHP frontend gone, but everything works. Nice.
The only thing I'm missing is monitoring. Old instance uses Munin with the scripts that are still present in repository. The one for import lag works, but other two depend on now removed new_query_log table.
Is there any replacement that I perhaps missed? It's not critical, but it was nice to have.
All reactions