XAP is shipped with built-in support for InfluxDB v0.9. This page explains how to configure XAP to report metrics to InfluxDB.
Configuration takes place in
metrics.xml, which resides in
XAP_HOME/config/metrics. For more information see Configuration.
InfluxDB provides an HTTP API for writing data, which is implemented by XAP. For example, if InfluxDB is installed on
localhost and you want to report metrics to the
mydb database, use the following configuration:
<metrics-configuration> <reporters> <reporter name="influxdb"> <property name="host" value="localhost"/> <property name="database" value="mydb"/> </reporter> </reporters> </metrics-configuration>
The InfluxDB HTTP API is bounded to port
8086 by default. If you've configured your InfluxDB instance to use a different port you should modify the reporter configuration accordingly and add a
<property name="port" value="nnnn"/> with the new port.
InfluxDB security is disabled by default. Should you choose to enable it, add a
password properties to the configuration to specify the credentials which will be used by the reporter.
InfluxDB uses retention policies to define how long the data is stored and how it's replicated accross the cluster. You can configure a
retention-policy property to instruct the reporter which retention policy to write to. If not set, the default retention policy of the database will be used.
The InfluxDB reporter batches multiple metrics within each report to maximize performance, up to a maximum value determined by the
max-report-length property. The default value is
65507 (based on UDP max length), and usually should not be changed.
InfluxDB allows you to write data through UDP. Note that by default, no InfluxDB ports are open to UDP. To configure InfluxDB to support writes over UDP you must adjust its config file. Once you do, you need to configure XAP InfluxDB reporter to use
udp by adding a
<property name="protocol" value="udp"/> property to the configuration. You should also specify the port you've set in InfluxDB config file.
Note that when using
udp the database is configured for the UDP endpoint at the InfluxDB config file, so there's no need to configure it in XAP.