Skip to content

Instantly share code, notes, and snippets.

@eruvanos
Last active January 25, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eruvanos/72cc40551b6c6fd8b1d497d0cd9d1973 to your computer and use it in GitHub Desktop.
Save eruvanos/72cc40551b6c6fd8b1d497d0cd9d1973 to your computer and use it in GitHub Desktop.
Read NewRelic License key from VCAP_SERVICES
#!/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