- The peer and the orderer host an HTTP server that offers a RESTful “operations” API. This API is unrelated to the Fabric network services and is intended to be used by operators, not administrators or “users” of the network, more at Operations Service
-
Modify /fabric-samples/first-network/base/docker-compose-base.yaml file to add operations service per each orderrer, and each peer, and restart your fabric network in order to have operations service brodcasting metrics, and other info. Please visit provided docker-compose-base-sample.yaml sample.
-
Orderer sample configuration
- ORDERER_OPERATIONS_LISTENADDRESS=0.0.0.0:8443 # operation RESTful API - ORDERER_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API
-
Peer sample configuration
- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9443 # operation RESTful API - CORE_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API
**Note that each peer, and orderer need to have a different port, and it available within your environment.
- Follow up instaructions how to setup Prometheus server getting started
- Use sample prometheus.yml to start prometheus. locally,
- To see if configuration is correct, start prometheus, and open http://localhost:9090 in a browser.
- Get start with Grafana
- Login to grafana http://localhost:3000/login , default credentials admin/admin
- Navigate to http://localhost:3000/dashboard/import
- Click "Upload .json File" button, and select sample file.
-
In our sample docker-compose file, we've already done configuration for Prometheus server and Grafana provisioning. If you want to custmise the configuration, please see the following files and the official instructions ( Prometheus / Grafana ).
- app/platform/fabric/artifacts/operations/balance-transfer/prometheus.yml - app/platform/fabric/artifacts/operations/balance-transfer/balance-transfer-grafana-dashboard.json - app/platform/fabric/artifacts/operations/grafana_conf/provisioning/dashboards/dashboard.yaml - app/platform/fabric/artifacts/operations/grafana_conf/provisioning/datasources/datasource.yaml
-
After bring up services with the following command, open http://localhost:3000 in a browser. You'll be able to see the provisioned
Balance Transfer, Quick Summary
dashboard.$ cd blockchain-explorer $ docker-compose down -v # Just for cleaning up the old persist docker volumes $ docker-compose up -d