Much like Heroku, Vektra contains addons. These are prebuilt services that you can turn on and use easily.
The Alpha release comes with 6 addons:
- postgres
- redis
- memcache
- logentries
- logstash
- papertrail
The addons must be enabled using vektra addons:enable <name>
, and they can then be bound to an app using vektra addons:bind <name>
.
Addons advertise the information about themselves via config variables which are seen by our app as environment variables.
This runs a single postgres server that all apps bound to it use. Each app gets a different database automatically when bound.
It exports 2 config variables:
- DATABASE_URL: A URI containing the username, password, host, and database name to use. This follows the traditional format, so your postgres driver should be able to use it directly.
- POSTGRES_URL: The same value as DATABASE_URL
This runs a single redis server that all apps bound to it use. Each app gets a different redis database to use.
It exports 1 config variable:
- REDISURL: This is in the format tcp://host:port/db. Some redis libraries support this format, some don't but you should be able to extract the data easily regardless.
This runs a single memcache server that all apps bound to it use. Each app gets a different namespace to use.
It exports 2 config variables:
- MEMCACHE_HOSTS: A string with the host:port of the memcache server. (It's called hosts so future upgrades to many servers is seamless).
- MEMCACHE_NAMESPACE: The memcache namespace to use for all keys. This keeps each app safe from accidentally using other apps keys.
This sends logs from all apps to Logentries. It does not need to be bound to individual apps.
vektra addons:enable logentries --url data.logentries.com:20000 --ssl true --token secret
It exports 3 config variables:
- LOGENTRIES_URL: Logentries host and port to send logs to.
- LOGENTRIES_SSL: Defaults to true to send logs over TLS. Set to false to send logs over plain TCP.
- LOGENTRIES_TOKEN: Token obtained via Logentries UI.
This sends logs from all apps to Logstash. It does not need to be bound to individual apps.
vektra addons:enable logstash --url example.com:1234 --ssl true
It exports 2 config variables:
- LOGSTASH_URL: Logstash host and port to send logs to.
- LOGSTASH_SSL: Defaults to true to send logs over TLS. Set to false to send logs over plain TCP.
This sends logs from all apps to Papertrail. It does not need to be bound to individual apps.
vektra addons:enable papertrail --url logs2.papertrailapp.com:37197 --ssl true
It exports 2 config variables:
- PAPERTRAIL_URL: Papertrail host and port to send logs to.
- PAPERTRAIL_SSL: Defaults to true to send logs over TLS.. Set to false to send logs over plain TCP.