From 75187bc1839bd5ba9d0ef652ee9e9037f0e2a95e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 16 Oct 2013 17:41:01 +0200 Subject: omelasticsearch: add failed.httprequests stats counter --- ChangeLog | 2 ++ plugins/omelasticsearch/omelasticsearch.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index da6dcc9a..b3632fe3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ Version 7.4.5 [v7.4-stable] 2013-09-?? Thanks to Muri Cicanor for initiating the discussion - now requires libestr 0.1.8 as early versions had a nasty bug in string comparisons +- omelasticsearch: add failed.httprequests stats counter +- bugfix omelasticsearch: correct failed.http stats counter - bugfix: mmanon did not detect all IP addresses in rewrite mode The problem occured if two IPs were close to each other and the first one was shrunk. diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c index c1b2abd0..5d4c97c3 100644 --- a/plugins/omelasticsearch/omelasticsearch.c +++ b/plugins/omelasticsearch/omelasticsearch.c @@ -60,6 +60,7 @@ DEFobjCurrIf(statsobj) statsobj_t *indexStats; STATSCOUNTER_DEF(indexSubmit, mutIndexSubmit) STATSCOUNTER_DEF(indexHTTPFail, mutIndexHTTPFail) +STATSCOUNTER_DEF(indexHTTPReqFail, mutIndexHTTPReqFail) STATSCOUNTER_DEF(indexESFail, mutIndexESFail) /* REST API for elasticsearch hits this URL: @@ -607,6 +608,7 @@ curlPost(instanceData *pData, uchar *message, int msglen, uchar **tpls, int nmsg case CURLE_COULDNT_RESOLVE_PROXY: case CURLE_COULDNT_CONNECT: case CURLE_WRITE_ERROR: + STATSCOUNTER_INC(indexHTTPReqFail, mutHTTPReqFail); indexHTTPFail += nmsgs; DBGPRINTF("omelasticsearch: we are suspending ourselfs due " "to failure %lld of curl_easy_perform()\n", @@ -1003,6 +1005,9 @@ CODEmodInit_QueryRegCFSLineHdlr ctrType_IntCtr, &indexSubmit)); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.http", ctrType_IntCtr, &indexHTTPFail)); + STATSCOUNTER_INIT(indexHTTPReqFail, mutCtrIndexHTTPReqFail); + CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.httprequests", + ctrType_IntCtr, &indexHTTPReqFail)); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.es", ctrType_IntCtr, &indexESFail)); CHKiRet(statsobj.ConstructFinalize(indexStats)); -- cgit v1.2.3