grafanaとpostgresを連携してみた【docker-compose】
2064 ワード
起動方法
git clone https://github.com/guedim/grafana-postgres.git
docker-compose up -d
grafanaへログイン
git clone https://github.com/guedim/grafana-postgres.git
docker-compose up -d
ブラウザから http://localhost:3000/ へアクセス
user : admin
password: foobar
でログインする。
(grafana-postgres/grafana/dashboard/post.sh にて設定してある)
grafanaのGUIでの設定方法
Add data sourceを押して、postgresを設定する
一番難しいところが以下の設定場所。Host名がlocalhost:5432ではなくて、postgres:5432に設定する
入力後、Save & Testを押してDatabase Connection OKが出れば連携完了。
テーブルを可視化
dashboard > table > edit でsql文を書ける画面が出てくる。
https://github.com/guedim/grafana-postgres.git には元々データが入っているので、そのデータを表示した。
postgres のデータをみる
docker-compose exec postgres bash
su postgres
psql
\d #テーブル一覧表示
\l #database一覧を表示
\d account_metrics #カラム一覧を表示 カラムなのでデータベースを指定してから
\q #exit
docker-compose exec postgres bash
su postgres
psql
\d #テーブル一覧表示
\l #database一覧を表示
\d account_metrics #カラム一覧を表示 カラムなのでデータベースを指定してから
\q #exit
Author And Source
この問題について(grafanaとpostgresを連携してみた【docker-compose】), 我々は、より多くの情報をここで見つけました https://qiita.com/akihiro_kubota/items/463701c664b5ce9738d8著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .