نظرة عامة على لوحة البيانات Postgresql لـ postgres_exporter (بروميثيوس)

قدم لمحة عامة عن لوحة القيادة Postgresql ل postgres_exporter .


ما الفرق عن لوحات معلومات postgres_exporter الأخرى؟


جمعت بين جميع لوحات تحكم postgres_exporter الأخرى في واحدة.


تظهر لوحة المعلومات هذه معلومات عامة حول المجموعة.


لقطات الشاشة وتعليمات التثبيت القصيرة: postgresql ، postgres_exporter ، بروميثيوس ، غرافانا تحت القط.


لماذا لا تستخدم pgwatch2 مع تدفق الملفات ؟


حول InfluxDB

1.7 ( , CORE team ):


  • . . , . DB , .
  • . , .
  • SHOW TAG KEYS FROM ALL SHOW EXACT SERIES CARDINALITY .
  • . 256 RAM, 320GB OOM — ( 6- , , (InMem)).
  • ( OSS 0.9 (December 8, 2014) 1.0 (September 26, 2014), Enterprise ).
  • breaking changes. 3 5+ ( 0.9 (December 8, 2014)). Breaking Changes — Influx 2.0, \ Buckets, Flux.
  • , ifql (Flux) Continuous Queries ( task, Flux-) Chronograf( C TICK), .
  • .
  • — - cli, . restore backup . merge .
  • TICK( T), , 1.3.2 ( [a-z]). , , Retention Policy (input,output).kafka, .. metrics -> telegraf -> kafka -> telegraf -> influx .
  • ( K TICK), , InfluxDB. RAM , , "", . .

PostgreSQL


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

تهيئة PostgreSQL.


/usr/pgsql-9.6/bin/postgresql96-setup initdb

في PostgreSQL ، أضف الامتداد pg_stat_statements إلى postgresql.conf


shared_preload_libraries = 'pg_stat_statements'

بدء PostgreSQL


systemctl start postgresql-9.6

بعد ذلك في قاعدة البيانات ، قم بتشغيل الأمر التالي:


CREATE EXTENSION pg_stat_statements

Postgres_exporter وبروميثيوس


توضيح. من سيقوم بتثبيت postgres_exporter من الثنائيات

نقوم بتثبيت Postgres_exporter و Prometheus لأنظمة Redhat من هذا المستودع: https://github.com/lest/prometheus-rpm


قم بإنشاء ملف /etc/yum.repos.d/prometheus.repoبالمحتويات التالية:


[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

قم بتثبيت prometheus2 و postgres_exporter


yum install -y prometheus2 postgres_exporter

في ملف prometheus.yml للعمل مع postgres_exporter في scrape_configs أضف القسم التالي:


scrape_configs:
  - job_name: postgresql
    static_configs:
      - targets: ['ip--prometheus:9187']
        labels:
          alias: postgres

شغّل prometheus2 و postgres_exporter


systemctl start prometheus
systemctl start postgres_exporter

جرافانا


قم بإنشاء ملف /etc/yum.repos.d/grafana.repoبالمحتويات التالية:


[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

تثبيت جرافانا


yum -y install grafana initscripts urw-fonts wget

أطلق غرافانا


systemctl start grafana-server

خذ لوحة القيادة هنا


https://grafana.com/grafana/dashboards/12273


كود المصدر هنا:


https://github.com/patsevanton/postgresql_overview_postgres_exporter












سكرتير خاص في لوحة القيادة هذه تفتقر إلى المعرفة في promql و postgresql. لذلك ، آمل أن تساعدوني في تقديم المشورة بشأن كيفية تحسين لوحة القيادة أو تقديم طلب سحب.


ملاحظة: مع وصول اليدين ، أخطط لإنشاء لوحة معلومات للحصول على معلومات حول قاعدة بيانات محددة داخل PostgreSQL.


All Articles