{"id":303489,"date":"2020-05-13T09:00:42","date_gmt":"2020-05-13T09:00:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=303489"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=303489","title":{"rendered":"Dashboard Postgresql Overview \u0434\u043b\u044f postgres_exporter (Prometheus)"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/501696\/\">\n<p>\u0421\u0434\u0435\u043b\u0430\u043b dashboard Postgresql overview \u0434\u043b\u044f <a href=\"https:\/\/github.com\/wrouesnel\/postgres_exporter\/blob\/master\/queries.yaml\" rel=\"nofollow\">postgres_exporter<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0430\u0448\u0431\u043e\u0440\u043e\u0434\u043e\u0432 postgres_exporter?<\/p>\n<p>  <\/p>\n<p>\u042f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u044b postgres_exporter \u0432 \u043e\u0434\u0438\u043d.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0438 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435: postgresql, postgres_exporter, prometheus, grafana \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/cybertec-postgresql\/pgwatch2\" rel=\"nofollow\">pgwatch2<\/a> c <a href=\"https:\/\/github.com\/influxdata\/influxdb\" rel=\"nofollow\">influxdb<\/a>?<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e InfluxDB<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0412\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0438 \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 1.7 (\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e \u0438 \u043a \u0431\u043e\u043b\u0435\u0435 \u043c\u043b\u0430\u0434\u0448\u0438\u043c \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043a \u0441\u0442\u0430\u0440\u0448\u0438\u043c, CORE team \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c):<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u0438 \u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043b\u043e\u043c\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0448\u0435\u043d, \u043e\u0442 \u0447\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0443\u043b\u0435\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u0441\u043c\u043e\u0441. \u041b\u0435\u0447\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 DB \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/docs.influxdata.com\/influxdb\/v1.8\/tools\/influx_inspect\/\" rel=\"nofollow\">\u043a\u043e\u043c\u0430\u043d\u0434<\/a> \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/li>\n<li>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u0417\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0431\u0443\u043c\u0430\u0436\u043a\u0430\u0445 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0439\u0442\u0430, \u0430 \u0441\u043f\u0430\u0439\u043a\u043e\u0432.<\/li>\n<li>\u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u0438\u0434\u0430 <code>SHOW TAG KEYS FROM ALL<\/code> \u0438\u043b\u0438 <code>SHOW EXACT SERIES CARDINALITY<\/code> \u0438 \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0431\u0430\u0437\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0435.<\/li>\n<li>\u041f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0421\u043e\u0436\u0440\u0430\u0442\u044c 256\u0413\u0411 RAM, \u0437\u0430\u043a\u0443\u0441\u0438\u0442\u044c 320GB \u0441\u0432\u043e\u043f\u0430 \u0438 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0443\u043f\u0430\u0441\u0442\u044c \u043f\u043e OOM\u0443 \u2014 \u043b\u0435\u0433\u043a\u043e (\u0432 \u043c\u043e\u043c\u0435\u043d\u0442 6-\u0442\u0438 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043e\u043d \u0447\u0438\u0442\u0430\u0435\u0442 \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432\u0441\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u044c(InMem)).<\/li>\n<li>\u041f\u043b\u0430\u0442\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f (\u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c OSS \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/www.influxdata.com\/blog\/clustering-tags-and-enhancements-to-come-in-0-9-0\/\" rel=\"nofollow\">0.9 (December 8, 2014)<\/a> \u0438 \u0438\u0441\u0447\u0435\u0437\u043b\u0430 \u0432 <a href=\"https:\/\/www.influxdata.com\/blog\/one-year-of-influxdb-and-the-road-to-1-0\/\" rel=\"nofollow\">1.0 (September 26, 2014)<\/a>, \u0441\u0442\u0430\u0432 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0435\u0439 Enterprise \u0432\u0435\u0440\u0441\u0438\u0438).<\/li>\n<li>\u0427\u0430\u0441\u0442\u044b\u0435 breaking changes. \u0417\u0430 3 \u0433\u043e\u0434\u0430 \u0441\u043c\u0435\u043d\u0438\u043b\u0438 5+ \u0434\u0432\u0438\u0436\u043a\u043e\u0432 (\u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/www.influxdata.com\/blog\/clustering-tags-and-enhancements-to-come-in-0-9-0\/\" rel=\"nofollow\">0.9 (December 8, 2014)<\/a>). \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 Breaking Changes \u2014 \u044d\u0442\u043e Influx 2.0, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0443\u0448\u043b\u0438 \u043e\u0442 \u0411\u0430\u0437\u0430 \u0414\u0430\u043d\u043d\u044b\u0445\\\u0420\u0435\u0442\u0435\u043d\u0448\u043d \u043f\u043e\u043b\u0438\u0441\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 <a href=\"https:\/\/v2.docs.influxdata.com\/v2.0\/reference\/key-concepts\/data-elements\/#bucket\" rel=\"nofollow\">Buckets<\/a>, \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 <a href=\"https:\/\/v2.docs.influxdata.com\/v2.0\/reference\/flux\/\" rel=\"nofollow\">Flux<\/a>.<\/li>\n<li>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0444\u0438\u0447\u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 <a href=\"https:\/\/www.influxdata.com\/blog\/announcing-ifql-v0-0-3\/\" rel=\"nofollow\">ifql<\/a> (Flux) \u0438\u043b\u0438 <a href=\"https:\/\/docs.influxdata.com\/influxdb\/v1.8\/query_language\/continuous_queries\/\" rel=\"nofollow\">Continuous Queries<\/a> (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0432\u044b\u043f\u0438\u043b\u0438\u043b\u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 <a href=\"https:\/\/v2.docs.influxdata.com\/v2.0\/process-data\/common-tasks\/downsample-data\/\" rel=\"nofollow\">task<\/a>, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0442\u0435 \u0436\u0435 \u044f\u0439\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Flux-\u043e\u043c) \u0438\u043b\u0438 Chronograf(\u0431\u0443\u043a\u0432\u0430 C \u0432 TICK), \u043f\u0440\u0438 \u0436\u0438\u0432\u043e\u0439 \u0442\u043e \u0433\u0440\u0430\u0444\u0430\u043d\u0435.<\/li>\n<li>\u0411\u0435\u0437\u0430\u043b\u0430\u0431\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0440\u0435\u043b\u0438\u0437\u043e\u0432.<\/li>\n<li>\u041d\u0435 \u0441\u0430\u043c\u043e\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438\u0437 \u0431\u0430\u0437\u044b \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0442\u043e-\u0442\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 cli, \u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0444\u0430\u0439\u043b\u0438\u043a \u043d\u0435 \u043f\u0440\u043e\u043a\u0430\u0442\u0438\u0442. restore \u0438\u0437 backup \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u044e \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u0437\u0430\u0445. \u0421\u0435\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 merge \u043d\u0435 \u0437\u0430\u0432\u0435\u0437\u043b\u0438.<\/li>\n<li>\u0422\u0435\u043b\u0435\u0433\u0440\u0430\u0444 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b TICK(\u0431\u0443\u043a\u0432\u0430 T), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043d\u0438 \u043b\u043e\u043c\u0430\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u041f\u0440\u043e\u043c\u0435\u0442\u0435\u044f \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u0444\u0435 1.3.2 (<a href=\"https:\/\/github.com\/influxdata\/telegraf\/issues\/2937\" rel=\"nofollow\">\u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/a> \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0434 <code>[a-z]<\/code>). \u0418\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0432\u0435\u0440\u0440\u0430\u0439\u0434\u0438\u0442\u044c Retention Policy \u0432 (input,output).kafka, \u0442.\u0435. \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 <code>metrics -&gt; telegraf -&gt; kafka -&gt; telegraf -&gt; influx<\/code> \u0443 \u0432\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/li>\n<li>\u041a\u0430\u043f\u0430\u0441\u0438\u0442\u043e\u0440(\u0431\u0443\u043a\u0430 K \u0432 TICK), \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0441\u0435\u0431\u044f \u0432\u0435\u0434\u0435\u0442, \u043f\u043e\u0434\u0441\u0442\u0430\u0442\u044c InfluxDB. \u0412\u044b\u0436\u0438\u0440\u0430\u0435\u0442 RAM \u043a\u0430\u043a \u043d\u0435 \u0432 \u0441\u0435\u0431\u044f, \u043c\u043e\u0436\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0451 &quot;\u043e\u043a&quot;, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442. \u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u0436\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u0443\u0445\u043e\u0434\u0430.<\/li>\n<\/ul>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"postgresql\">PostgreSQL<\/h3>\n<p>  <\/p>\n<pre><code class=\"plaintext\">yum install -y https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm yum install -y postgresql96 postgresql96-server postgresql96-contrib<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c PostgreSQL.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/usr\/pgsql-9.6\/bin\/postgresql96-setup initdb<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u0440\u0442\u0443\u0435\u043c PostgreSQL<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">systemctl start postgresql-9.6<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"postgres_exporter-i-prometheus\">Postgres_exporter \u0438 Prometheus<\/h3>\n<p>  <\/p>\n<p>\u0423\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435. \u041a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c postgres_exporter \u0431\u0435\u0437 rpm \u0438\u0437 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432, \u0442\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0441\u0442\u043e\u043c: <a href=\"https:\/\/mcs.mail.ru\/help\/monitoring-with-prometheus\/postgresql-exporter\" rel=\"nofollow\">https:\/\/mcs.mail.ru\/help\/monitoring-with-prometheus\/postgresql-exporter<\/a><\/p>\n<p>  <\/p>\n<p>Postgres_exporter \u0438 Prometheus \u0434\u043b\u044f Redhat \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f: <a href=\"https:\/\/github.com\/lest\/prometheus-rpm\" rel=\"nofollow\">https:\/\/github.com\/lest\/prometheus-rpm<\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/etc\/yum.repos.d\/prometheus.repo<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[prometheus] name=prometheus baseurl=https:\/\/packagecloud.io\/prometheus-rpm\/release\/el\/$releasever\/$basearch repo_gpgcheck=1 enabled=1 gpgkey=https:\/\/packagecloud.io\/prometheus-rpm\/release\/gpgkey        https:\/\/raw.githubusercontent.com\/lest\/prometheus-rpm\/master\/RPM-GPG-KEY-prometheus-rpm gpgcheck=1 metadata_expire=300<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c prometheus2 \u0438 postgres_exporter<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">yum install -y prometheus2 postgres_exporter<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 prometheus.yml \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 postgres_exporter \u0432 scrape_configs \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">scrape_configs:   - job_name: postgresql     static_configs:       - targets: ['ip-\u0430\u0434\u0440\u0435\u0441-prometheus:9187']         labels:           alias: postgres<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c prometheus2 \u0438 postgres_exporter<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">systemctl start prometheus systemctl start postgres_exporter<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"grafana\">Grafana<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/etc\/yum.repos.d\/grafana.repo<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[grafana] name=grafana baseurl=https:\/\/packages.grafana.com\/oss\/rpm repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey=https:\/\/packages.grafana.com\/gpg.key sslverify=1 sslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c grafana<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">yum -y install grafana initscripts urw-fonts wget<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c grafana<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">systemctl start grafana-server<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0435\u0440\u0435\u043c dashboard \u0437\u0434\u0435\u0441\u044c<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/grafana.com\/grafana\/dashboards\/12273\" rel=\"nofollow\">https:\/\/grafana.com\/grafana\/dashboards\/12273<\/a><\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0443\u0442:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/patsevanton\/postgresql_overview_postgres_exporter\" rel=\"nofollow\">https:\/\/github.com\/patsevanton\/postgresql_overview_postgres_exporter<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/in\/de\/eu\/indeeudff0os9fzdqdfhrpdboby.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tr\/81\/ug\/tr81ugngobhru0miibe7bgt4rp8.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b0\/yo\/q-\/b0yoq-rwfingvptkzqdrwsdzjvi.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/km\/sb\/yc\/kmsbycvyy5zpgphtlq8enzefob4.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kj\/uw\/zq\/kjuwzqfxsglk4dzyx44w7yka_fs.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zg\/me\/xz\/zgmexzb97zio0xcr4gvbnvyeoe0.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3f\/sa\/oo\/3fsaoof3obeka8o0cjeiv2famcw.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dy\/zm\/nz\/dyzmnzfmgnbs09kaawhjjfcrqrw.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_j\/nr\/qr\/_jnrqr7jzo5jmixsyudgblw9zte.jpeg\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/e6\/w-\/p3\/e6w-p3if6zw4kug1qi327uj8nqc.jpeg\"><\/p>\n<p>  <\/p>\n<p>P.S. \u0412 \u044d\u0442\u043e\u043c \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 \u043c\u043d\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 promql \u0438 postgresql. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0432\u044b \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0432\u0435\u0442\u043e\u043c \u043a\u0430\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 pull request.<\/p>\n<p>  <\/p>\n<p>P.S. \u041a\u0430\u043a \u0440\u0443\u043a\u0438 \u0434\u043e\u0439\u0434\u0443\u0442, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0411\u0414 \u0432\u043d\u0443\u0442\u0440\u0438 PostgreSQL.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/501696\/\"> https:\/\/habr.com\/ru\/post\/501696\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/501696\/\">\n<p>\u0421\u0434\u0435\u043b\u0430\u043b dashboard Postgresql overview \u0434\u043b\u044f <a href=\"https:\/\/github.com\/wrouesnel\/postgres_exporter\/blob\/master\/queries.yaml\" rel=\"nofollow\">postgres_exporter<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0430\u0448\u0431\u043e\u0440\u043e\u0434\u043e\u0432 postgres_exporter?<\/p>\n<p>  <\/p>\n<p>\u042f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u044b postgres_exporter \u0432 \u043e\u0434\u0438\u043d.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0438 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435: postgresql, postgres_exporter, prometheus, grafana \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-303489","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303489"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303489\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}