vFunction Logo

Exchanging measurements to/from a C4 Container Diagrams

Container Diagrams are standard C4 model diagrams that can be used to visualize the architecture of a distributed system. In this section we will show how to export a measurement to a C4 diagram, modify the architecture by modifying the diagram and importing it back to vFunction as a “reference architecture” allowing the platform to create TODO items automatically showing the gaps between the current baseline and the new reference architecture.

Exporting a measurement to a C4 diagram

  1. Open the MEASUREMENTS & REFERENCES menu at the top of the left pane and click EXPORT C4 DIAGRAM

  2. A “toaster” at the bottom right will popup saying it is preparing the diagram for export after words a file with suffix .puml will be downloaded (you may need to click Keep to save it in the download menu of the browser)

  3. Open a new tab in your web browser and go to Plant UML Home - this website is one option to view .puml files (there is also a plugin in VSCode and other environment). Click on Online Server in the left pane to open the pUML editor.

  4. Open the .puml file downloaded from vFunction in a text editor (e.g., VSCode or Notepad), copy its entire content (Ctrl+A. Ctrl+C) and replace the content in the online pUML with it. Then click Submit. The diagram should look similar to:

    c4 oms 1

    The diagrams displays the services, resources (as containers), groupings as well as the Consumer role representing external entities triggering the flows and the communication lines between them annotated with the communications protocol (here it is HTTP and Kafka)

Modifying the C4 Diagram and importing it back as reference measurement

  1. In the plant uml online server, scroll up, delete the lines Rel_U(oms_inventory, oms, "", "", $descr="http") and Rel_D(oms, oms_shipping, "", "", $descr="http") click Submit.

  2. The resulting diagram should be similar to:

    c4 oms 1

  3. Copy the content of the pUML text specification (the top frame) and save it to a file with .puml suffix

  4. Go back to vFunction (Analysis page), open the MEASUREMENTS & REFERENCES menu and click IMPORT then select the new .puml file. Check Set as Latest (set it to true) and click IMPORT

  5. Enable Service Labels and Tech Stack - you should see in vFunction:

    c4 imported

    The REFERENCE label above the measurement name indicates that this is a reference measurement - meaning it was imported from a diagram

  6. Open the TODOs list - you should see 2 new TODOs with the marking R referencing the flows we removed in the C4 diagram.

    ref todos

vFunction Logo