fabric-samples/test-network/prometheus-grafana
Dave Kelsey e2d351ed61
Minor improvement to test network docs (#607)
Also fix the version of prometheus and grafana being used
to ensure the queries remain compatible as well as avoid
issues whether they may not work if latest images already
exist on machine but are not at a level that will work

Signed-off-by: D <d_kelsey@uk.ibm.com>

Co-authored-by: D <d_kelsey@uk.ibm.com>
2022-02-01 15:53:30 +00:00
..
grafana Update the grafana dashboard (#610) 2022-02-01 15:51:53 +00:00
grafana_db add prometheus/grafana performances sample into test-network directory (#576) 2022-01-20 09:37:37 +00:00
prometheus add prometheus/grafana performances sample into test-network directory (#576) 2022-01-20 09:37:37 +00:00
docker-compose.yaml Minor improvement to test network docs (#607) 2022-02-01 15:53:30 +00:00
README.md Minor improvement to test network docs (#607) 2022-02-01 15:53:30 +00:00

Description

This sample provides an environment to display and capture metrics from the test-network in real time. It consists of a docker-compose file that starts a Prometheus and Grafana server setup configured to collect and display metrics for the test network.

Requirements

This sample has been tested and is recommended to be used on linux in order to fully benefit from its capabilities, however it can be deployed and works on MacOS-intel machine as well (some modification to the cadvisor docker image and related queries are required to show docker containers metrics). You will need to have installed docker-compose with version 1.29 or above (note that this is higher than the v1.14 requirement requested for the test-network).

How to use

  1. Go to the test-network directory and run bring up the test-network ./network.sh up createChannel
  2. Bring up the Prometheus/Grafana network in the test-network/prometheus-grafana directory and run docker-compose up -d
  3. Log in: type “localhost:3000” on your web browser -> username=“admin”, password=“admin” -> set a new password
  4. Browse dashboard and analyse results
    • The default dashboard "HLF Performances Review" can be found and displayed by hovering over the dashboard menu and clicking on the browse button. picture alt Once opened the dashboard, to display the collected metrics and data, adjust the timeframe on the top right to focus on the latest timespan when the network was up.
  5. Deploy a chaincode (i.e. "./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"), start using the test-network and use the Grafana dashboard to analyse and assess your network performances. Extras: add new queries, modify dashboard & add relevant changes to main repo --> extract json and add it to "Grafana/dashboards/hlf-performances.json". Metrics can also be displayed directly from Prometheus by going to "localhost:9090".

Docker Compose

Brings up

  • a Prometheus server (port 9090) -> pulls metrics from peers, orderer, system(node exporter) and containers(cadvisor)
  • Grafana server (port 3000) -> collects and display data from Prometheus
  • node exporter (port 9100) -> exposes systems metrics
  • cadvisor (port 8080) -> exposes docker containers metrics

Prometheus "configuration file"

Prometheus.yml

Fabric metrics targets:

  • peer0.org1.example.com:9444
  • peer0.org2.example.com:9445
  • orderer.example.com:9443

System and docker metrics targets:

  • cadvisor:8080
  • node-exporter:9100

Check the state of the connections with targets on http://localhost:9090/targets.

Sources

Prometheus docs Grafana docs