ピアまたはオーダラのネイティブFabricメトリックの取得
get
/console/admin/api/v1.1/dashboard/statistics/metrics
Hyperledger Fabricメトリックを問い合せて、出力をPrometheusデータベースに公開できます。
リクエスト
サポートされるメディア・タイプ
- application/json
問合せパラメータ
- nodeId: string
ピアまたはオーダラのノードID
レスポンス
サポートされるメディア・タイプ
- application/json
200レスポンス
プロモーション・キューによって消費のためにエクスポートされた操作メトリック。
400レスポンス
指定されたnodeIdが無効です。
ルート・スキーマ : schema
型:
Show Source
object
- respMesg(オプション): string
レスポンス・メッセージ。
例:
{
"respMesg":"invalid nodeId:peer100"
}
デフォルト・レスポンス
予期しないエラー
例
Hyperledger Fabric 1.4以降、RESTful操作サービスではメトリック・エンドポイントが用意されており、オーバーレイを利用してピア・ノードおよびオーダラ・ノードからオペレーション・メトリックをプルできます。 Oracle Blockchain Platformでは、これらのメトリックを問い合せるための新しいエンドポイントが作成されています。
プロモーション・データベースの作成
提供されているターゲットによって公開されたHTTPエンドポイントからリクエストすることで、標準的なプロモーション・デプロイメント・スクラッチ・メトリック。 オーバーレイにはメトリックのリクエストがあるため、プル・システムと見なされます。
次のサンプル構成を使用して、オーバーレイ・データベースを構成します:
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
metrics_path: '/console/admin/api/v1.1/dashboard/statistics/metrics'
params:
nodeId:['peer0']
scheme: 'https'
tls_config:
insecure_skip_verify: true
static_configs:
- targets: ['hostname.com:10001']
REST APIを呼び出してHyperledger Fabricメトリックを問い合せます
Hyperledger Fabricメトリックを問い合せるには、次のREST APIを使用します。
- メソッド: GET
- path:
/console/admin/api/v1.1/dashboard/statistics/metrics
- 問合せパラメータ:
nodeID(required): The node ID of the peer or orderer to be queried.
たとえば、cURLを使用してAPIをコールするには、次のようにします:
curl -X GET "https://<rest_server_url:port>/console/admin/api/v1.1/dashboard/statistics/metrics?nodeId=peer0"
-H "accept:application/json"