{"id":1535,"date":"2020-01-28T13:11:52","date_gmt":"2020-01-28T10:11:52","guid":{"rendered":"https:\/\/artem.services\/?p=1535"},"modified":"2020-01-28T13:11:52","modified_gmt":"2020-01-28T10:11:52","slug":"prometheus-redis-exporter","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1535","title":{"rendered":"Prometheus &#8212; Redis Exporter"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-305\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo.png\" alt=\"\" width=\"1562\" height=\"476\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo.png 1562w, https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo-300x91.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo-768x234.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo-1024x312.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo-954x291.png 954w, https:\/\/artem.services\/wp-content\/uploads\/2018\/12\/Prometheus-Logo-1354x413.png 1354w\" sizes=\"(max-width: 1562px) 100vw, 1562px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Redis Exporter<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0443 &quot;<strong>prometheus<\/strong>&quot;, \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngroupadd --system prometheus\r\nuseradd -s \/sbin\/nologin --system -g prometheus prometheus\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/github.com\/oliver006\/redis_exporter\/releases\" target=\"_blank\" rel=\"noopener noreferrer\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget https:\/\/github.com\/oliver006\/redis_exporter\/releases\/download\/v1.3.5\/redis_exporter-v1.3.5.linux-amd64.tar.gz\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntar -xf redis_exporter-v1.3.5.linux-amd64.tar.gz\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncp -a redis_exporter-v1.3.5.linux-amd64\/redis_exporter \/usr\/local\/bin\/\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 <strong>Redis Exporter<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrm -rf redis_exporter-v1.3.5.linux-amd64.tar.gz\r\nrm -rf redis_exporter-v1.3.5.linux-amd64\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f <strong>Redis Exporter<\/strong>&#39;\u0430:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncat &gt;\/etc\/systemd\/system\/redis_exporter.service &lt;&lt; EOF\r\n[Unit]\r\nDescription=Prometheus Redis Exporter\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nRestart=always\r\nUser=prometheus\r\nGroup=prometheus\r\nExecStart=\/usr\/local\/bin\/redis_exporter -include-system-metrics\r\n[Install]\r\nWantedBy=multi-user.target\r\nEOF\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u0432:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl daemon-reload\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable redis_exporter\r\nsystemctl start redis_exporter\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u044b:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\t\r\nsystemctl status redis_exporter\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>Prometheus<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 <strong>Redis<\/strong> \u043c\u0435\u0442\u0440\u0438\u043a \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0433\u0434\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <strong>Prometheus<\/strong>:<\/p>\n<blockquote><p>\/etc\/prometheus\/prometheus.yml<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\t\r\nscrape_configs:\r\n- job_name: &quot;prometheus&quot;\r\n  static_configs:\r\n  - targets: ['localhost:9090']\r\n- job_name: &quot;redis&quot;\r\n  static_configs:\r\n  - targets:\r\n    - &quot;localhost:9121&quot;\r\n    labels:\r\n      host: redis\r\n<\/pre>\n<p>\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Prometheus&#8217;\u0430:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\t\r\nsystemctl reload prometheus\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>Grafana<\/h3>\n<p>\u0414\u043b\u044f <strong>Grafana<\/strong> \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <a href=\"https:\/\/grafana.com\/grafana\/dashboards\/763\" target=\"_blank\" rel=\"noopener noreferrer\">\u0434\u0430\u0448\u0431\u043e\u0440\u0434<\/a><\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1536\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49.png\" alt=\"\" width=\"2808\" height=\"1192\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49.png 2808w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-300x127.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-1024x435.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-768x326.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-1536x652.png 1536w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-2048x869.png 2048w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-954x405.png 954w, https:\/\/artem.services\/wp-content\/uploads\/2020\/01\/Screenshot-2020-01-28-at-12.09.49-1354x575.png 1354w\" sizes=\"(max-width: 2808px) 100vw, 2808px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Redis Exporter \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0443 &quot;prometheus&quot;, \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440: &nbsp; \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e: &nbsp; \u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c: &nbsp; \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b: &nbsp; \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 Redis Exporter: &nbsp; \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f Redis Exporter&#39;\u0430: &nbsp; \u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u0432: &nbsp; \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 &hellip; <a href=\"https:\/\/artem.services\/?p=1535\" class=\"more-link\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c<span class=\"screen-reader-text\"> &quot;Prometheus &#8212; Redis Exporter&quot;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41],"tags":[79,77,1195,1205],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1535"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1535"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1535\/revisions"}],"predecessor-version":[{"id":1539,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1535\/revisions\/1539"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}