ex_gecko v0.1.0 ExGecko.Adapter.Heroku
Interacts with heroku cli to get latest logs, so that we can send the data to geckobard.
The heroku adapter accepts following arguments:
type
: One ofdb
,db-server
,pg-backup
,memory
andload
app
: The heroku app you are wishing to pump logs fromlines
: Number of lines to pull from logs (not applicable forpg-backup
)
Under the hood, it runs heroku command:
heroku log --app <app_name> --num 1000
heroku pg:backups --app <app_name>
Summary
Functions
Few sample lines:
“2016-08-02T22:23:31.718210+00:00 heroku[web.1]: source=web.1 dyno=heroku.49170529.b313ea93-6d23-470c-af62-2e7bf7acd76d sample#load_avg_1m=0.00 sample#load_avg_5m=0.08 sample#load_avg_15m=0.20” “2016-08-02T22:23:31.718381+00:00 heroku[web.1]: source=web.1 dyno=heroku.49170529.b313ea93-6d23-470c-af62-2e7bf7acd76d sample#memory_total=125.00MB sample#memory_rss=119.61MB sample#memory_cache=5.38MB sample#memory_swap=0.00MB sample#memory_pgpgin=415421pages sample#memory_pgpgout=386999pages sample#memory_quota=512.00MB” “2016-08-02T22:22:52+00:00 app[heroku-postgres]: source=HEROKU_POSTGRESQL_PINK sample#current_transaction=4171563.0 sample#db_size=1279201044.0bytes sample#tables=10 sample#active-connections=2 sample#waiting-connections=0 sample#index-cache-hit-rate=0.42019 sample#table-cache-hit-rate=0.78018 sample#load-avg-1m=0.025 sample#load-avg-5m=0.015 sample#load-avg-15m=0.025 sample#read-iops=0 sample#write-iops=0 sample#memory-total=3786332.0kB sample#memory-free=151956kB sample#memory-cached=3286396.0kB sample#memory-postgres=14840kB”
Examples
iex> ExGecko.Adapter.Heroku.porcelain_args("pg-backup", "brighterlink", "1000")
["pg:backups", "--app", "brighterlink"]
iex> ExGecko.Adapter.Heroku.porcelain_args("load", "brighterlink", "1000")
["logs", "--app", "brighterlink", "--num", "1000"]