i-ky / effluence

Zabbix loadable module for real-time export of history to InfluxDB
MIT License
31 stars 9 forks source link

Self-monitoring #3

Open i-ky opened 5 years ago

i-ky commented 5 years ago

Monitoring InfluxDB instance will never be the goal of this module (there should be another module for that), but adding some self-monitoring would be nice. Total and per data type number of values sent to InfluxDB, time spent doing HTTP requests, etc. This would help user to judge if the chosen Zabbix-module-InfluxDB configuration provides optimal performance.

However, there are technical difficulties. Performance metrics can be obtained by history syncer processes doing actual work, but need to be provided somehow to poller processes to report them back to Zabbix. This will require some tedious inter-process communication and I'm not going to spend time on that unless there is some serious demand.

anthonysomerset commented 5 years ago

I'd Like to add/clarify this

Specifically logging any failures to insert data to influx :)

i-ky commented 5 years ago

I wouldn't consider logging as part of self-monitoring, but logging is important as well, and if you have a case where failure hasn't been logged properly, please provide some details in a separate issue.

i-ky commented 5 years ago

I had a fresh look into the code and into InfluxDB docs and I have reassuring news.

So, right now the module is using only /write HTTP endpoint and according to documentation it should return 204 No Content if everything goes fine. If not, it will return a different response code (which module checks for) and a JSON body containing more information on the failure. Since module sets neither CURLOPT_WRITEFUNCTION nor CURLOPT_WRITEDATA, libcurl will dump response body into stdout. And since Zabbix daemons redirect their stdout into log file you should be able to find failure details there.