Skip to content
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

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

Open
flyingbarron opened this issue Jun 27, 2019 · 6 comments
Open

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

flyingbarron opened this issue Jun 27, 2019 · 6 comments

Comments

@flyingbarron
Copy link

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
Copy link
Member

lebauce commented Jun 28, 2019

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
Copy link
Author

Exactly :)

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

@eranra
Copy link
Contributor

eranra commented Jun 30, 2019

@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
Copy link
Collaborator

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
Copy link
Collaborator

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

@flyingbarron
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants