Performance Monitoring System | Web performance monitoring system set up from 0-1


Niubi | Web performance monitoring system set up from 0-1


Tools Introduction

Niubi | Web performance monitoring system set up from 0-1

1. Statsd Node is used to develop a network daemon, which is characterized by UDP (performance, does not affect the primary promptly hung up service), or to monitor various TCP data, and transmits the aggregated data to the back-end service for processing . Common support "Graphite", "ElasticaSearch", "InfluxDB" and so on, it integrates end customers in various languages ​​API, here we use the jsocol / pystatsd: A Python client for statsd for data collection.

2. Graphite is a set of Python written in open source programming interface, it is mainly used to collect timely state of the server, where the data is mainly used as the back end of statsd. It is divided into three sub-projects

- carbon daemon that receives raw statistics StatsD sent over.

- whisper to time-series database to store statistical data.

- graphite webapp is used to graphically display statistics web projects

3. Grafana Go use development, design can adjust their statistical charts on the interface, supports multiple alarm, can be customized.

installation

Here I use the [synthesize (https://github.com/obfuscurity/synthesize) for quick installation and Statsd Graphite package, there is need to pay attention to install the following data in ** / opt / graphite ** directory. That which we started the installation

After the service carbon-cache start # statsd data processing will enter the transit 
service memcached start # cache
service collectd start # collection service load optional
service apache2 start # This can be replaced by using nginx
Service statsite Start # statsd back-end services

这里面需要单独启动graphite-web应用,端口启动:0.0.0.0:8080,后面配置数据源需要使用。

cd /opt/graphite/
sudo ./run-graphite-devel-server.py /opt/graphite/

Grafana数据包可以通过手动下载安装也可以通过apt-get 安装

  • sudo apt-get install grafana


启动之后访问3000端口就能看到这样一个页面,默认的账号密码:admin,admin可以通过配置github或者google登录。

Niubi | Web performance monitoring system set up from 0-1

login

数据收集

Python端我们使用statsd进行数据统一打点到到监控服务器收集

>>> import statsd
>>> c = statsd.StatsClient('localhost', 8125)
>>> c.incr('foo') # Increment the 'foo' counter.
>>> c.timing('stats.timed', 320) # Record a 320ms 'stats.timed'.
这里面我们通过Python把数据收集到statsite,通过Graphite Web服务来进行展示。

配置Graphite

进入Grafana后台,进行配置点击 「Data Sources」进行配置Graphite的数据(来自前端statsd收集)

Niubi | Web performance monitoring system set up from 0-1

data_source

接下来配置对应的数据展示:

Niubi | Web performance monitoring system set up from 0-1

add-graph

到此基本的数据配置就完了,恭喜你拥有了一个完整的监控系统。

To facilitate understanding here I should add, the data from within the application, add the agent, the time performance data application is sent to the server through statsd collected through carbon statistics, whisper stores the last show in graphite, in which there we grafana to replace the UI graphite native display, which is the effect of our topic map.

Guess you like

Origin www.cnblogs.com/wyf0518/p/11322570.html