Last active
January 25, 2019 14:24
-
-
Save eruvanos/72cc40551b6c6fd8b1d497d0cd9d1973 to your computer and use it in GitHub Desktop.
Read NewRelic License key from VCAP_SERVICES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# put into .profile.d/ | |
LICENSE_KEY=$(echo $VCAP_SERVICES | jq -r '.[] | select(.[].name | contains("newrelic"))| .[0].credentials.licenseKey') | |
if test -z "$LICENSE_KEY" | |
then | |
echo "INFO: No New Relic service bound to app" | |
else | |
echo "INFO: New Relic service found" | |
fi | |
export NEW_RELIC_LICENSE_KEY=$LICENSE_KEY | |
export NEW_RELIC_LOG_LEVEL="INFO" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment