public class LibratoWriter extends AbstractOutputWriter implements OutputWriter
/v1/metrics HTTP API.
LibratoWriter uses the "query.attribute.type" configuration parameter (via
QueryResult.getType()) to publish the metrics.null or unsupported, metric is exported
as "counter".
Settings:
url": Librato server URL.
Optional, default value: "https://metrics-api.librato.com/v1/metrics".user": Librato user. Mandatorytoken": Librato token. MandatorylibratoApiTimeoutInMillis": read timeout of the calls to Librato HTTP API.
Optional, default value: 1000.enabled": flag to enable/disable the writer. Optional, default value: true.source": Librato . Optional, default value: "#hostname#" (the hostname of the server).| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LIBRATO_API_TIMEOUT_IN_MILLIS |
static String |
DEFAULT_LIBRATO_API_URL |
static String |
DEFAULT_SOURCE |
static String |
METRIC_TYPE_COUNTER |
static String |
METRIC_TYPE_GAUGE |
static String |
SETTING_LIBRATO_API_TIMEOUT_IN_MILLIS |
static String |
SETTING_SOURCE |
SETTING_HOST, SETTING_NAME_PREFIX, SETTING_PORT, SETTING_PROXY_HOST, SETTING_PROXY_PORT, SETTING_TOKEN, SETTING_URL, SETTING_USERNAME| Constructor and Description |
|---|
LibratoWriter() |
| Modifier and Type | Method and Description |
|---|---|
int |
getExceptionCounter() |
void |
serialize(Iterable<QueryResult> counters,
Iterable<QueryResult> gauges,
OutputStream out) |
void |
start()
Load settings
|
void |
write(Iterable<QueryResult> results)
Send given metrics to the Graphite server.
|
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 String METRIC_TYPE_GAUGE
public static final String METRIC_TYPE_COUNTER
public static final String DEFAULT_LIBRATO_API_URL
public static final String SETTING_LIBRATO_API_TIMEOUT_IN_MILLIS
public static final int DEFAULT_LIBRATO_API_TIMEOUT_IN_MILLIS
public static final String SETTING_SOURCE
public static final String DEFAULT_SOURCE
public void start()
start in interface OutputWriterstart in class AbstractOutputWriterpublic void write(Iterable<QueryResult> results)
write in interface OutputWriterwrite in class AbstractOutputWriterpublic void serialize(@Nonnull Iterable<QueryResult> counters, @Nonnull Iterable<QueryResult> gauges, @Nonnull OutputStream out) throws IOException
IOExceptionpublic int getExceptionCounter()
Copyright © 2013. All Rights Reserved.