prometheus london

15
Elasticsearch, Nginx monitoring with Prometheus and Grafana 2016/08/18 Wataru Yukawa(@wyukawa) Prometheus London meetup

Upload: wyukawa

Post on 12-Apr-2017

677 views

Category:

Data & Analytics


3 download

TRANSCRIPT

Page 1: Prometheus london

Elasticsearch, Nginx monitoringwithPrometheusandGrafana

2016/08/18Wataru Yukawa(@wyukawa)PrometheusLondonmeetup

Page 2: Prometheus london

WhoamI?

• DataEngineeratLINE• LINEmakesamessagingapplicationofthesamename,inadditiontootherrelatedservices

• ItisthemostpopularmessagingplatforminJapan

• IlikePremierLeague

Page 3: Prometheus london

Agenda

• browserlogcollectionsystem• monitorElasticsearch/Nginx

Page 4: Prometheus london

browser log collection system• FrontendengineerdevelopsJavaScriptbutit’sdifficulttodebugbecausetherearemanykindofbrowsers/devices.

• SowecreatebrowserlogcollectionsystemlikeGoogleAnalytics by using web beacon

• NginxlogsaresenttoESbyfluentd• Fluentd isanOSSlogcollectorlikelogstash,flume writteninruby.

Page 5: Prometheus london

Whatmiddlewareshouldbemonitored?

• Nginx• Elasticsearch• Fluentd– IwilltalkinPromCon2016

Page 6: Prometheus london

Nginxmonitoring• Usengx_http_stub_status_module

#monitoringlocation/___nginx_status{stub_statuson;allow127.0.0.1;denyall;

}

$curl-shttp://localhost/___nginx_statusActiveconnections:2serveracceptshandledrequests3010423010424242850Reading:0Writing:1Waiting:1

Page 7: Prometheus london

lifecycleofconnection

https://www.datadoghq.com/blog/how-to-monitor-nginx/

Page 8: Prometheus london

Nginxmonitoring• Usenginx_exporter– nginx_exporter usesngx_http_stub_status_moduleresult

#HELPnginx_connections_currentNumberofconnectionscurrentlyprocessedbynginx#TYPEnginx_connections_currentgaugenginx_connections_current{state="active"}2nginx_connections_current{state="reading"}0nginx_connections_current{state="waiting"}1nginx_connections_current{state="writing"}1#HELPnginx_connections_processed_totalNumberofconnectionsprocessedbynginx#TYPEnginx_connections_processed_totalcounternginx_connections_processed_total{stage="accepted"}300966nginx_connections_processed_total{stage="any"}4.241939e+06nginx_connections_processed_total{stage="handled"}300966

Page 9: Prometheus london

nginxdashboard

Page 10: Prometheus london

requestconnection

irate(nginx_connections_processed_total{...,stage="any"}[1m])

Page 11: Prometheus london

Elasticsearch monitoring

• Useelasticsearch_exporter• UseMarvel

Page 12: Prometheus london

Elasticsearch dashboard

Page 13: Prometheus london

javaheap

https://github.com/elastic/elasticsearch/issues/18635

Page 14: Prometheus london

Myfeeling

• Prometheus’squeryisreallypowerfulespeciallywhenmetrictypeiscounter

• Wecanuserate/iratefunction.• nginx_exporter and elasticsearch_exporter areconvienient– easytosetup

• PrometheusandGrafana areaperfectcombination

Page 15: Prometheus london

References

• https://github.com/discordianfish/nginx_exporter

• https://github.com/ewr/elasticsearch_exporter