Re: counters for specific http status code

2016-07-26 Thread Ruoshan Huang
> > > Yes you're right. For me this one fixes it (both with http-request and > multiple http-response), is that OK for you ? > > Yes, looks good to me. -- Good day! ruoshan

Re: counters for specific http status code

2016-07-26 Thread Willy Tarreau
On Tue, Jul 26, 2016 at 08:44:59PM +0800, Ruoshan Huang wrote: > Ah, I just find a problem in this snip > > ``` > + if ((unsigned)(txn->status - 400) < > 100) > + stream_inc_http_err_ctr(s); > ``` > calling

Re: counters for specific http status code

2016-07-26 Thread Ruoshan Huang
I'm afraid I have to duplicate some logic here, like: ``` if((unsigned)(txn->status - 400) < 100) { ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_CNT); if (ptr) stktable_data_cast(ptr,

Re: counters for specific http status code

2016-07-26 Thread Ruoshan Huang
Ah, I just find a problem in this snip ``` + if ((unsigned)(txn->status - 400) < 100) + stream_inc_http_err_ctr(s); ``` calling `stream_inc_http_err_ctr` may cause the http_err_cnt be increased twice for other

Re: counters for specific http status code

2016-07-26 Thread Willy Tarreau
On Tue, Jul 26, 2016 at 06:24:50PM +0800, Ruoshan Huang wrote: > > > > If you're fine with this, I'll simply merge them with the change above, > > it's clean enough, no need to respin. Please just confirm that it's fine > > for you as well. > > > > > Yes, please ship it. > Thank you so much. OK

Re: counters for specific http status code

2016-07-26 Thread Ruoshan Huang
> > If you're fine with this, I'll simply merge them with the change above, > it's clean enough, no need to respin. Please just confirm that it's fine > for you as well. > > Yes, please ship it. Thank you so much. -- Good day! ruoshan

Re: counters for specific http status code

2016-07-26 Thread Willy Tarreau
Hi Ruoshan, On Thu, Jul 14, 2016 at 03:24:42PM +0800, Ruoshan Huang wrote: > hi, > here is my (final?) patch for implementing `http-response track-sc*` > directive. mainly I have: > - duplicate config parsing (`parse_http_res_cond`) and validation > (`check_config_validity`) code for

Re: counters for specific http status code

2016-07-25 Thread Willy Tarreau
On Mon, Jul 25, 2016 at 05:58:52AM +, Ruoshan Huang wrote: > hi Willy,    please check this thread again when you are free. thanks Hi Ruoshan, yes I've added it to my todo list. Hopefully today. thanks, Willy

Re: counters for specific http status code

2016-07-24 Thread Ruoshan Huang
hi Willy,    please check this thread again when you are free. thanks -- ruoshan from Outlook mobile On Thu, Jul 21, 2016 at 3:30 AM +0800, "Willy Tarreau" wrote: Hi Ruoshan, On Thu, Jul 14, 2016 at 03:24:42PM +0800, Ruoshan Huang wrote: > hi, > here is my

Re: counters for specific http status code

2016-07-20 Thread Willy Tarreau
Hi Ruoshan, On Thu, Jul 14, 2016 at 03:24:42PM +0800, Ruoshan Huang wrote: > hi, > here is my (final?) patch for implementing `http-response track-sc*` > directive. mainly I have: > - duplicate config parsing (`parse_http_res_cond`) and validation > (`check_config_validity`) code for

Re: counters for specific http status code

2016-07-14 Thread Ruoshan Huang
hi, here is my (final?) patch for implementing `http-response track-sc*` directive. mainly I have: - duplicate config parsing (`parse_http_res_cond`) and validation (`check_config_validity`) code for track-sc - add ACT_ACTION_TRK_SC* case in `http_res_get_intercept_rule` to do the tracking

Re: counters for specific http status code

2016-07-13 Thread Willy Tarreau
Hi Ruoshan, On Wed, Jul 13, 2016 at 07:29:57PM +0800, Ruoshan Huang wrote: > > > On Jul 12, 2016, at 12:42 PM, Willy Tarreau wrote: > > > > Please take a look at how track-sc are added to http-request, look for > > "ACT_ACTION_TRK_SC0" in proto_http.c, you'll find your way

Re: counters for specific http status code

2016-07-13 Thread Ruoshan Huang
On Jul 12, 2016, at 12:42 PM, Willy Tarreau wrote:Please take a look at how track-sc are added  to http-request, look for"ACT_ACTION_TRK_SC0" in proto_http.c, you'll find your way through it,and see if you can duplicate this to the response.I just baked some draft patchs. and get

Re: counters for specific http status code

2016-07-13 Thread Willy Tarreau
Hi Holger, On Wed, Jul 13, 2016 at 12:09:51PM +0200, Holger Just wrote: > Hi Willy, > > Willy Tarreau wrote: > >> At first I was thinking whether we could track the response status in stick > >> table, then it may be neat. but currently there isn't `http-response > >> track-sc?` directive. can

Re: counters for specific http status code

2016-07-13 Thread Holger Just
Hi Willy, Willy Tarreau wrote: >> At first I was thinking whether we could track the response status in stick >> table, then it may be neat. but currently there isn't `http-response >> track-sc?` directive. can it? > > Interesting. No it isn't, just because I think we never found a valid > use

Re: counters for specific http status code

2016-07-12 Thread Jonathan Matthews
On 12 Jul 2016 05:43, "Willy Tarreau" wrote: > That could possibly be ssh $host "halog -st < /var/log/haproxy.log" or > anything like this. On behalf of people running busy load balancers / edge proxies / etc, please don't do this ;-) Instead laptop$ halog -st <(ssh -C $balancer

Re: counters for specific http status code

2016-07-11 Thread Ruoshan Huang
> On Jul 12, 2016, at 12:42 PM, Willy Tarreau wrote: > > Please take a look at how track-sc are added to http-request, look for > "ACT_ACTION_TRK_SC0" in proto_http.c, you'll find your way through it, > and see if you can duplicate this to the response. There should be a few >

Re: counters for specific http status code

2016-07-11 Thread Willy Tarreau
On Tue, Jul 12, 2016 at 12:29:56PM +0800, Ruoshan Huang wrote: > Indeed I only care about 20 status code or so, like 400, 401, 403 (I have > been bitten many times by treating those codes as 404 :( ), and 50x also > helps a lot in our alerting system as a first method for diagnosing abnormal >

Re: counters for specific http status code

2016-07-11 Thread Ruoshan Huang
hi, > On Jul 12, 2016, at 12:05 PM, Willy Tarreau wrote: > > Hi Ruoshan, > > On Tue, Jul 05, 2016 at 12:28:43PM +0800, Ruoshan Huang wrote: >> hi, >>I use the hrsp4xx/hrsp5xx a lot to do timeseries metric collecting, >>sometimes the these counters lack details. I'm

Re: counters for specific http status code

2016-07-11 Thread Willy Tarreau
Hi Ruoshan, On Tue, Jul 05, 2016 at 12:28:43PM +0800, Ruoshan Huang wrote: > hi, > I use the hrsp4xx/hrsp5xx a lot to do timeseries metric collecting, > sometimes the these counters lack details. I'm wondering what's the > badside of no collecting all the HTTP status (just an array of

counters for specific http status code

2016-07-04 Thread Ruoshan Huang
hi, I use the hrsp4xx/hrsp5xx a lot to do timeseries metric collecting, sometimes the these counters lack details. I'm wondering what's the badside of no collecting all the HTTP status (just an array of 500 length? I know there're many empty slot in it). Currently I have to do the