You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.
Currently, the agent-conf.json file links my codebase to a specific instance of Librato. This violates a core concept of twelve-factor, namely the strict separation of configuration from code:
Apps sometimes store config as constants in the code. This is a violation of twelve-factor, which requires strict separation of config from code. Config varies substantially across deploys, code does not.
As the twelve-factor page I linked to earlier describes in more detail and much more clearly than I ever could, this is a problem because I'm deploying the same codebase to various instances, in my case production, staging, various demo instances for sales as well as a review app for each feature branch.
Please provide and document a way to support a maintainable Heroku setup, following the twelve-factor methodology.
The text was updated successfully, but these errors were encountered:
hheimbuerger
changed the title
agent-conf.json file violates twelve-factor methodology for Heroku apps
agent-conf.json file violates twelve-factor methodology of Heroku apps
Apr 7, 2016
I have multiple Heroku apps, representing different stages in the apps lifecycle: production, staging, reviews, etc.
My main interest was to selectively enable Librato for some Heroku apps (production) and have it completely disabled (i.e. the instrumention being a noop) on all other apps (staging, review, etc.).
I really wish this was just built into librato-python-web, but for now I've built my own wrapper script as a workaround:
bin/librato-wrapper in my Heroku codebase:
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if [ "${LIBRATO_ENABLED:-}" = "true" ]
then
echo "Found LIBRATO_ENABLED, enabling Librato instrumentation..."
exec librato-launch "$@"
else
echo "Skipping Librato instrumentation as LIBRATO_ENABLED was not set."
exec "$@"
fi
(I'm not a bash expert, so suggestions are very welcome. I'm specifically hoping that this doesn't break Heroku's process watching and restarting. I've made the mistake of using && in my Procfile before and it took me months to track that down.)
Now the librato-launch instrumentation is only run when the environment variable LIBRATO_ENABLED is set to true (in my case: only in production) and is skipped in all other cases.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm running an app on Heroku, which is a PaaS built upon the twelve-factor methodology.
Currently, the
agent-conf.json
file links my codebase to a specific instance of Librato. This violates a core concept of twelve-factor, namely the strict separation of configuration from code:As the twelve-factor page I linked to earlier describes in more detail and much more clearly than I ever could, this is a problem because I'm deploying the same codebase to various instances, in my case production, staging, various demo instances for sales as well as a review app for each feature branch.
Please provide and document a way to support a maintainable Heroku setup, following the twelve-factor methodology.
The text was updated successfully, but these errors were encountered: