Accessing the API Key within your app¶
Now that the add-on has been setup, the Hosted Graphite API Key will be available via the environment variable HOSTEDGRAPHITE_APIKEY. See the appropriate language snippet below for an example on how to access this variable in your app.
apikey = ENV['HOSTEDGRAPHITE_APIKEY']
See also: Sending Metrics with Ruby
apikey = os.environ['HOSTEDGRAPHITE_APIKEY']
See also: Sending Metrics with Python
String apikey = System.getenv("HOSTEDGRAPHITE_APIKEY");
See also: Sending Metrics with Java
$apikey = getenv('HOSTEDGRAPHITE_APIKEY');
See also: Sending Metrics with PHP
var apikey = process.env.HOSTEDGRAPHITE_APIKEY;
See also: Sending Metrics with Node.js
- If I have trouble with my metrics, should I remove and re-add the Hosted Graphite plugin?