News KrakenD CE v2.6 released with OpenTelemetry

Enterprise Documentation

Recent changes

Generate graphs from your configuration

Document updated on May 7, 2021

The krakend.json file whether it is a single file or the result of using the flexible configuration, it might be a complex file. A generated image of the configuration might help you understand better the running configuration.

The config2dot generator will generate internally an intermediate DOT dile that you can render into a png image with GraphViz or similar software.

The following image illustrates an example of a KrakenD configuration:

Config to dot

Generating the Config2dot

The command needed to generate a DOT file is krakend generate config2dot:

Command to start KrakenD 
$krakend generate config2dot -h

╓▄█                          ▄▄▌                               ╓██████▄µ
▐███  ▄███╨▐███▄██H╗██████▄  ║██▌ ,▄███╨ ▄██████▄  ▓██▌█████▄  ███▀╙╙▀▀███╕
▐███▄███▀  ▐█████▀"╙▀▀"╙▀███ ║███▄███┘  ███▀""▀███ ████▀╙▀███H ███     ╙███
▐██████▌   ▐███⌐  ,▄████████M║██████▄  ║██████████M███▌   ███H ███     ,███
▐███╨▀███µ ▐███   ███▌  ,███M║███╙▀███  ███▄```▄▄` ███▌   ███H ███,,,╓▄███▀
▐███  ╙███▄▐███   ╙█████████M║██▌  ╙███▄`▀███████╨ ███▌   ███H █████████▀
                     ``                     `'`

Version: 2.5.3

Generates a DOT graph from your KrakenD configuration.
Usage:
  krakend generate config2dot [flags]
Examples:
krakend generate config2dot -c config.json -o config.dot
Flags:
  -h, --help   help for config2dot
Global Flags:
  -c, --config string   Path to the configuration filename
  -d, --debug           Enable the debug
  -o, --out string      Path to the generated result.")

Generating the image

Once you have generated the dot file, you get a plain text content that is ready to be rendered by any software library that is capable of processing dot files. A good of example is Graphviz.

You can install Graphviz on Linux (Debian/Ubuntu) with the following command, but other distributions are similar:

Install Graphviz 
$sudo apt-get install graphviz

On Mac:

Install on Mac 
$brew install graphviz

Or you can also add Graphviz to the official Enterprise Docker image (gets heavier):

RUN apk update
RUN apk add graphviz

Then you can generate the image with the following command:

Generate image 
$dot -Tpng graph.dot -o graph.png
Scarf

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.