public class StackdriverWriter extends AbstractOutputWriter implements OutputWriter
/v1/metrics
HTTP API.
Settings:
url": Stackdriver server URL. Optional, default value: "https://custom-gateway.stackdriver.com/v1/custom".token": Stackdriver API token. Mandatorysource": Instance of the machine ID that the JMX data is being collected from. Optional.
detectInstance": Set to "AWS" if you want to detect the local AWS instance ID on startup. Optional.
stackdriverApiTimeoutInMillis": read timeout of the calls to Stackdriver HTTP API. Optional, default
value: 1000.enabled": flag to enable/disable the writer. Optional, default value: true.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_STACKDRIVER_API_TIMEOUT_IN_MILLIS |
static String |
DEFAULT_STACKDRIVER_API_URL |
static String |
SETTING_DETECT_INSTANCE |
static String |
SETTING_SOURCE_INSTANCE |
static String |
SETTING_STACKDRIVER_API_TIMEOUT_IN_MILLIS |
static int |
STACKDRIVER_PROTOCOL_VERSION |
SETTING_HOST, SETTING_NAME_PREFIX, SETTING_PORT, SETTING_PROXY_HOST, SETTING_PROXY_PORT, SETTING_TOKEN, SETTING_URL, SETTING_USERNAME| Constructor and Description |
|---|
StackdriverWriter() |
| Modifier and Type | Method and Description |
|---|---|
int |
getExceptionCounter() |
void |
serialize(Iterable<QueryResult> results,
OutputStream out)
Put the values into the JSON format expected by the Stackdriver custom metrics gateway
|
void |
start()
Initial setup for the writer class.
|
void |
write(Iterable<QueryResult> results)
Send given metrics to the Stackdriver server using HTTP
|
equals, getBooleanSetting, getIntSetting, getIntSetting, getLongSetting, getSettings, getStrategy, getStringSetting, getStringSetting, hashCode, isEnabled, setEnabled, setSettings, setStrategy, stop, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSettings, isEnabled, setEnabled, setSettings, stoppublic static final int STACKDRIVER_PROTOCOL_VERSION
public static final String SETTING_SOURCE_INSTANCE
public static final String SETTING_DETECT_INSTANCE
public static final String DEFAULT_STACKDRIVER_API_URL
public static final String SETTING_STACKDRIVER_API_TIMEOUT_IN_MILLIS
public static final int DEFAULT_STACKDRIVER_API_TIMEOUT_IN_MILLIS
public void start()
start in interface OutputWriterstart in class AbstractOutputWriterpublic void write(Iterable<QueryResult> results)
write in interface OutputWriterwrite in class AbstractOutputWriterresults - Iterable collection of data pointspublic void serialize(@Nonnull Iterable<QueryResult> results, @Nonnull OutputStream out) throws IOException
results - Iterable collection of data points (gauges and counters)out - OutputStream to write JSON toIOExceptionpublic int getExceptionCounter()
Copyright © 2013. All Rights Reserved.