skydive-project / skydive

An open source real-time network topology and protocols analyzer
https://skydive.network
Apache License 2.0
2.67k stars 400 forks source link

Have an API call that will render a PNG of a graph #1889

Open flyingbarron opened 5 years ago

flyingbarron commented 5 years ago

Currently, the only way to share a skydive graph requires the user to login to skydive and render the graph again in realtime.

This makes is more difficult to share a specific graph easily.

Use cases - embed the png in a mail or in a chat platform like Slack. Example of use in another application: https://play.grafana.org/render/d/000000029/prometheus-demo-dashboard?orgId=1&refresh=5m vs https://play.grafana.org/d/000000029/prometheus-demo-dashboard?orgId=1&refresh=5m

lebauce commented 5 years ago

There is a way to retrieve the graph using the DOT format : skydive client query --format dot G > graph.dot

Then, you can use graphviz to convert it to a PNG : dot -Tpng graph.dot -o outfile.png

However, it won't look as (nice as ?) with the WebUI

flyingbarron commented 5 years ago

Exactly :)

You'd lose a lot with this back door method.

eranra commented 5 years ago

@lebauce can we use iFrame and Skydive launch-in-context ?

(https://community.grafana.com/t/text-box-iframe/11663)

BTW: For new versions of grafana need to configure: https://grafana.com/docs/installation/configuration/#disable-sanitize-html (so this will not work out of the box with play.grafana.org which uses latest grafana)

safchain commented 5 years ago

Another approach could be to use the topology export/import

SKYDIVE_ANALYZER=127.0.0.1:8082 skydive client topology export > skydive.json
SKYDIVE_ANALYZER=127.0.0.1:8082 skydive client topology import --file skydive.json

You can import to an external analyzer. All topology data will be import and one can use the WebUI.

hunchback commented 5 years ago

@RobertJBarron - does the above provide a reasonable solution? if so then please close issue

flyingbarron commented 5 years ago

Not really. I'm asking for an API that will return an image in realtime, not export the data that then needs to be massaged/visualized by a 3rd party/offline.