The free version of nginx lack metrics for in-depth monitoring of the server. Lot of the useful metrics are available only in the paid version of nginx or using metrics plugins which are again non-free. The idea of this project is to expose some of the very useful metrics from nginx using the compiled in lua support for nginx.

How it works:

We have written lua code that uses nginx lua library and extract the metrics by polling nginx at regular intervals. These metrics are then pushed to a graphite server where the extracted metrics from nginx are plotted using the grafana frontend for graphite.

Challenges we ran into:

As Lua was something new for each team member, we had to understand it and then write the code.

Accomplishments that I'm proud of:

Though completely new to lua, we were able to complete the metrics collection and plotting end to end in the given time.

What I learned

We learned how we can utilise the Lua plugins and write Lua code to get internal data of nginx.

What's next for nginx metrics with lua

As of now, we have extracted only a few metrics. More metrics can be added which are available only in the paid version of nginx currently and this can be made open source as well.

Built With

  • lua
  • shell-scripts
  • java
  • graphite
  • grafana
Share this project: