-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge edges #358
Comments
Not exactly sure what your situation is, but using the Advanced Web Service with On-Premise example as a starting point, as it does have a noisy amount of edges. One hack is to get creative with Compare the output below to the example output linked to above . from diagrams import Cluster, Diagram
from diagrams.onprem.analytics import Spark
from diagrams.onprem.compute import Server
from diagrams.onprem.database import PostgreSQL
from diagrams.onprem.inmemory import Redis
from diagrams.onprem.logging import Fluentd
from diagrams.onprem.monitoring import Grafana, Prometheus
from diagrams.onprem.network import Nginx
from diagrams.onprem.queue import Kafka
from diagrams.custom import Custom
with Diagram("\nAdvanced Web Service with On-Premise", show=False) as diag:
ingress = Nginx("ingress")
with Cluster("Service Cluster"):
serv1 = Server("grpc1")
serv2 = Server("grpc2")
serv3 = Server("grpc3")
with Cluster(""):
blankHA = Custom("","tranparent.png")
metrics = Prometheus("metric")
metrics << Grafana("monitoring")
aggregator = Fluentd("logging")
blankHA >> aggregator >> Kafka("stream") >> Spark("analytics")
with Cluster("Database HA"):
master = PostgreSQL("users")
master - PostgreSQL("slave") << metrics
blankHA >> master
with Cluster("Sessions HA"):
master = Redis("session")
master - Redis("replica") << metrics
blankHA >> master
ingress >> serv2 >> blankHA
diag |
Here is another option: with Diagram("\nAdvanced Web Service with On-Premise", show=False, graph_attr=graph_attr) as diag:
ingress = Nginx("ingress")
with Cluster("Service Cluster"):
serv1 = Server("grpc1")
serv2 = Server("grpc2")
serv3 = Server("grpc3")
(
serv1 - Edge(minlen="0") -
serv2 - Edge(minlen="0") -
serv3
)
with Cluster(""):
metrics = Prometheus("metric")
metrics << Grafana("monitoring")
with Cluster("Sessions HA"):
master = Redis("session")
master - Redis("replica") << metrics
with Cluster("Database HA"):
users = PostgreSQL("users")
users - PostgreSQL("slave") << metrics
aggregator = Fluentd("logging")
aggregator >> Kafka("stream") >> Spark("analytics")
ingress >> serv2 >> Edge(minlen="2") >> [master, users, aggregator]
diag |
@servo1x yet another option is to set the Note the following restrictions:
For more information see:
Here is a simple example: graph_attr = {
"concentrate":"true",
"splines":"spline",
}
edge_attr = {
"minlen":"3",
}
with Diagram("", show=False,
graph_attr=graph_attr,
edge_attr=edge_attr) as diag:
with Cluster("Service Cluster"):
grpsrv = [
Server("grpc1"),
Server("grpc2"),
Server("grpc3")]
db = PostgreSQL("users")
grpsrv[0] >> Edge(tailport="se", headport="w") >> db
grpsrv[1] >> Edge(tailport="e", headport="w") >> db
grpsrv[2] >> Edge(tailport="ne", headport="w") >> db
diag Here is the same example from the previous posts, but as you can see it is still a bit messy. graph_attr = {
"layout":"dot",
"concentrate":"true",
"splines":"spline",
}
edge_attr = {
"minlen":"2",
}
with Diagram("\n\nAdvanced Web Service with On-Premise", show=False,
graph_attr=graph_attr,
edge_attr=edge_attr) as diag:
ingress = Nginx("ingress")
metrics = Prometheus("metric")
metrics << Grafana("monitoring")
with Cluster("Service Cluster"):
grpsrv = [
Server("grpc1"),
Server("grpc2"),
Server("grpc3")]
with Cluster("Sessions HA"):
sess = Redis("session")
sess - Redis("replica") << metrics
with Cluster("Database HA"):
db = PostgreSQL("users")
db - PostgreSQL("slave") << metrics
aggregator = Fluentd("logging")
aggregator >> Kafka("stream") >> Spark("analytics")
ingress >> [grpsrv[0], grpsrv[1], grpsrv[2],]
[grpsrv[0], grpsrv[1], grpsrv[2],] >> Edge(headport="w", minlen="3") >> sess
[grpsrv[0], grpsrv[1], grpsrv[2],] >> Edge(headport="w", minlen="3") >> db
[grpsrv[0], grpsrv[1], grpsrv[2],] >> Edge(headport="w", minlen="3") >> aggregator
diag |
Kept trying and found something better: with Diagram("\n\nAdvanced Web Service with On-Premise", show=False,
graph_attr=graph_attr,
edge_attr=edge_attr) as diag:
ingress = Nginx("ingress")
metrics = Prometheus("metric")
metrics << Edge(minlen="0") << Grafana("monitoring")
with Cluster("Service Cluster"):
grpsrv = [
Server("grpc1"),
Server("grpc2"),
Server("grpc3")]
blank = Node("", shape="plaintext", height="0.0", width="0.0")
with Cluster("Sessions HA"):
sess = Redis("session")
sess - Redis("replica") << metrics
with Cluster("Database HA"):
db = PostgreSQL("users")
db - PostgreSQL("slave") << metrics
aggregator = Fluentd("logging")
aggregator >> Kafka("stream") >> Spark("analytics")
ingress >> [grpsrv[0], grpsrv[1], grpsrv[2],]
[grpsrv[0], grpsrv[1], grpsrv[2],] - Edge(headport="w", minlen="1") - blank
blank >> Edge(headport="w", minlen="2") >> [sess, db, aggregator]
diag |
On very large diagrams, having separate edges for each relationship becomes really noisy. Is it possible to merge edges?
The text was updated successfully, but these errors were encountered: