Prometheus設定ファイル(jpc_prometheus_server.yml)
形式
YAML形式で記述します。
global: scrape_interval: 1m scrape_timeout: 10s evaluation_interval: 1m external_labels: jp1_pc_prome_hostname: "監視エージェントのホスト名" : (略) : scrape_configs※: - job_name: スクレイプジョブ名 file_sd_configs: - files: - ディスカバリ設定ファイル名 relabel_configs: - target_label: jp1_pc_nodelabel replacement: Node exporter - regex: (jp1_pc_category|jp1_pc_trendname) action: labeldrop : (略) : remote_write: - url: http://JP1/IM - Agentのホスト名:20727/ima/api/v1/proxy/service/promscale/api/v1/write remote_timeout: 30s send_exemplars: false queue_config: capacity: 10000 max_shards: 200 min_shards: 4 max_samples_per_send: 3000 batch_send_deadline: 10s min_backoff: 100ms max_backoff: 10s
- 注※
-
Script exporterのディスカバリをHTTPベースの「http_sd_config方式」で指定する場合,このファイルのscrape_configsのhttp_sd_configs.urlに直接エンドポイントを指定します。
scrape_configsのhttp_sd_configs.urlに指定するScript exporterのHTTPベースのサービスディスカバリエンドポイントを次に示します。
http://インストールホスト名:Script exporterのポート番号/discovery
file_sd_configsと異なり,http_sd_configsではラベルを独自に追加できないため,relabel_configsでラベルを追加する必要があります。必要なラベルについては,マニュアル「JP1/Integrated Management 3 - Manager 構築ガイド」の「1.21.2(10)(b)Script exporterのスクレイプ定義」を参照してください。
ファイル
jpc_prometheus_server.yml
jpc_prometheus_server.yml.model(モデルファイル)
格納先ディレクトリ
■統合エージェントホスト
- Windowsの場合
-
-
物理ホストのとき
Agentパス\conf\
-
論理ホストのとき
共有フォルダ\jp1ima\conf\
-
- Linuxの場合
-
-
物理ホストのとき
/opt/jp1ima/conf/
-
論理ホストのとき
共有ディレクトリ/jp1ima/conf/
-
説明
Prometheus serverの動作を規定する設定ファイルです。
文字コード
UTF-8(BOM無し)
改行コード
Windowsの場合:CR+LF
Linuxの場合:LF
定義の反映時期
Prometheus serverのリロードAPIを実行したとき,または,Prometheus serverを再起動したときに,Prometheus serverの動作に反映されます。
また,jp1_pc_prome_hostnameラベルの値,または,スクレイプ定義(scrape_configsの定義)を変更した場合は,上記の操作を行ったあと,jddcreatetreeコマンドおよびjddupdatetreeコマンドを実行したときに,統合オペレーション・ビューアーのツリーの表示内容に反映されます。
記述内容
下記の表で使用している一般的なプレースホルダーの定義については,「ymlファイルの記述項目で使用している一般的なプレースホルダーの定義について」を参照してください。
項目名 |
説明 |
変更可否 |
JP1/IM - Agentでユーザーが設定する内容 |
JP1/IM - Agentのデフォルト値 |
|||
---|---|---|---|---|---|---|---|
global: |
− |
△ |
− |
− |
|||
[ scrape_interval: <duration> | default = 1m ] |
ターゲットへのスクレイプ間隔を15秒から24時間の範囲で指定します。 値は数字と単位で指定します。指定できる単位はs(秒)とm(分)とh(時)です。 <設定例> global: scrape_interval: 5m |
○ |
スクレイプ間隔を指定します。※ |
scrape_interval:1m |
|||
[ scrape_timeout: <duration> | default = 10s ] |
スクレイプ要求のタイムアウト時間を10秒から60分の範囲で指定します。 値は数字と単位で指定します。指定できる単位はs(秒)とm(分)です。 global.scrape_intervalよりも小さい値を指定する必要があります。 <設定例> global: scrape_timeout: 20s |
○ |
必要に応じて設定します。 |
scrape_timeout: 10s |
|||
[ evaluation_interval: <duration> | default = 1m ] |
アラートルールの評価間隔を15秒から48時間の範囲で指定します。 値は数字と単位で指定します。指定できる単位はs(秒)とm(分)とh(時間)です。 <設定例> global: evaluation_interval: 15s |
○ |
必要に応じて設定します。 |
evaluation_interval: 1m |
|||
external_labels: |
リモートライトやAlertmanagerへ通知する際に追加するラベルを指定します。30個まで指定できます。 |
△ |
− |
− |
|||
[ <labelname>: <labelvalue> ... ] |
ラベル名とラベルの値を指定します。ラベル名とラベルの値はそれぞれ255バイトまで指定できます。 なお,デフォルトで設定済みのjp1_pc_prome_hostnameラベルは削除しないでください。 <設定例> global: external_labels: labelname1: valuename1 labelname2: valuename2 |
○ |
監視モジュールのインストールスクリプトで設定されるため,通常は変更不要です。 クラスタ環境の場合は手動で論理ホスト名を設定します。 |
external_labels: jp1_pc_prome_hostname: "ホスト名" |
|||
rule_files: |
アラートルールファイルを指定します。30個まで指定できます。 |
△ |
− |
− |
|||
[ - <filepath_glob> ... ] |
ファイル名を指定します。ファイル名は255バイトまで指定できます。 <設定例> rule_files: - " jpc_alerting_rules.yml" - "alerting_rules2.yml" |
○ |
ルールファイル名の変更,追加,削除ができます。 通常は変更不要です。 |
rule_files: - "jpc_alerting_rules.yml" |
|||
scrape_configs: |
スクレイプ定義を指定します。30個まで指定できます。 |
△ |
− |
− |
|||
[ - <scrape_config> ... ] |
下記の<scrape_config>の説明を参照してください。 |
○ |
スクレイプ定義を追加できます。 ユーザー独自のExporterなどがある場合は定義を追加します。 通常は変更不要です。 |
デフォルトで定義されている内容については,下記の<scrape_config>の説明を参照してください。 |
|||
alerting: |
Alertmanagerに関する設定を行います。 |
△ |
− |
− |
|||
alert_relabel_configs: |
アラート通知の際のリラベリングを設定します。 |
△ |
− |
− |
|||
[ - <relabel_config> ... ] |
下記の<relabel_config>の説明を参照してください。 |
○ |
アラートのラベルを追加,変更したい場合に指定します。 |
− |
|||
alertmanagers: |
アラート通知先のAlertmanagerを設定します。 |
△ |
− |
− |
|||
[ - <alertmanager_config> ... ] |
下記の<alertmanager_config>の説明を参照してください。 |
○ |
アラート通知先として同居するAlertmanagerを指定します。 |
− |
|||
remote_write: |
リモートライトに関する設定を行います。 |
△ |
− |
− |
|||
url: <string> |
リモートライトの送信先エンドポイントを指定します。 <設定例> remote_write: - url: http://統合エージェントホスト名:20727/ima/api/v1/proxy/service/promscale/write |
◎ |
同一ホスト上のimagentのリモートライトエンドポイントを指定します。 利用環境に合わせてホスト名とポート番号を変更します。 |
url: http://統合エージェントホスト名:20727/ima/api/v1/proxy/service/promscale/write |
|||
[ remote_timeout: <duration> | default = 30s ] |
リモートライトのタイムアウト時間を30秒から60分の範囲で指定します。 値は数字と単位で指定します。指定できる単位はs(秒)とm(分)です。 <設定例> remote_write: - url: http://統合エージェントホスト名:20727/ima/api/v1/proxy/service/promscale/write remote_timeout: 1m |
○ |
リモートライトがタイムアウトしてしまう場合は値を大きくしてください。 |
remote_timeout: 30s |
|||
write_relabel_configs: |
リモートライト時のリラベリングを設定します。 |
△ |
− |
− |
|||
[ - <relabel_config> ... ] |
下記の<relabel_config>の説明を参照してください。 <設定例> node_exporterコマンドで取得するnode_boot_time_secondsとnode_context_switches_totalをリモートライトしたくない場合の設定例を,次に示します。 remote_write: - url: http://統合エージェントホスト名:20727/ima/api/v1/proxy/service/promscale/write write_relabel_configs: - source_labels: ['__name__'] regex: '(node_boot_time_seconds|node_context_switches_total)' action: 'drop' |
○ |
特定のメトリックをリモートライトしたくない場合に指定します。 |
− |
|||
[ send_exemplars: <boolean> | default = false ] |
Exemplarsをリモートライトする場合に指定します。 |
△ |
− |
send_exemplars: false |
|||
queue_config: |
リモートライト用のキューを設定します。 |
△ |
− |
− |
|||
[ capacity: <int> | default = 2500 ] |
バッファリングするサンプル数を指定します。 |
△ |
− |
capacity: 10000 |
|||
[ min_shards: <int> | default = 1 ] |
リモートライトの並列実行数の下限を指定します。 |
△ |
− |
min_shards: 4 |
|||
[ max_samples_per_send: <int> | default = 500] |
一度にまとめて送信するサンプルの最大数を指定します。 |
△ |
− |
max_samples_per_send: 3000 |
|||
[ batch_send_deadline: <duration> | default = 5s ] |
キューに残ったサンプルをフラッシュするまでの待ち時間を指定します。 |
△ |
− |
batch_send_deadline: 10s |
|||
[ min_backoff: <duration> | default = 30ms ] |
送信リトライの待ち時間の下限を指定します。 |
△ |
− |
min_backoff: 100ms |
|||
[ max_backoff: <duration> | default = 100ms ] |
送信リトライの待ち時間の上限を指定します。 |
△ |
− |
max_backoff: 10s |
- (凡例)
-
◎:設定必須 〇:変更可 △:変更不可 −:該当なし
- 注※
-
この値を初期値(1m)から変更する場合,メトリック定義ファイルのPromQL文で指定している範囲ベクトルセレクターの値(大括弧{ }で指定する時刻範囲)を見直してください。範囲ベクトルセレクターには,スクレイプ間隔の2倍以上の値を指定してください。2倍未満の値を指定すると,トレンド情報が取得できなかったり,一部の時刻のトレンド情報が取得できなかったりします。
また,Yet another cloudwatch exporterを使用して監視を行うときは,10m以上の値を指定しないでください。指定した場合,jddcreatetreeコマンドを実行したときに構成を取得できないことがあります。
-
<scrape_configs>
scrape_configsセクションは,ターゲットとそれらをスクレイピングする方法を説明するパラメーターのセットを指定します。
一般的には,1つのスクレイプ構成で1つのジョブが指定されます。高度な構成では,これは変更される可能性があります。
ターゲットは,static_configsパラメーターを介して静的に構成することも,サポートされているサービス検出メカニズムの1つを使用して動的に検出することもできます。
さらに,relabel_configsを使用すると,スクレイピングする前に,ターゲットとそのラベルを高度に変更できます。
項目名
説明
変更可否
JP1/IM - Agentでユーザーが設定する内容
JP1/IM - Agentのデフォルト値
job_name: <job_name>
スクレイプ定義の名前を指定します。この値はパフォーマンスデータのjobラベルに設定されます。
ジョブ名は255バイト以内で指定します。
-
ユーザー独自のExporterの場合
「jpc」で始まらないジョブ名を指定します。ただし,JP1/IM - Agentが提供するExporterと同じExporterの場合は,下記の<job_name>を参照して指定します。
-
コンテナ監視の場合
マニュアル「JP1/Integrated Management 3 - Manager 構築ガイド」の「1.21.2(11)コンテナ監視の設定」を参照して指定します。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
○
-
ユーザー独自のExporterを使用する場合に新しいスクレイプのジョブ名を定義します。
-
jpc_vwmareで新しいセクションを追加する場合に新しいスクレイプのジョブ名を定義します。
次に示すジョブが設定されています。
-
jpc_node
-
jpc_windows
-
jpc_blackbox_http
-
jpc_blackbox_icmp
-
jpc_cloudwatch
-
jpc_process
-
jpc_promitor
-
jpc_script
-
jpc_oracledb
-
jpc_node_aix
-
jpc_web_probe
-
jpc_vmware
[ scrape_interval: <duration> | default = <global_config.scrape_interval> ]
ターゲットへのスクレイプ間隔を15秒から24時間の範囲で指定します。
global.scrape_intervalに指定したスクレイプ間隔と異なる間隔にしたい場合に指定します。
値は数字と単位で指定します。指定できる単位はs(秒)とm(分)とh(時間)です。
<設定例>
# web_exporter以外
scrape_configs:
- job_name: 'my_exporter'
scrape_interval: 10m
# web_exporter
scrape_configs:
- job_name: 'my_exporter'
scrape_interval: 10m
scrape_timeout: 9m
○
globalとスクレイプ間隔を変更したい場合に指定します。
job_nameの値が「jpc_cloudwatch」の場合は,10m以上の値を指定しないでください。指定した場合,jddcreatetreeコマンドを実行したときに構成を取得できないことがあります。
-
jpc_oracledbの場合
scrape_interval: 60s
-
jpc_web_probeの場合
scrape_interval: 6m
[ scrape_timeout: <duration> | default = <global_config.scrape_timeout> ]
スクレイプ要求のタイムアウト時間を10秒から60分の範囲で指定します。
値は数字と単位で指定します。指定できる単位はs(秒)とm(分)です。
省略時は,scrape_config.scrape_intervalとglobal.scrape_timeoutのうちの小さい値と同じ値になります。
<設定例>
# web_exporter以外
scrape_configs:
- job_name: 'my_exporter'
scrape_timeout: 30s
# web_exporter
scrape_configs:
- job_name: 'my_exporter'
scrape_interval: 10m
scrape_timeout: 9m
○
globalとスクレイプのタイムアウト時間を変更したい場合に指定します。
-
jpc_oracledbの場合
scrape_timeout: 30s
-
jpc_web_probeの場合
scrape_timeout: 5m
[ metrics_path: <path> | default = /metrics ]
スクレイプするときのHTTPリソースパスを255バイト以内で指定します。
指定しない場合は,スクレイプ時のURLに「/metrics」が付与されます。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
metrics_path: /sample-metrics
○
ユーザー独自のExporterを使用する場合に指定します。
-
jpc_web_probe,jpc_blackbox_http,jpc_blackbox_icmpの場合
/probe
-
jpc_oracledbの場合
/metrics
-
上記以外の場合
-
[ scheme: <scheme> | default = http ]
リクエストに使用するプロトコルを指定します。
「http」または「https」を指定できます。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
scheme: https
○
Exporterに合わせて,「http」または「https」を指定します。
−
params:
スクレイプ時のHTTP URLパラメーターを指定します。30個まで指定できます。
○
−
−
[ <string>: [<string>, ...] ]
キーと値を指定します。
キーと値はそれぞれ255バイトまで指定できます。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
params:
aaa: [bbb, ccc]
xxx: [yyy]
○
Exporterに合わせて,スクレイプ時にExporterに渡すURLパラメーターを指定します。
-
jpc_blackbox_httpの場合
module: [http]
-
jpc_blackbox_icmpの場合
module: [icmp]
-
上記以外の場合
-
file_sd_configs:
スクレイプ対象を設定するファイルを定義します。
△
−
−
-files:
スクレイプ対象を設定するファイルを指定します。
△
−
−
[ - <filename_pattern> ... ]
ファイル名を255バイト以内で指定します。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
file_sd_configs:
- files:
- 'file_sd_config_my_exporter.yml'
○
ユーザー独自のExporterを使用する場合に指定します。
13-00からバージョンアップインストールした環境で,次の機能を使用する場合,ユーザーが手動で設定を変更する必要があります。
-
OracleDB exporter
-
Node exporter for AIX
設定変更の詳細については,マニュアル「JP1/Integrated Management 3 - Manager構築ガイド」で,次の個所を参照してください。
-
「1.23.1(1)(c)JP1/IM - Agentのセットアップ」の「OracleDB exporterのスクレイプジョブの設定」
-
「1.23.2(1)(c)JP1/IM - Agentのセットアップ」の「Node exporter for AIXのスクレイプジョブの設定」
それぞれのジョブに合わせて,次に示す定義をしておきます。
- 'jpc_file_sd_config_node.yml'
- 'jpc_file_sd_config_windows.yml'
- 'jpc_file_sd_config_blackbox_http.yml'
- 'jpc_file_sd_config_blackbox_icmp.yml'
- 'jpc_file_sd_config_cloudwatch.yml'
- 'jpc_file_sd_config_process.yml'
- 'jpc_file_sd_config_promitor.yml'
- 'jpc_file_sd_config_oracledb.yml'
- 'jpc_file_sd_config_node_aix.yml'
- 'jpc_file_sd_config_web.yml'
- 'jpc_file_sd_config_vmware.yml'
[ refresh_interval: <duration> | default = 5m ]
スクレイプ対象を記載したファイルを再読み込みする間隔を5分から24時間の範囲で指定します。
値は数字と単位で指定します。指定できる単位はm(分)とh(時間)です。
<設定例>
scrape_configs:
- job_name: 'my_exporter'
file_sd_configs:
- files:
- 'file_sd_config_my_exporter.yml'
refresh_interval: 10m
○
ユーザー独自のExporterを使用する場合にファイルの再読み込みの間隔を変更したい場合に指定します。
通常は変更不要です。
−
relabel_configs:
スクレイプ前のターゲットに対するリラベリングを設定します。
△
−
−
[ - <relabel_config> ... ]
下記の<relabel_config>の説明を参照してください。
○
ユーザー独自のExporterを使用する場合に指定します。
13-00からバージョンアップインストールした環境で,次の機能を使用する場合,ユーザーが手動で設定を変更する必要があります。
-
OracleDB exporter
-
Node exporter for AIX
設定変更の詳細については,マニュアル「JP1/Integrated Management 3 - Manager構築ガイド」で,次の個所を参照してください。
-
「1.23.1(1)(c)JP1/IM - Agentのセットアップ」の「OracleDB exporterのスクレイプジョブの設定」
-
「1.23.2(1)(c)JP1/IM - Agentのセットアップ」の「Node exporter for AIXのスクレイプジョブの設定」
それぞれのジョブに合わせて,次に示す定義をしておきます。
-
jpc_nodeの場合
- target_label: jp1_pc_nodelabel
replacement: Linux metric collector(Node exporter)
-
jpc_windowsの場合
- target_label: jp1_pc_nodelabel
replacement: Windows metric collector(Windows exporter)
-
jpc_blackbox_httpの場合
- source_labels: [__address__]
target_label: __param_target
regex: ([^:]+):([^:]+):(.*)
replacement: ${3}
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: jp1_pc_nodelabel
regex: ([^:]+):([^:]+):(.*)
replacement: ${2}
- target_label: __address__
replacement: 統合エージェントホスト名:20715
- source_labels: [__param_module]
target_label: jp1_pc_module
-
jpc_blackbox_icmpの場合
- source_labels: [__address__]
target_label: __param_target
- target_label: jp1_pc_nodelabel
replacement: Synthetic metric collector(Blackbox exporter(ICMP))
- source_labels: [__address__]
target_label: instance
- target_label: __address__
replacement: 統合エージェントホスト名:20715
- source_labels: [__param_module]
target_label: jp1_pc_module
-
jpc_cloudwatchの場合
記載は不要です。
-
jpc_oracledbの場合
- source_labels: [__address__]
target_label: instance
regex: ([^:]+):([^:]+):(.*)
replacement: ${1}:${2}
- source_labels: [__address__]
target_label: jp1_pc_nodelabel
regex: ([^:]+):([^:]+):(.*)
replacement: ${2}
- source_labels: [__address__]
target_label: __address__
regex: ([^:]+):([^:]+):(.*)
replacement: @@hostname@@:${3}
-
jpc_node_aixの場合
- target_label: jp1_pc_nodelabel
replacement: AIX metric collector(Node exporter for AIX)
-
jpc_web_probeの場合
- source_labels: [__address__]
target_label: __param_target
regex: ([^:]+):([^:]+):(.*)
replacement: ${3}
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: jp1_pc_nodelabel
regex: ([^:]+):([^:]+):(.*)
replacement: ${2}
- target_label: __address__
replacement: @@hostname@@:20731
-
jpc_vmwareの場合
- target_label: jp1_pc_nodelabel
replacement: IM管理ノードのラベルに表示する文字列
metric_relabel_configs:
スクレイプ後のメトリックに対するリラベリングを設定します。
設定例については,項目「remote_write:」の「write_relabel_configs:」の説明を参照してください。
△
−
−
[ - <relabel_config> ... ]
下記の<relabel_config>の説明を参照してください。
○
次の場合に指定します。
-
ユーザー独自のExporterを使用する場合
-
特定のメトリックを除去したい場合
-
プロセスの稼動率監視などでメトリックのラベルを設定する場合
JP1/IM - Agent 13-00から13-01以降にバージョンアップインストールした環境で,次の機能を使用する場合,ユーザーが手動で設定を変更する必要があります。
-
サービス監視機能
-
OracleDB exporter
-
Node exporter for AIX
設定変更の詳細については,マニュアル「JP1/Integrated Management 3 - Manager 構築ガイド」で,次の個所を参照してください。
-
「1.21.2(3)(f)サービス監視の設定をする(Windowsの場合)(オプション)」および「2.19.2(3)(f)サービス監視の設定をする(Linuxの場合)(オプション)」
-
「1.23.1(1)(c)JP1/IM - Agentのセットアップ」の「OracleDB exporterのスクレイプジョブの設定」
-
「1.23.2(1)(c)JP1/IM - Agentのセットアップ」の「Node exporter for AIXのスクレイプジョブの設定」
それぞれのジョブに合わせたExporterのリラベルを指定します。※
-
- (凡例)
-
〇:変更可 △:変更不可 −:該当なし
- 注※
-
-
jpc_nodeの場合
- source_labels: ['__name__']
regex: 'node_network_receive_bytes_total|node_network_transmit_bytes_total|node_disk_read_time_seconds_total|node_disk_write_time_seconds_total|node_boot_time_seconds|node_context_switches_total|node_cpu_seconds_total|node_disk_io_now|node_disk_io_time_seconds_total|node_disk_read_bytes_total|node_disk_reads_completed_total|node_disk_writes_completed_total|node_disk_written_bytes_total|node_filesystem_avail_bytes|node_filesystem_files|node_filesystem_files_free|node_filesystem_free_bytes|node_filesystem_size_bytes|node_intr_total|node_load1|node_load15|node_load5|node_memory_Active_file_bytes|node_memory_Buffers_bytes|node_memory_Cached_bytes|node_memory_Inactive_file_bytes|node_memory_MemAvailable_bytes|node_memory_MemFree_bytes|node_memory_MemTotal_bytes|node_memory_SReclaimable_bytes|node_memory_SwapFree_bytes|node_memory_SwapTotal_bytes|node_netstat_Icmp6_InMsgs|node_netstat_Icmp_InMsgs|node_netstat_Icmp6_OutMsgs|node_netstat_Icmp_OutMsgs|node_netstat_Tcp_InSegs|node_netstat_Tcp_OutSegs|node_netstat_Udp_InDatagrams|node_netstat_Udp_OutDatagrams|node_network_flags|node_network_iface_link|node_network_mtu_bytes|node_network_receive_errs_total|node_network_receive_packets_total|node_network_transmit_colls_total|node_network_transmit_errs_total|node_network_transmit_packets_total|node_time_seconds|node_uname_info|node_vmstat_pswpin|node_vmstat_pswpout|node_systemd_unit_state'
action: 'keep'
- source_labels: ['__name__']
regex: 'node_systemd_unit_.*'
target_label: 'jp1_pc_trendname'
replacement: 'node_exporter_service'
- source_labels: ['__name__']
regex: 'node_systemd_unit_.*'
target_label: 'jp1_pc_category'
replacement: 'service'
- source_labels: ['__name__','name']
regex: 'node_systemd_unit_.*;(.*)'
target_label: 'jp1_pc_nodelabel'
replacement: ${1}
- regex: jp1_pc_multiple_node
action: labeldrop
-
jpc_windowsの場合
- source_labels: ['__name__']
regex: 'windows_cs_physical_memory_bytes|windows_cache_copy_read_hits_total|windows_cache_copy_reads_total|windows_cpu_time_total|windows_logical_disk_free_bytes|windows_logical_disk_idle_seconds_total|windows_logical_disk_read_bytes_total|windows_logical_disk_read_latency_seconds_total|windows_logical_disk_read_seconds_total|windows_logical_disk_reads_total|windows_logical_disk_requests_queued|windows_logical_disk_size_bytes|windows_logical_disk_write_bytes_total|windows_logical_disk_write_latency_seconds_total|windows_logical_disk_write_seconds_total|windows_logical_disk_writes_total|windows_memory_available_bytes|windows_memory_cache_bytes|windows_memory_cache_faults_total|windows_memory_page_faults_total|windows_memory_pool_nonpaged_allocs_total|windows_memory_pool_paged_allocs_total|windows_memory_swap_page_operations_total|windows_memory_swap_pages_read_total|windows_memory_swap_pages_written_total|windows_memory_system_cache_resident_bytes|windows_memory_transition_faults_total|windows_net_bytes_received_total|windows_net_bytes_sent_total|windows_net_bytes_total|windows_net_packets_sent_total|windows_net_packets_received_total|windows_system_context_switches_total|windows_system_processor_queue_length|windows_system_system_calls_total|windows_process_start_time|windows_process_cpu_time_total|windows_process_handles|windows_process_io_bytes_total|windows_process_io_operations_total|windows_process_page_faults_total|windows_process_page_file_bytes|windows_process_pool_bytes|windows_process_priority_base|windows_process_private_bytes|windows_process_threads|windows_process_virtual_bytes|windows_process_working_set_private_bytes|windows_process_working_set_peak_bytes|windows_process_working_set_bytes|windows_service_state'
action: 'keep'
- source_labels: ['__name__']
regex: 'windows_process_.*'
target_label: 'jp1_pc_trendname'
replacement: 'windows_exporter_process'
- source_labels: ['__name__','process']
regex: 'windows_process_.*;(.*)'
target_label: 'jp1_pc_nodelabel'
replacement: ${1}
- source_labels: ['__name__']
regex: 'windows_service_.*'
target_label: 'jp1_pc_trendname'
replacement: 'windows_exporter_service'
- source_labels: ['__name__']
regex: 'windows_service_.*'
target_label: 'jp1_pc_category'
replacement: 'service'
- source_labels: ['__name__','name']
regex: 'windows_service_.*;(.*)'
target_label: 'jp1_pc_nodelabel'
replacement: ${1}
- regex: jp1_pc_multiple_node
action: labeldrop
-
jpc_blackbox_httpの場合
- source_labels: ['__name__']
regex: 'probe_http_duration_seconds|probe_http_content_length|probe_http_uncompressed_body_length|probe_http_redirects|probe_http_ssl|probe_http_status_code|probe_ssl_earliest_cert_expiry|probe_ssl_last_chain_expiry_timestamp_seconds|probe_ssl_last_chain_info|probe_tls_version_info|probe_http_version|probe_failed_due_to_regex|probe_http_last_modified_timestamp_seconds|probe_success|probe_duration_seconds'
action: 'keep'
-
jpc_blackbox_icmpの場合
- source_labels: ['__name__']
regex: 'probe_icmp_duration_seconds|probe_icmp_reply_hop_limit|probe_success|probe_duration_seconds'
action: 'keep'
-
jpc_cloudwatchの場合
- regex: 'tag_(jp1_pc_.*)'
replacement: ${1}
action: labelmap
- regex: 'tag_(jp1_pc_.*)'
action: 'labeldrop'
- source_labels: ['__name__','jp1_pc_nodelabel']
regex: '(aws_ec2_cpuutilization_average|aws_ec2_disk_read_bytes_sum|aws_ec2_disk_write_bytes_sum|aws_lambda_errors_sum|aws_lambda_duration_average|aws_s3_bucket_size_bytes_sum|aws_s3_5xx_errors_sum|aws_dynamodb_consumed_read_capacity_units_sum|aws_dynamodb_consumed_write_capacity_units_sum|aws_states_execution_time_average|aws_states_executions_failed_sum|aws_sqs_approximate_number_of_messages_delayed_sum|aws_sqs_number_of_messages_deleted_sum|aws_ebs_volume_read_bytes_sum|aws_ebs_volume_write_bytes_sum|aws_ecs_cpuutilization_average|aws_ecs_memory_utilization_average|aws_efs_total_iobytes_average|aws_efs_storage_bytes_average|aws_fsx_data_read_bytes_sum|aws_fsx_data_write_bytes_sum|aws_fsx_free_storage_capacity_average|aws_rds_cpuutilization_average|aws_rds_read_iops_average|aws_rds_write_iops_average|aws_sns_number_of_notifications_failed_sum|aws_sns_number_of_notifications_filtered_out_sum);.+$'
action: 'keep'
- source_labels: ['__name__','dimension_ClusterName']
target_label: jp1_pc_nodelabel
regex: 'aws_ecs_.+;(.+)'
replacement: ${1}
- source_labels: ['__name__','dimension_ServiceName']
target_label: jp1_pc_nodelabel
regex: 'aws_ecs_.+;(.+)'
replacement: ${1}
-
jpc_processの場合
- source_labels: [groupname]
regex: ([^;]*?);([^;]*?);(.*)
target_label: program
replacement: ${1}
- source_labels: [groupname]
regex: ([^;]*?);([^;]*?);(.*)
target_label: user
replacement: ${2}
- source_labels: [groupname]
regex: ([^;]*?);([^;]*?);(.*)
target_label: command_line
replacement: ${3}
- source_labels: [program]
target_label: jp1_pc_nodelabel
- source_labels: ['__name__']
regex: 'namedprocess_namegroup_num_procs|namedprocess_namegroup_cpu_seconds_total|namedprocess_namegroup_read_bytes_total|namedprocess_namegroup_write_bytes_total|namedprocess_namegroup_major_page_faults_total|namedprocess_namegroup_minor_page_faults_total|namedprocess_namegroup_context_switches_total|namedprocess_namegroup_memory_bytes|namedprocess_namegroup_open_filedesc|namedprocess_namegroup_worst_fd_ratio|namedprocess_namegroup_oldest_start_time_seconds|namedprocess_namegroup_num_threads|namedprocess_namegroup_states|namedprocess_namegroup_thread_count|namedprocess_namegroup_thread_cpu_seconds_total|namedprocess_namegroup_thread_io_bytes_total|namedprocess_namegroup_thread_major_page_faults_total|namedprocess_namegroup_thread_minor_page_faults_total|namedprocess_namegroup_thread_context_switches_total'
action: 'keep'
- regex: (jp1_pc_multiple_node|jp1_pc_agent_create_flag)
action: labeldrop
-
jpc_promitorの場合
- source_labels: [resource_uri]
regex: ([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/(.*)
target_label: jp1_pc_nodelabel
replacement: ${8}
- source_labels: ['__name__']
regex: 'azure_virtual_machine_disk_read_bytes_total|azure_virtual_machine_disk_write_bytes_total|azure_virtual_machine_percentage_cpu_average|azure_blob_storage_availability_average|azure_blob_storage_blob_capacity_average|azure_function_app_http5xx_total|azure_function_app_http_response_time_average|azure_cosmos_db_total_request_units_total|azure_logic_app_runs_failed_total|azure_container_instance_cpu_usage_average|azure_container_instance_memory_usage_average|azure_kubernetes_service_kube_pod_status_phase_average|azure_file_storage_availability_average|azure_file_storage_file_capacity_average|azure_service_bus_namespace_deadlettered_messages_average|azure_sql_database_cpu_percent_average|azure_sql_database_dtu_used_average|azure_sql_database_storage_maximum|azure_sql_elastic_pool_cpu_percent_average|azure_sql_elastic_pool_e_dtu_used_average|azure_sql_elastic_pool_storage_used_average|azure_sql_managed_instance_avg_cpu_percent_average|azure_sql_managed_instance_io_bytes_read_average|azure_sql_managed_instance_io_bytes_written_average|azure_sql_managed_instance_storage_space_used_mb_average'
action: 'keep'
- regex: jp1_pc_rm_agent_create_flag
action: labeldrop
- source_labels: ['__name__','phase']
regex: (azure_kubernetes_service_kube_pod_status_phase_average);Failed
target_label: __name__
replacement: ${1}_failed
- source_labels: ['__name__','phase']
regex: (azure_kubernetes_service_kube_pod_status_phase_average);Pending
target_label: __name__
replacement: ${1}_pending
- source_labels: ['__name__','phase']
regex: (azure_kubernetes_service_kube_pod_status_phase_average);Unknown
target_label: __name__
replacement: ${1}_unknown
-
jpc_scriptの場合
- source_labels: ['__name__']
regex: 'script_success|script_duration_seconds|script_exit_code'
action: 'keep'
- source_labels: [jp1_pc_script]
target_label: jp1_pc_nodelabel
- regex: (jp1_pc_script|jp1_pc_multiple_node|jp1_pc_agent_create_flag)
action: labeldrop
-
jpc_oracledbの場合
- source_labels: ['__name__']
regex: 'oracledb_sessions_value|oracledb_resource_current_utilization|oracledb_resource_limit_value|oracledb_asm_diskgroup_total|oracledb_asm_diskgroup_free|oracledb_activity_execute_count|oracledb_activity_parse_count_total|oracledb_activity_user_commits|oracledb_activity_user_rollbacks|oracledb_activity_physical_reads_cache|oracledb_activity_consistent_gets_from_cache|oracledb_activity_db_block_gets_from_cache|oracledb_process_count|oracledb_wait_time_administrative|oracledb_wait_time_application|oracledb_wait_time_commit|oracledb_wait_time_concurrency|oracledb_wait_time_configuration|oracledb_wait_time_network|oracledb_wait_time_other|oracledb_wait_time_scheduler|oracledb_wait_time_system_io|oracledb_wait_time_user_io|oracledb_tablespace_bytes|oracledb_tablespace_max_bytes|oracledb_tablespace_free|oracledb_tablespace_used_percent|oracledb_exporter_last_scrape_duration_seconds|oracledb_exporter_last_scrape_error|oracledb_exporter_scrapes_total|oracledb_up'
action: 'keep'
-
jpc_node_aixの場合
- source_labels: ['__name__']
regex:
'node_context_switches|node_cpu|aix_diskpath_wblks|aix_diskpath_rblks|aix_disk_rserv|aix_disk_rblks|aix_disk_wserv|aix_disk_wblks|aix_disk_time|aix_disk_xrate|aix_disk_xfers|node_filesystem_avail_bytes|node_filesystem_files|node_filesystem_files_free|node_filesystem_free_bytes|node_filesystem_size_bytes|node_intr|node_load1|node_load5|node_load15|aix_memory_real_avail|aix_memory_real_free|aix_memory_real_inuse|aix_memory_real_total|aix_netinterface_mtu|aix_netinterface_ibytes|aix_netinterface_ierrors|aix_netinterface_ipackets|aix_netinterface_obytes|aix_netinterface_collisions|aix_netinterface_oerrors|aix_netinterface_opackets|aix_memory_pgspins|aix_memory_pgspouts'
action: 'keep'
-
jpc_web_probeの場合
- source_labels: ['__name__']
regex: 'probe_webscena_success|probe_webscena_duration_seconds'
action: 'keep'
-
jpc_vmwareの場合
- source_labels: ['__name__']
regex: 'vmware_datastore_capacity_size|vmware_datastore_freespace_size|vmware_host_num_cpu|vmware_host_memory_usage|vmware_host_memory_max|vmware_host_mem_vmmemctl_average|vmware_vm_mem_swapped_average|vmware_host_net_bytesRx_average|vmware_host_net_bytesTx_average|vmware_vm_mem_consumed_average|vmware_vm_guest_disk_capacity|vmware_vm_guest_disk_free|vmware_vm_mem_vmmemctl_average|vmware_vm_mem_consumed_average|vmware_vm_mem_active_average|vmware_vm_net_transmitted_average|vmware_vm_net_received_average|vmware_vm_power_state|vmware_host_cpu_used_summation|vmware_vm_cpu_ready_summation|vmware_vm_num_cpu|vmware_vm_memory_max|vmware_vm_max_cpu_usage|vmware_vm_template|vmware_host_cpu_usage_average|vmware_host_disk_write_average|vmware_host_disk_read_average|vmware_vm_cpu_usage_average|vmware_vm_disk_write_average|vmware_vm_disk_read_average|vmware_vm_guest_disk_capacity|vmware_vm_guest_disk_free|vmware_vm_guest_disk_capacity'
action: 'keep'
- source_labels: ['ds_name']
regex: '(.*)'
target_label: instance
replacement: ${1}
- source_labels: ['ds_name']
regex: '(.*)_(.*)'
target_label: instance
replacement: ${1}
- source_labels: ['vm_name','__name__']
regex: '(.*);vmware_vm_.*'
target_label: instance
replacement: ${1}
action: replace
- source_labels: ['host_name','__name__']
regex: '(.*);vmware_host_.*'
target_label: instance
replacement: ${1}
action: replace
- source_labels: ['__name__']
regex: 'vmware_host_.*|vmware_datastore_.*'
target_label: jp1_pc_trendname
replacement: vmware_exporter_host
- source_labels: ['__name__']
regex: 'vmware_vm_.*'
target_label: jp1_pc_trendname
replacement: vmware_exporter_vm
-
-
<job_name>
JP1/IM - Agentが提供するExporterと同じユーザー独自のExporterの場合は,次の表に示すジョブ名(JP1/IM - Agentが提供するPrometheus設定ファイルで指定するスクレイプジョブ名と同じ)を指定します。
Exporter名
指定するジョブ名
Node exporter
jpc_node
Windows exporter
jpc_windows
OracleDB exporter
jpc_oracledb
Node exporter for AIX
jpc_node_aix
Blackbox exporter
jpc_blackbox_httpまたはjpc_blackbox_icmp
Yet another cloudwatch exporter
jpc_cloudwatch
Process exporter
jpc_process
Promitor
jpc_promitor
Script exporter
「jpc_script」で始まるジョブ名
VMware exporter
jpc_vmware
-
<static_config>
static_configでは,ターゲットのリストとそれらに共通するラベルセットを設定できます。これは,スクレイプ設定で静的ターゲットを指定するための典型的な方法です。
注:JP1/IM - Agentでは,file_sd_configに指定されたファイルに記載します。
項目名
説明
変更可否
JP1/IM - Agentでユーザーが設定する内容
JP1/IM - Agentのデフォルト値
targets:
スクレイプ対象を指定します。100個まで指定できます。
△
−
−
[ - '<host>' ]
スクレイプ対象のホスト名を255バイト以内で指定します。
<設定例>
- targets:
- HOST1:1000
- HOST2:2000
○
スクレイプ対象を指定します。
−
labels:
スクレイプ対象から取得したすべてのメトリクスに設定したいラベルを指定します。30個まで指定できます。
△
−
−
[ <labelname>: <labelvalue> ... ]
ラベル名とラベルの値を指定します。ラベル名とラベルの値はそれぞれ255バイトまで指定できます。
○
メトリックにラベルを追加したい場合に指定します。
−
- (凡例)
-
〇:変更可 △:変更不可 −:該当なし
-
<relabel_config>
relabel_configを設定することで,スクレイプ,リモートライト,アラート通知などの処理を行う前にターゲットのラベルを編集したり,指定したターゲットを除外したりすることができます。
relabel_configの設定は,設定ファイルに記載されている順に,各ターゲットに適用されます。
初期状態では,ターゲットに対して次に示すラベルが設定されます。
-
ターゲットのjobラベルに対して,それぞれのスクレイプ定義のjob_nameの値が設定されます。
-
instanceラベルと__address__ラベルには,ディスカバリ設定ファイルのtargetsに指定した文字列が設定されます。
-
ターゲットに__param_<name>ラベルが存在する場合,スクレイプ時に「<name>=値」形式のURLパラメーターが設定されます。
-
ターゲットには,ディスカバリ設定ファイルのlabelsに指定したラベルが設定されます。
Prometheus serverは,__address__ラベルに設定された「ホスト名:ポート番号」に対してスクレイプを行うため,targetsに指定した値が,スクレイプ先の「ホスト名:ポート番号」でない場合,スクレイプ定義のrelabel_configによる編集が必要です。
__で始まるラベルは,スクレイプ,リモートライト,アラート通知などの処理を行ったあとのデータからは削除されます。
リラベルステップがラベルの値を一時的に(後続のリラベルステップへの入力として)保存する必要がある場合は,__tmpラベル名プレフィックスを使用してください。このプレフィックスは,Prometheus自身が使用しないことが保証されています。
項目名
説明
変更可否
JP1/IM - Agentでユーザーが設定する内容
JP1/IM - Agentのデフォルト値
[ source_labels: '[' <labelname> [, ...] ']' ]
ソースラベルを,既存のラベルから値を選択します。
その内容は,設定されたセパレータを使って連結され,replace,keep,dropアクションのために設定された正規表現と照合されます。
〇
「説明」欄と同じです。
−
[ separator: <string> | default = ; ]
連結されたソースラベルの値の間に置かれるセパレータを設定します。
〇
「説明」欄と同じです。
−
[ target_label: <labelname> ]
置換アクションで結果の値が書き込まれるラベルを設定します。
置換アクションでは必須です。Regexのキャプチャグループが利用できます。
〇
「説明」欄と同じです。
−
[ regex: <regex> | default = (.*) ]
抽出された値が照合される正規表現を設定します。
詳細については,下記の<regex>の説明を参照してください。
〇
「説明」欄と同じです。
-
[ replacement: <string> | default = $1 ]
正規表現がマッチした場合に,正規表現による置換が実行される置換値を設定します。Regexキャプチャグループが利用できます。
〇
「説明」欄と同じです。
−
[ action: <relabel_action> | default = replace ]
正規表現のマッチングに基づいて実行するアクションを設定します。
詳細については,下記の<relabel_action>の説明を参照してください。
〇
「説明」欄と同じです。
−
-
- (凡例)
-
〇:変更可 −:該当なし
-
<regex>
任意の有効なRE2正規表現を設定します。
replace,keep,drop,labeldropの各アクションに必要です。regexは両端がアンカーされています。正規表現のアンカーを解除するには,.*<regex>.*を使用します。
-
<relabel_action>
再ラベル化のアクションを設定します。
- replace:
-
連結されたsource_labelsに対してregexをマッチさせます。そして,replacementの中のマッチグループ参照(${1}, ${2}, ...)をその値で置き換えて,target_labelをreplacementに設定します。regexがマッチしない場合,replacementは行われません。
- keep:
-
regexが連結されたsource_labelsにマッチしないターゲットを削除します。
- drop:
-
regexが連結されたsource_labelsにマッチするターゲットを削除します。
- labeldrop:
-
regexをすべてのラベル名にマッチさせます。一致したラベルは,ラベルのセットから削除されます。
(設定例)ユーザー独自のスクレイプ定義
ユーザー独自のExporterを使用し,ディスカバリ設定ファイルに複数の監視対象を定義する場合,relabel_configのregexを指定し,jp1_pc_nodelabelに値を設定する必要があります。
スクレイプ定義の設定およびjp1_pc_nodelabelについては,マニュアル「JP1/Integrated Management 3 - Manager 構築ガイド」の「1.21.2(3)(d) ユーザー独自のExporterのスクレイプジョブを追加する(Windowsの場合)(オプション)」を参照してください。
ディスカバリ設定ファイルのtargetsに,次に示す3つの監視対象を設定している例を示します。それぞれのIM管理ノードのラベル名として,jp1_pc_nodelabelに「target1 label」,「target2 label」,「target3 label」を設定します。
- targets: - hostA:target1 label:Exporterに渡すクエリパラメーター1 - hostA:target2 label:Exporterに渡すクエリパラメーター2 - hostB:target3 label:Exporterに渡すクエリパラメーター3
relabel_configの指定
relabel_configs: - source_labels:[__address__] ┐ target_label:__param_target │① regex:([^:]+):([^:]+):(.*) │ replacement:${3} ┘ - source_labels:[__address__] ┐② target_label:instance ┘ - source_labels:[__address__] ┐③ target_label:jp1_pc_nodelabel │ regex:([^:]+):([^:]+):(.*) │ replacement:${2} ┘ - target_label:__address__ ┐④ replacement:localhost:20799 ┘
①:__address__に設定された値(hostA:target1 label:Exporterに渡すクエリパラメーター1)を分割し,Exporterに渡すクエリパラメーター1の文字列を__param_targetラベルに設定しています。targetはスクレイプ時のURLパラメーターとなります。
②:__address__に設定された値をinstanceラベルに設定しています。
③:__address__に設定された値を分割し,IM管理ノードのラベル名(targetX label)をjp1_pc_nodelabelラベルに設定しています。
④:__address__にユーザー独自のExporterのスクレイプ先の情報(ホスト名:ポート番号)を設定しています。
-
<metric_relabel_configs>
Metric relabelingは,インジェストの前の最後のステップとしてサンプルに適用されます。Target relabelingと同じ設定フォーマットとアクションを持ちます。Metric relabelingは,upなどの自動生成された時系列には適用されません。
これは,インジェストするにはコストがかかりすぎる時系列を除外するために使用されます。
-
<alert_relabel_configs>
Alert relabelingは,Alertmanagerに送信される前のアラートに適用されます。
これはtarget relabelingと同じ設定フォーマットとアクションを持ちます。Alert relabelingは,外部ラベルのあとに適用されます。
この用途としては,異なる外部ラベルを持つPrometheusサーバのHAペアが同一のアラートを送信することを保証することが挙げられます。
-
<alertmanager_config>
alertmanager_configセクションは,Prometheusサーバがアラートを送信するAlertmanagerインスタンスを指定します。また,これらのAlertmanagerとの通信方法を設定するためのパラメーターも提供しています。
Alertmanagerは,static_configsパラメーターで静的に設定したり,サポートされているサービス発見メカニズムの1つを使って動的に発見したりすることもできます。
項目名
説明
変更可否
JP1/IM - Agentでユーザーが設定する内容
JP1/IM - Agentのデフォルト値
static_configs:
直接指定での設定を行います。
△
−
−
- targets:
アラートの送信先とするAlertmanagerを指定します。
△
−
−
[ - '<host>' ]
ホスト名を255バイト以内で指定します。
<設定例>
alerting:
alertmanagers:
- static_configs:
- targets: [統合エージェントホスト名:20714]
◎
ポート番号にはAlertmanagerのポートを指定します。
Alertmanagerのコマンドラインオプションの--web.listen-addressに,ホスト名またはIPアドレスを指定した場合は,localhostを--web.listen-addressに指定したホスト名またはIPアドレスに修正します。
localhost:20714
- (凡例)
-
◎:設定必須 △:変更不可 −:該当なし