 #   HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY - Optional; Secret access key for S3
 #   HUBOT_GRAFANA_S3_PREFIX - Optional; Bucket prefix (useful for shared buckets)
 #   HUBOT_GRAFANA_S3_REGION - Optional; Bucket region (defaults to us-standard)
+#   HUBOT_SLACK_URL - Optional; You should use this if you are using slack adapter and you don't own an S3 account.
 #
 # Dependencies:
 #   "knox": "^0.9.2"


    request url, requestHeaders, (err, res, body) ->
      robot.logger.debug "Uploading file: #{body.length} bytes, content-type[#{res.headers['content-type']}]"
      uploadToS3(msg, title, link, body, body.length, res.headers['content-type'])

  # Upload image to S3
  uploadToS3 = (msg, title, link, content, length, content_type) ->
    client = knox.createClient {
        key      : s3_access_key
        secret   : s3_secret_key,
        bucket   : s3_bucket,

    "#{prefix}/#{crypto.randomBytes(20).toString('hex')}.png"

  # Fetch an image from provided URL, upload it to S3, returning the resulting URL
  uploadChart = (msg, title, url, link, site) ->
    if grafana_api_key
        requestHeaders =
          encoding: null,
