LoginSignup
7
4

More than 5 years have passed since last update.

PrometheusのLabelの値をGrafanaのSinglestatに表示する方法

Last updated at Posted at 2017-04-05

前提

  • Grafana 4以上

概要

次のようなメトリックを mysqld_exporterで取得できます。

mysql_version_info{innodb_version="5.6.23",instance="m.lenet.jp:9104",job="mysql",version="5.6.23-log",version_comment="MySQL Community Server (GPL)"}

例えば、innodb_versionをGrafanaのSinglestatで表示したいと思うかもしれません。

これがGrafana4から可能になっています。

手順

  1. GrafanaでSinglestatを追加する
  2. Optionsタブに移動し、ValueのStatで「name」をドロップダウンリストから選択する
  3. MetricsタブのQueryに使用したいクエリを書く
  4. Legend format に使用したい値のラベル名を記載する

今回の場合ですと、クエリに「mysql_version_info」と記載し、Legend formatに「{{innodb_version}}」と記載しました。

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4