Skip to content
Cyrille Le Clerc edited this page Aug 19, 2013 · 3 revisions

Send metrics to Stackdriver monitoring custom metrics gateway.

Settings

  • url: Stackdriver server URL. Optional, default value: https://custom-gateway.stackdriver.com/v1/custom.
  • token: Stackdriver API key: mandatory,
  • stackdriverApiTimeoutInMillis: read timeout of the calls to Stackdriver HTTP API. Optional, default value: 1000.
  • source: Instance ID for the machine sending the data . Optional, if no instance ID is set then the metrics will be custom metrics not associated with an ID
  • detectInstance: Set to 'AWS' to try to auto-detect the ID of the Amazon EC2 instance that this code is running on using the local HTTP metadata service. If source is specified it will take precedence. Optional.

Sample configuration

"outputWriters": [
    {
        "@class": "org.jmxtrans.embedded.output.StackdriverWriter",
        "settings": {
            "token": "${stackdriver.apikey}",
            "source": "${stackdriver.source}"
        }
    }
]

Note: You will need to have a Stackdriver (http://www.stackdriver.com) account configured and generate an API key. The source parameter could be filled by a deploy script (or Puppet/Chef) to the local instance ID, or configured manually.

Generating a Stackdriver API Key

Choose My Account->Account Settings in the Stackdriver Navigation, then click the Create New API Key link to make a new API key, or use the value for any existing key under your account by clicking its name. This screenshot illustrates the Account Settings page.

Stackdriver Account Settings Page Screenshot