Graphite Emitter

To use this extension, make sure to includegraphite-emitter extension.

Introduction

This extension emits druid metrics to a graphite carbon server.
Metrics can be sent by using plaintext or pickle protocol.
The pickle protocol is more efficient and supports sending batches of metrics (plaintext protocol send only one metric) in one request; batch size is configurable.

Configuration

All the configuration parameters for graphite emitter are under druid.emitter.graphite.

property

description

required?

default

druid.emitter.graphite.hostname

The hostname of the graphite server.

yes

none

druid.emitter.graphite.port

The port of the graphite server.

yes

none

druid.emitter.graphite.batchSize

Number of events to send as one batch (only for pickle protocol)

no

100

druid.emitter.graphite.protocol

Graphite protocol; available protocols: pickle, plaintext.

no

pickle

druid.emitter.graphite.eventConverter

Filter and converter of druid events to graphite event (please see next section).

yes

none

druid.emitter.graphite.flushPeriod

Queue flushing period in milliseconds.

no

1 minute

druid.emitter.graphite.maxQueueSize

Maximum size of the queue used to buffer events.

no

MAX_INT

druid.emitter.graphite.alertEmitters

List of emitters where alerts will be forwarded to. This is a JSON list of emitter names, e.g. ["logging", "http"]

no

empty list (no forwarding)

druid.emitter.graphite.requestLogEmitters

List of emitters where request logs (i.e., query logging events sent to emitters when druid.request.logging.type is set to emitter) will be forwarded to. This is a JSON list of emitter names, e.g. ["logging", "http"]

no

empty list (no forwarding)

druid.emitter.graphite.emitWaitTime

wait time in milliseconds to try to send the event otherwise emitter will throwing event.

no

0

druid.emitter.graphite.waitForEventTime

waiting time in milliseconds if necessary for an event to become available.

no

1000 (1 sec)

Supported event types

The graphite emitter only emits service metric events to graphite (See Druid Metrics for a list of metrics).

Alerts and request logs are not sent to graphite. These event types are not well represented in Graphite, which is more suited for timeseries views on numeric metrics, vs. storing non-numeric log events.

Instead, alerts and request logs are optionally forwarded to other emitter implementations, specified by druid.emitter.graphite.alertEmitters and druid.emitter.graphite.requestLogEmitters respectively.

Send-All converter

The first implementation called all, will send all the druid service metrics events.
The path will be in the form <namespacePrefix>.[<druid service name>].[<druid hostname>].<dimensions values ordered by dimension's name>.<metric>
User has control of <namespacePrefix>.[<druid service name>].[<druid hostname>].

You can omit the hostname by setting ignoreHostname=truedruid.SERVICE_NAME.dataSourceName.queryType.query/time

You can omit the service name by setting ignoreServiceName=truedruid.HOSTNAME.dataSourceName.queryType.query/time

Elements in metric name by default are separated by "/", so graphite will create all metrics on one level. If you want to have metrics in the tree structure, you have to set replaceSlashWithDot=true
Original: druid.HOSTNAME.dataSourceName.queryType.query/time
Changed: druid.HOSTNAME.dataSourceName.queryType.query.time

White-list based converter

The second implementation called whiteList, will send only the white listed metrics and dimensions.
Same as for the all converter user has control of <namespacePrefix>.[<druid service name>].[<druid hostname>].
White-list based converter comes with the following default white list map located under resources in ./src/main/resources/defaultWhiteListMap.json

Although user can override the default white list map by supplying a property called mapPath.
This property is a String containing the path for the file containing white list map Json object.
For example the following converter will read the map from the file /pathPrefix/fileName.json.