stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Upload image with guid name to S3 before posting to hubot #5

Closed torkelo closed 9 years ago

torkelo commented 9 years ago

To make this work with all clients of Hipchat and Slack the image needs to be publicly accessible, most Grafana installs will be behind firewalls/dmz so the best option is to upload the image to an s3 bucket and link to that.

stephenyeargin commented 9 years ago

Interesting. I can see this working a few different ways, but I'm not certain the best approach -- i have not come across many Hubot script packages that do this, but a simple search shows:

I can look into these to see how to go about it.

Tenzer commented 9 years ago

Wouldn't it also be possible for Hubot to download the rendered graph and post is as a picture to the chat system? You can at least post pictures in Hipchat, I would assume Slack allows the same.

stephenyeargin commented 9 years ago

@Tenzer: I think that would be a possible approach, but it could leave our IRC adapter users out in the cold. Do you know of a hubot package that leverages the platform file upload API?

stephenyeargin commented 9 years ago

/cc @technicalpickles

Tenzer commented 9 years ago

@stephenyeargin: Looking throught both the hubot-hipchat adapter and Hubot documentation, I don't think it's possible to post files by default. It would instead require this plugin to detect which adapter is being used, and then implement the image posting logic for each of them, which may be too much work...

Tenzer commented 9 years ago

Here's a couple of other related Hubot plugins which also store the images on S3:

stephenyeargin commented 9 years ago

Heh. That script by @rick looks familiar. Was just talking to him about it a couple of weeks ago.

rick commented 9 years ago

Feel free to use anything there that's useful. :bow:

rick commented 9 years ago

This issue (https://github.com/rick/hubot-graphme/issues/1) documents the list of things I want to do to consider that graphme adapter ready for general consumption. The S3 uploading generally works but there's a naming bug and some things I want to improve about it.