# Can i collect stats without modifying nginx core code?

**URL:** <https://www.ruby-forum.com/t/can-i-collect-stats-without-modifying-nginx-core-code/216197>\
**Category:** NGINX\
**Created:** [January 29, 2012, 11:38am UTC](https://www.ruby-forum.com/t/can-i-collect-stats-without-modifying-nginx-core-code/216197 "2012-01-29T11:38:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 29, 2012, 11:38am UTC](https://www.ruby-forum.com/t/can-i-collect-stats-without-modifying-nginx-core-code/216197/1 "2012-01-29T11:38:21Z")

</div>

Hello,  
I’m trying to write a module that will collect extended stats, that is  
more then what is offered by stub\_status. I’ve dumped a couple of stats,  
but had to modify source code outside the module. Modifying vanilla  
source isn’t an option for me. So before I begin, I was wondering if I  
could get some information:

1. Can I collect stats on every request? I want to know how many bytes  
were written in the body and headers out to the client.
2. Is it possible to collect stats on reverse proxy’s? IE: how many  
upstream connections are there, have there been, failed, 50x’s?
3. Do this all inside of a module?

Thanks in advance.

Posted at Nginx Forum:

> **[Can i collect stats without modifying nginx core code?](https://forum.nginx.org/read.php?2,221739,221739#msg-221739)**
>
> Hello, I'm trying to write a module that will collect extended stats, that is more then what is offered by stub\_status. I've dumped a couple of stats, but had to modify source code outside the module. Modifying vanilla source isn't an option for me....
