Files
sysmonstm/docs/architecture/02-data-flow.svg
2026-03-16 13:35:53 -03:00

229 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 14.1.2 (0)
-->
<!-- Title: DataFlow Pages: 1 -->
<svg width="1270pt" height="305pt"
viewBox="0.00 0.00 1270.00 305.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 301.25)">
<title>DataFlow</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-301.25 1265.75,-301.25 1265.75,4 -4,4"/>
<text xml:space="preserve" text-anchor="middle" x="630.88" y="-279.95" font-family="Helvetica,sans-Serif" font-size="14.00">Metrics Data Flow Pipeline</text>
<g id="clust1" class="cluster">
<title>cluster_collect</title>
<polygon fill="#e3f2fd" stroke="black" points="8,-87 8,-164 254,-164 254,-87 8,-87"/>
<text xml:space="preserve" text-anchor="middle" x="131" y="-146.7" font-family="Helvetica,sans-Serif" font-size="14.00">Collection (5s)</text>
</g>
<g id="clust2" class="cluster">
<title>cluster_ingest</title>
<polygon fill="#e8f5e9" stroke="black" points="307,-71 307,-180 562.5,-180 562.5,-71 307,-71"/>
<text xml:space="preserve" text-anchor="middle" x="434.75" y="-162.7" font-family="Helvetica,sans-Serif" font-size="14.00">Ingestion</text>
</g>
<g id="clust3" class="cluster">
<title>cluster_hot</title>
<polygon fill="#fff3e0" stroke="black" points="614.75,-10 614.75,-169 769.5,-169 769.5,-10 614.75,-10"/>
<text xml:space="preserve" text-anchor="middle" x="692.12" y="-151.7" font-family="Helvetica,sans-Serif" font-size="14.00">Hot Path (Real&#45;time)</text>
</g>
<g id="clust4" class="cluster">
<title>cluster_warm</title>
<polygon fill="#fce4ec" stroke="black" points="645.62,-177 645.62,-264 1091.5,-264 1091.5,-177 645.62,-177"/>
<text xml:space="preserve" text-anchor="middle" x="868.56" y="-246.7" font-family="Helvetica,sans-Serif" font-size="14.00">Warm Path (Historical)</text>
</g>
<g id="clust5" class="cluster">
<title>cluster_consume</title>
<polygon fill="#e8eaf6" stroke="black" points="840.5,-8 840.5,-139 935.25,-139 935.25,-8 840.5,-8"/>
<text xml:space="preserve" text-anchor="middle" x="887.88" y="-121.7" font-family="Helvetica,sans-Serif" font-size="14.00">Consumers</text>
</g>
<g id="clust6" class="cluster">
<title>cluster_delivery</title>
<polygon fill="#f3e5f5" stroke="black" points="1005.5,-8 1005.5,-85 1253.75,-85 1253.75,-8 1005.5,-8"/>
<text xml:space="preserve" text-anchor="middle" x="1129.62" y="-67.7" font-family="Helvetica,sans-Serif" font-size="14.00">Delivery (AWS)</text>
</g>
<!-- psutil -->
<g id="node1" class="node">
<title>psutil</title>
<polygon fill="#bbdefb" stroke="black" points="118.25,-131 16,-131 16,-127 12,-127 12,-123 16,-123 16,-103 12,-103 12,-99 16,-99 16,-95 118.25,-95 118.25,-131"/>
<polyline fill="none" stroke="black" points="16,-127 20,-127 20,-123 16,-123"/>
<polyline fill="none" stroke="black" points="16,-103 20,-103 20,-99 16,-99"/>
<text xml:space="preserve" text-anchor="middle" x="67.12" y="-116.25" font-family="Helvetica,sans-Serif" font-size="10.00">psutil</text>
<text xml:space="preserve" text-anchor="middle" x="67.12" y="-103.5" font-family="Helvetica,sans-Serif" font-size="10.00">(CPU, Mem, Disk)</text>
</g>
<!-- collector -->
<g id="node2" class="node">
<title>collector</title>
<path fill="#90caf9" stroke="black" d="M234,-131C234,-131 198.5,-131 198.5,-131 192.5,-131 186.5,-125 186.5,-119 186.5,-119 186.5,-107 186.5,-107 186.5,-101 192.5,-95 198.5,-95 198.5,-95 234,-95 234,-95 240,-95 246,-101 246,-107 246,-107 246,-119 246,-119 246,-125 240,-131 234,-131"/>
<text xml:space="preserve" text-anchor="middle" x="216.25" y="-116.25" font-family="Helvetica,sans-Serif" font-size="10.00">Collector</text>
<text xml:space="preserve" text-anchor="middle" x="216.25" y="-103.5" font-family="Helvetica,sans-Serif" font-size="10.00">Service</text>
</g>
<!-- psutil&#45;&gt;collector -->
<g id="edge1" class="edge">
<title>psutil&#45;&gt;collector</title>
<path fill="none" stroke="black" d="M118.35,-113C136.74,-113 157.31,-113 174.75,-113"/>
<polygon fill="black" stroke="black" points="174.75,-116.5 184.75,-113 174.75,-109.5 174.75,-116.5"/>
<text xml:space="preserve" text-anchor="middle" x="152.38" y="-115.7" font-family="Helvetica,sans-Serif" font-size="9.00">Metrics</text>
</g>
<!-- aggregator -->
<g id="node3" class="node">
<title>aggregator</title>
<path fill="#a5d6a7" stroke="black" d="M373,-131C373,-131 327,-131 327,-131 321,-131 315,-125 315,-119 315,-119 315,-107 315,-107 315,-101 321,-95 327,-95 327,-95 373,-95 373,-95 379,-95 385,-101 385,-107 385,-107 385,-119 385,-119 385,-125 379,-131 373,-131"/>
<text xml:space="preserve" text-anchor="middle" x="350" y="-116.25" font-family="Helvetica,sans-Serif" font-size="10.00">Aggregator</text>
<text xml:space="preserve" text-anchor="middle" x="350" y="-103.5" font-family="Helvetica,sans-Serif" font-size="10.00">(gRPC)</text>
</g>
<!-- collector&#45;&gt;aggregator -->
<g id="edge2" class="edge">
<title>collector&#45;&gt;aggregator</title>
<path fill="none" stroke="black" d="M246.49,-113C263.19,-113 284.49,-113 303.35,-113"/>
<polygon fill="black" stroke="black" points="303.2,-116.5 313.2,-113 303.2,-109.5 303.2,-116.5"/>
<text xml:space="preserve" text-anchor="middle" x="280.5" y="-126.95" font-family="Helvetica,sans-Serif" font-size="9.00">gRPC</text>
<text xml:space="preserve" text-anchor="middle" x="280.5" y="-115.7" font-family="Helvetica,sans-Serif" font-size="9.00">Stream</text>
</g>
<!-- validate -->
<g id="node4" class="node">
<title>validate</title>
<path fill="#c8e6c9" stroke="black" d="M477.54,-141.08C477.54,-141.08 432.71,-118.42 432.71,-118.42 427.35,-115.71 427.35,-110.29 432.71,-107.58 432.71,-107.58 477.54,-84.92 477.54,-84.92 482.9,-82.21 493.6,-82.21 498.96,-84.92 498.96,-84.92 543.79,-107.58 543.79,-107.58 549.15,-110.29 549.15,-115.71 543.79,-118.42 543.79,-118.42 498.96,-141.08 498.96,-141.08 493.6,-143.79 482.9,-143.79 477.54,-141.08"/>
<text xml:space="preserve" text-anchor="middle" x="488.25" y="-116.25" font-family="Helvetica,sans-Serif" font-size="10.00">Validate &amp;</text>
<text xml:space="preserve" text-anchor="middle" x="488.25" y="-103.5" font-family="Helvetica,sans-Serif" font-size="10.00">Normalize</text>
</g>
<!-- aggregator&#45;&gt;validate -->
<g id="edge3" class="edge">
<title>aggregator&#45;&gt;validate</title>
<path fill="none" stroke="black" d="M385.38,-113C392.95,-113 401.25,-113 409.76,-113"/>
<polygon fill="black" stroke="black" points="409.49,-116.5 419.49,-113 409.49,-109.5 409.49,-116.5"/>
</g>
<!-- redis_state -->
<g id="node5" class="node">
<title>redis_state</title>
<path fill="#ffcc80" stroke="black" d="M731.88,-131.84C731.88,-134.15 713.83,-136.03 691.62,-136.03 669.42,-136.03 651.38,-134.15 651.38,-131.84 651.38,-131.84 651.38,-94.16 651.38,-94.16 651.38,-91.85 669.42,-89.97 691.62,-89.97 713.83,-89.97 731.88,-91.85 731.88,-94.16 731.88,-94.16 731.88,-131.84 731.88,-131.84"/>
<path fill="none" stroke="black" d="M731.88,-131.84C731.88,-129.53 713.83,-127.66 691.62,-127.66 669.42,-127.66 651.38,-129.53 651.38,-131.84"/>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-116.25" font-family="Helvetica,sans-Serif" font-size="10.00">Redis</text>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-103.5" font-family="Helvetica,sans-Serif" font-size="10.00">Current State</text>
</g>
<!-- validate&#45;&gt;redis_state -->
<g id="edge4" class="edge">
<title>validate&#45;&gt;redis_state</title>
<path fill="none" stroke="black" d="M555.47,-113C582.9,-113 614.22,-113 639.8,-113"/>
<polygon fill="black" stroke="black" points="639.6,-116.5 649.6,-113 639.6,-109.5 639.6,-116.5"/>
<text xml:space="preserve" text-anchor="middle" x="588.63" y="-115.7" font-family="Helvetica,sans-Serif" font-size="9.00">Upsert</text>
</g>
<!-- redis_pubsub -->
<g id="node6" class="node">
<title>redis_pubsub</title>
<path fill="#ffb74d" stroke="black" d="M729.05,-54.12C729.05,-54.12 721.56,-63.24 721.56,-63.24 717.82,-67.79 708.18,-72.35 702.28,-72.35 702.28,-72.35 680.97,-72.35 680.97,-72.35 675.07,-72.35 665.43,-67.79 661.69,-63.24 661.69,-63.24 654.2,-54.12 654.2,-54.12 650.46,-49.56 650.46,-40.44 654.2,-35.88 654.2,-35.88 661.69,-26.76 661.69,-26.76 665.43,-22.21 675.07,-17.65 680.97,-17.65 680.97,-17.65 702.28,-17.65 702.28,-17.65 708.18,-17.65 717.82,-22.21 721.56,-26.76 721.56,-26.76 729.05,-35.88 729.05,-35.88 732.79,-40.44 732.79,-49.56 729.05,-54.12"/>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-48.25" font-family="Helvetica,sans-Serif" font-size="10.00">Redis</text>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-35.5" font-family="Helvetica,sans-Serif" font-size="10.00">Pub/Sub</text>
</g>
<!-- validate&#45;&gt;redis_pubsub -->
<g id="edge5" class="edge">
<title>validate&#45;&gt;redis_pubsub</title>
<path fill="none" stroke="black" d="M529.04,-99.57C562.44,-88.28 610.18,-72.17 645.1,-60.37"/>
<polygon fill="black" stroke="black" points="646.17,-63.71 654.53,-57.19 643.93,-57.07 646.17,-63.71"/>
<text xml:space="preserve" text-anchor="middle" x="588.63" y="-85.77" font-family="Helvetica,sans-Serif" font-size="9.00">Publish</text>
</g>
<!-- raw -->
<g id="node7" class="node">
<title>raw</title>
<path fill="#f8bbd9" stroke="black" d="M729.62,-226.84C729.62,-229.15 712.59,-231.03 691.62,-231.03 670.66,-231.03 653.62,-229.15 653.62,-226.84 653.62,-226.84 653.62,-189.16 653.62,-189.16 653.62,-186.85 670.66,-184.97 691.62,-184.97 712.59,-184.97 729.62,-186.85 729.62,-189.16 729.62,-189.16 729.62,-226.84 729.62,-226.84"/>
<path fill="none" stroke="black" d="M729.62,-226.84C729.62,-224.53 712.59,-222.66 691.62,-222.66 670.66,-222.66 653.62,-224.53 653.62,-226.84"/>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-211.25" font-family="Helvetica,sans-Serif" font-size="10.00">metrics_raw</text>
<text xml:space="preserve" text-anchor="middle" x="691.62" y="-198.5" font-family="Helvetica,sans-Serif" font-size="10.00">(5s, 24h)</text>
</g>
<!-- validate&#45;&gt;raw -->
<g id="edge6" class="edge">
<title>validate&#45;&gt;raw</title>
<path fill="none" stroke="black" d="M523.01,-129.3C548.24,-141.44 583.6,-158.37 614.75,-173 623.81,-177.26 633.5,-181.76 642.83,-186.07"/>
<polygon fill="black" stroke="black" points="641.22,-189.19 651.77,-190.2 644.16,-182.83 641.22,-189.19"/>
<text xml:space="preserve" text-anchor="middle" x="588.63" y="-170.9" font-family="Helvetica,sans-Serif" font-size="9.00">Insert</text>
</g>
<!-- alerts -->
<g id="node10" class="node">
<title>alerts</title>
<path fill="#c5cae9" stroke="black" d="M902.38,-106C902.38,-106 872.38,-106 872.38,-106 866.38,-106 860.38,-100 860.38,-94 860.38,-94 860.38,-82 860.38,-82 860.38,-76 866.38,-70 872.38,-70 872.38,-70 902.38,-70 902.38,-70 908.38,-70 914.38,-76 914.38,-82 914.38,-82 914.38,-94 914.38,-94 914.38,-100 908.38,-106 902.38,-106"/>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-91.25" font-family="Helvetica,sans-Serif" font-size="10.00">Alert</text>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-78.5" font-family="Helvetica,sans-Serif" font-size="10.00">Service</text>
</g>
<!-- redis_pubsub&#45;&gt;alerts -->
<g id="edge7" class="edge">
<title>redis_pubsub&#45;&gt;alerts</title>
<path fill="none" stroke="black" d="M729.98,-53.29C764.26,-60.9 814.78,-72.11 849.05,-79.72"/>
<polygon fill="black" stroke="black" points="848.01,-83.07 858.53,-81.82 849.52,-76.24 848.01,-83.07"/>
<text xml:space="preserve" text-anchor="middle" x="805" y="-77.99" font-family="Helvetica,sans-Serif" font-size="9.00">metrics.*</text>
</g>
<!-- gateway -->
<g id="node11" class="node">
<title>gateway</title>
<path fill="#9fa8da" stroke="black" d="M913.75,-52C913.75,-52 861,-52 861,-52 855,-52 849,-46 849,-40 849,-40 849,-28 849,-28 849,-22 855,-16 861,-16 861,-16 913.75,-16 913.75,-16 919.75,-16 925.75,-22 925.75,-28 925.75,-28 925.75,-40 925.75,-40 925.75,-46 919.75,-52 913.75,-52"/>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-37.25" font-family="Helvetica,sans-Serif" font-size="10.00">Gateway</text>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-24.5" font-family="Helvetica,sans-Serif" font-size="10.00">(WebSocket)</text>
</g>
<!-- redis_pubsub&#45;&gt;gateway -->
<g id="edge8" class="edge">
<title>redis_pubsub&#45;&gt;gateway</title>
<path fill="none" stroke="black" d="M735.14,-42.59C765.3,-40.87 805.86,-38.57 837.38,-36.78"/>
<polygon fill="black" stroke="black" points="837.25,-40.29 847.03,-36.23 836.85,-33.31 837.25,-40.29"/>
<text xml:space="preserve" text-anchor="middle" x="805" y="-42.53" font-family="Helvetica,sans-Serif" font-size="9.00">metrics.*</text>
</g>
<!-- agg_1m -->
<g id="node8" class="node">
<title>agg_1m</title>
<path fill="#f48fb1" stroke="black" d="M924.25,-226.84C924.25,-229.15 907.72,-231.03 887.38,-231.03 867.03,-231.03 850.5,-229.15 850.5,-226.84 850.5,-226.84 850.5,-189.16 850.5,-189.16 850.5,-186.85 867.03,-184.97 887.38,-184.97 907.72,-184.97 924.25,-186.85 924.25,-189.16 924.25,-189.16 924.25,-226.84 924.25,-226.84"/>
<path fill="none" stroke="black" d="M924.25,-226.84C924.25,-224.53 907.72,-222.66 887.38,-222.66 867.03,-222.66 850.5,-224.53 850.5,-226.84"/>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-211.25" font-family="Helvetica,sans-Serif" font-size="10.00">metrics_1m</text>
<text xml:space="preserve" text-anchor="middle" x="887.38" y="-198.5" font-family="Helvetica,sans-Serif" font-size="10.00">(1m, 7d)</text>
</g>
<!-- raw&#45;&gt;agg_1m -->
<g id="edge11" class="edge">
<title>raw&#45;&gt;agg_1m</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M729.98,-208C760.97,-208 805.22,-208 838.74,-208"/>
<polygon fill="black" stroke="black" points="838.6,-211.5 848.6,-208 838.6,-204.5 838.6,-211.5"/>
<text xml:space="preserve" text-anchor="middle" x="805" y="-221.95" font-family="Helvetica,sans-Serif" font-size="9.00">Continuous</text>
<text xml:space="preserve" text-anchor="middle" x="805" y="-210.7" font-family="Helvetica,sans-Serif" font-size="9.00">Aggregate</text>
</g>
<!-- agg_1h -->
<g id="node9" class="node">
<title>agg_1h</title>
<path fill="#ec407a" stroke="black" d="M1083.5,-226.84C1083.5,-229.15 1067.81,-231.03 1048.5,-231.03 1029.19,-231.03 1013.5,-229.15 1013.5,-226.84 1013.5,-226.84 1013.5,-189.16 1013.5,-189.16 1013.5,-186.85 1029.19,-184.97 1048.5,-184.97 1067.81,-184.97 1083.5,-186.85 1083.5,-189.16 1083.5,-189.16 1083.5,-226.84 1083.5,-226.84"/>
<path fill="none" stroke="black" d="M1083.5,-226.84C1083.5,-224.53 1067.81,-222.66 1048.5,-222.66 1029.19,-222.66 1013.5,-224.53 1013.5,-226.84"/>
<text xml:space="preserve" text-anchor="middle" x="1048.5" y="-211.25" font-family="Helvetica,sans-Serif" font-size="10.00">metrics_1h</text>
<text xml:space="preserve" text-anchor="middle" x="1048.5" y="-198.5" font-family="Helvetica,sans-Serif" font-size="10.00">(1h, 90d)</text>
</g>
<!-- agg_1m&#45;&gt;agg_1h -->
<g id="edge12" class="edge">
<title>agg_1m&#45;&gt;agg_1h</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M924.48,-208C947.44,-208 977.36,-208 1001.94,-208"/>
<polygon fill="black" stroke="black" points="1001.66,-211.5 1011.66,-208 1001.66,-204.5 1001.66,-211.5"/>
<text xml:space="preserve" text-anchor="middle" x="970.38" y="-221.95" font-family="Helvetica,sans-Serif" font-size="9.00">Hourly</text>
<text xml:space="preserve" text-anchor="middle" x="970.38" y="-210.7" font-family="Helvetica,sans-Serif" font-size="9.00">Job</text>
</g>
<!-- edge_relay -->
<g id="node12" class="node">
<title>edge_relay</title>
<path fill="#e1bee7" stroke="black" d="M1071.5,-52C1071.5,-52 1025.5,-52 1025.5,-52 1019.5,-52 1013.5,-46 1013.5,-40 1013.5,-40 1013.5,-28 1013.5,-28 1013.5,-22 1019.5,-16 1025.5,-16 1025.5,-16 1071.5,-16 1071.5,-16 1077.5,-16 1083.5,-22 1083.5,-28 1083.5,-28 1083.5,-40 1083.5,-40 1083.5,-46 1077.5,-52 1071.5,-52"/>
<text xml:space="preserve" text-anchor="middle" x="1048.5" y="-37.25" font-family="Helvetica,sans-Serif" font-size="10.00">Edge</text>
<text xml:space="preserve" text-anchor="middle" x="1048.5" y="-24.5" font-family="Helvetica,sans-Serif" font-size="10.00">(WS Relay)</text>
</g>
<!-- gateway&#45;&gt;edge_relay -->
<g id="edge9" class="edge">
<title>gateway&#45;&gt;edge_relay</title>
<path fill="none" stroke="black" d="M926.09,-34C948.75,-34 977.76,-34 1001.73,-34"/>
<polygon fill="black" stroke="black" points="1001.53,-37.5 1011.53,-34 1001.53,-30.5 1001.53,-37.5"/>
<text xml:space="preserve" text-anchor="middle" x="970.38" y="-47.95" font-family="Helvetica,sans-Serif" font-size="9.00">WebSocket</text>
<text xml:space="preserve" text-anchor="middle" x="970.38" y="-36.7" font-family="Helvetica,sans-Serif" font-size="9.00">Forward</text>
</g>
<!-- browser -->
<g id="node13" class="node">
<title>browser</title>
<path fill="#ce93d8" stroke="black" d="M1233.75,-52C1233.75,-52 1181.75,-52 1181.75,-52 1175.75,-52 1169.75,-46 1169.75,-40 1169.75,-40 1169.75,-28 1169.75,-28 1169.75,-22 1175.75,-16 1181.75,-16 1181.75,-16 1233.75,-16 1233.75,-16 1239.75,-16 1245.75,-22 1245.75,-28 1245.75,-28 1245.75,-40 1245.75,-40 1245.75,-46 1239.75,-52 1233.75,-52"/>
<text xml:space="preserve" text-anchor="middle" x="1207.75" y="-37.25" font-family="Helvetica,sans-Serif" font-size="10.00">Browser</text>
<text xml:space="preserve" text-anchor="middle" x="1207.75" y="-24.5" font-family="Helvetica,sans-Serif" font-size="10.00">(Dashboard)</text>
</g>
<!-- edge_relay&#45;&gt;browser -->
<g id="edge10" class="edge">
<title>edge_relay&#45;&gt;browser</title>
<path fill="none" stroke="black" d="M1083.62,-34C1105.36,-34 1133.86,-34 1157.96,-34"/>
<polygon fill="black" stroke="black" points="1157.88,-37.5 1167.88,-34 1157.88,-30.5 1157.88,-37.5"/>
<text xml:space="preserve" text-anchor="middle" x="1126.62" y="-36.7" font-family="Helvetica,sans-Serif" font-size="9.00">WebSocket</text>
</g>
</g>
</svg>