A ruboty plugin that fetches data from Redash.
Add this line to your application's Gemfile:
gem 'ruboty-redash', github: 'mallowlabs/ruboty-redash'
And then execute:
$ bundle
@ruboty redash show <query_id> <format>
You can get query_id
from the URL in query page.
Example:
@ruboty redash show 9 Today's KPI is <%= data['rows'][-1]['kpi'] =>
format
is specified with ERB.
In ERB, data
format is below:
{
"rows": [
{
"kpi": 123,
...
},
...
],
"columns": [
{
"friendly_name": "kpi",
"type": "integer",
"name": "kpi"
},
...
]
}
columns names vary by environments.
REDASH_ROOT
: Redash URL root (ex: https://your.redash.host)REDASH_USER_APIKEY
: Your Redash API keyREDASH_HTTP_PROXY_URL
: (Optional) HTTP Proxy URL
How to run specs:
$ bundle exec rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/mallowlabs/ruboty-redash.
The gem is available as open source under the terms of the MIT License.