A command line to generate dependency patterns between microservices using pact-broker data.
Available for linux, alpine and OSX.
-
First, request
$PACT_BROKER_URL/pacts/latest
to get the list of all contracts (e.g.pacts
) ; -
then, for each contract object get the URL to latest version of contract, e.g.
_links._self[0].href
http://$PACT_BROKER_URL/pacts/provider/foo-provide/consumer/bar-consume/latest
-
and use it to fetch contract details, i.e. all interactions ;
This project is created with:
- generate an html report
- generate an edge bundling chart
- generate a force directed layout chart
- exclude sevices with pattern
- filter only services
- add support fort Pact Broker authentification (Basic Auth + Bearer Based)
# Download the binary
VERSION=0.7.2
curl -L -o $HOME/.local/bin/pact-graph-network \
https://github.com/ManoManoTech/pact-graph-network/releases/download/v${VERSION}/pact-graph-network_x86_64-unknown-linux-gnu
# Make it executable
chmod u+x $HOME/.local/bin/pact-graph-network
Generate the graph
pact-graph-network \
--url https://pact-brocker.your.com/ \
--output report
View the output in your browser
open report/edge-bundling.html
pact-graph-network --url https://pact-brocker.your.com/ --output report --username $PACT_BROKER_USERNAME --password $PACT_BROKER_PASSWORD
pact-graph-network --url https://pact-brocker.your.com/ --output report --token $PACT_BROKER_TOKEN
-b, --url <URL> Pact broker URL
-u, --username <USERNAME> Pact broker username
-p, --password <PASSWORD> Pact broker password
-t, --token <TOKEN> Pact broker token
-o, --output <OUTPUT> Path of the output dir [default: report]
-g, --graph <GRAPH> [default: edge] [possible values: edge, directed]
--timeout <TIMEOUT> timeout of http request in milliseconds [default: 2000]
--exclude <EXCLUDE> list of service to exclude
-h, --help Print help information
-V, --version Print version information
Key | Description | Alowed values |
---|---|---|
PACT_NETWORK_LOG |
Adds filters to the logger. | error ,warn ,info ,debug ,trace |
PACT_NETWORK_LOG_STYLE |
Whether or not to print styles to the target. | auto , always , never |
If you have any feedback, please open an issue.